<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="WorkComments.aspx.cs" Inherits="VMT.WorkComments" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphJavaScriptContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphPageTitleContentPlaceHolder" runat="server">
    <div id="CssPageTitle">
        <h1>Work Notes 
        </h1>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphMainContentPlaceHolder" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <div id="loaderdiv">
                <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel2" DynamicLayout="true">
                    <ProgressTemplate>

                        <img src="resource_gallery/graphics/loader.gif" class="ajax-loader">
                    </ProgressTemplate>
                </asp:UpdateProgress>
            </div>
            <div style="text-align: right;"><a href="default.aspx">Home</a> <strong>&#8249;&#8249;</strong> <a href="Analysis.aspx">Analysis</a> <strong>&#8249;&#8249;</strong> Work Notes View</div>
            <div>
                <fieldset class="masterform">
                    <legend>Work Notes View</legend>
                    <div style="width: 100%; height: 300px;">
                        <table>
                            <tr>
                                <td>Business Unit:
                                <asp:DropDownList ID="ddlBUnit" runat="server" OnSelectedIndexChanged="ddlBUnit_SelectedIndexChanged" AutoPostBack="true" OnDataBound="ddlBUnit_DataBound">
                                </asp:DropDownList>
                                </td>

                                <td>Project/Event:
                                <asp:DropDownList ID="ddlEventCode" runat="server" OnSelectedIndexChanged="ddlEventCode_SelectedIndexChanged" AutoPostBack="true" OnDataBound="ddlEventCode_DataBound">
                                </asp:DropDownList>
                                </td>

                                <td>Section/WA:
                                <asp:DropDownList ID="ddlWorkArea" runat="server" OnSelectedIndexChanged="ddlWorkArea_SelectedIndexChanged" AutoPostBack="true" OnDataBound="ddlWorkArea_DataBound">
                                </asp:DropDownList>
                                </td>
                            </tr>
                        </table>
                        <br />
                        <div style="width: 100%; height: 240px; overflow-y: scroll;">
                            <br />
                            <asp:GridView ID="gdvBidProcess" runat="server" HeaderStyle-CssClass="FixedHeader" BorderColor="#014567" CellPadding="3" OnRowDataBound="gdvBidProcess_RowDataBound"
                                AutoGenerateColumns="False" EmptyDataText="No data in the data source." OnRowEditing="gdvBidProcess_RowEditing" OnRowCancelingEdit="gdvBidProcess_RowCancelingEdit"
                                 OnRowDeleting="gdvBidProcess_RowDeleting" OnRowUpdating="gdvBidProcess_RowUpdating"
                                OnSorting="gdvBidProcess_Sorting" AllowSorting="True">
                                <AlternatingRowStyle BackColor="#E9EFF2" />
                                <Columns>
                                   
                                      <asp:TemplateField HeaderText="View" ShowHeader="False"  HeaderStyle-Width="31px" ItemStyle-Width="30px">
                                                <ItemTemplate>
                                                    <a href='<%=System.Configuration.ConfigurationManager.AppSettings["VMSWorkLink"]%>?wnotes=<%# Eval("WORKCOMMENTID") %>' target="_blank"> <img src="resource_gallery/graphics/map_view.png" width="25px"  height="20px"/></a>
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Center" />
                                     </asp:TemplateField>


                                    <asp:TemplateField SortExpression="EVENT_CODE" HeaderStyle-Width="71px" ItemStyle-Width="70px">
                                        <HeaderTemplate>
                                            <asp:LinkButton ID="LinkButton3" runat="server" Text="PROJECT" CommandName="Sort" CommandArgument="EVENT_CODE" ForeColor="Black" />
                                        </HeaderTemplate>
                                        <ItemTemplate>                                            
                                            <%--<%# Eval("EVENT_CODE") %>--%>
                                            <a href='<%=System.Configuration.ConfigurationManager.AppSettings["VMSWorkLink"]%>?bu=0&ec=<%# Eval("EVENT_CODE_ID") %>&wa=0&yr=0' target="_blank"><asp:Label ID="lbl_EVENT_CODE" runat="server" Text='<%# Bind("EVENT_CODE") %>'></asp:Label>  </a>
                                        </ItemTemplate>
                                         <HeaderStyle Width="71px" />
                                         <ItemStyle Width="70px" />
                                    </asp:TemplateField>

                                     <asp:TemplateField SortExpression="WORK_AREA" HeaderStyle-Width="81px" ItemStyle-Width="80px">
                                        <HeaderTemplate>
                                            <asp:LinkButton ID="LinkButton3" runat="server" Text="SECTION" CommandName="Sort" CommandArgument="WORK_AREA" ForeColor="Black" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            
                                            <%--<%# Eval("WORK_AREA") %>--%>
                                            <a href='<%=System.Configuration.ConfigurationManager.AppSettings["VMSWorkLink"]%>?bu=0&ec=<%# Eval("EVENT_CODE_ID") %>&wa=<%# Eval("WORK_AREA_ID") %>&yr=0' target="_blank"><asp:Label ID="lbl_WORK_AREA_ID" runat="server" Text='<%# Bind("WORK_AREA") %>'></asp:Label></a>
                                        </ItemTemplate>
                                         <HeaderStyle Width="81px" />
                                         <ItemStyle Width="80px" />
                                    </asp:TemplateField>
                                    <asp:TemplateField SortExpression="COMMENT_TYPE" HeaderStyle-Width="101px" ItemStyle-Width="100px">
                                        <HeaderTemplate>
                                            <asp:LinkButton ID="LinkButton3" runat="server" Text="NOTE TYPE" CommandName="Sort" CommandArgument="COMMENT_TYPE" ForeColor="Black" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_WORKCOMMENT_ID" runat="server" Visible="false" Text='<%# Bind("WORKCOMMENTID") %>'></asp:Label>
                                            <%# Eval("COMMENT_TYPE") %>
                                        </ItemTemplate>
                                        <HeaderStyle Width="101px" />
                                        <ItemStyle Width="100px" />
                                    </asp:TemplateField>

                                    <asp:TemplateField SortExpression="COMMENT_TEXT" HeaderStyle-Width="471px" ItemStyle-Width="470px">
                                        <HeaderTemplate>
                                            <asp:LinkButton ID="LinkButton4" runat="server" Text="NOTE TEXT" CommandName="Sort" CommandArgument="COMMENT_TEXT" ForeColor="Black" />
                                        </HeaderTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtCommentText" runat="server" Text='<%# Eval("COMMENT_TEXT") %>' TextMode="MultiLine" onkeypress="return this.value.length<=498"  Width="490px"></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                           <%# Eval("COMMENT_TEXT") %>
                                        </ItemTemplate>
                                        <HeaderStyle Width="501px" />
                                        <ItemStyle Width="500px" />
                                    </asp:TemplateField>
                                   <%-- <asp:TemplateField ShowHeader="False" HeaderText="Action">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="btEditGrid" ImageUrl="resource_gallery/graphics/Icon_Edit.png" CommandName="Edit" runat="server" />
                                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"  OnClientClick="javascript:return confirm('Are you sure to delete this comment?');" ><img src="resource_gallery/graphics/icon_delete.png" /></asp:LinkButton>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:ImageButton ID="btUpdateGrid" ImageUrl="resource_gallery/graphics/icon-save.png" CommandName="Update" runat="server" />
                                            <asp:ImageButton ID="btGuardarGrid" ImageUrl="resource_gallery/graphics/icon-cancel.png" CommandName="Cancel" runat="server" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>--%>
                                    <asp:CommandField HeaderText="Action" HeaderStyle-Width="51px" ButtonType="Image" ShowEditButton="true" ShowCancelButton="true" ShowDeleteButton="true"
                                        EditImageUrl="~/resource_gallery/graphics/Icon_Edit.png" EditText="Edit"
                                         UpdateImageUrl="~/resource_gallery/graphics/icon-save.png" UpdateText="Update"
                                         CancelImageUrl="~/resource_gallery/graphics/icon-cancel.png" CancelText="Cancel"
                                         DeleteImageUrl="~/resource_gallery/graphics/icon_delete.png" DeleteText="Delete"
                                    ItemStyle-Width="50" > 
                                     <HeaderStyle Width="51px" />
                                     <ItemStyle Width="50px" />
                                     </asp:CommandField>
                                </Columns>
                                <HeaderStyle BackColor="#98C8DE" Font-Bold="True" />
                                <SelectedRowStyle BackColor="#FFE98F" />
                            </asp:GridView>
                            <td></td>
                        </div>


                    </div>
                </fieldset>
            </div>

            <div style="text-align: left; width: 100%;">
                
                    <div style="width: 100%; height: 40px; ">
                        <table>
                            <tr>
                                <td>
                                    <asp:Button ID="btnExportExcel" runat="server" CssClass="FormButton" Visible="false" OnClick="btnExportExcel_Click" Text="Export To Excel" />
                                </td>
                            </tr>
                        </table>
                    </div>
                
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
