<%@ page language="C#" autoeventwireup="true" ResponseEncoding="UTF-8" EnableEventValidation = "false" CodeFile="WorksList.aspx.cs" inherits="Maintenance_TEC_WorksList" title="Maintenance_TEC_WorksList" theme="white" %>

<%--<%@ Register Assembly="PNayak.Web.UI.WebControls.ExportButton" Namespace="PNayak.Web.UI.WebControls"
    TagPrefix="pnwc" %>--%>
  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="Server">
    <title runat="server">>Maintenance_TEC_WorksList</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <script type="text/javascript" language="jscript">       
        //location.replace('http://172.16.25.138/sest/')">
        function ZoomIn(){
//            alert (window.document.getElementById('GridView1').style.fontSize.substring(0,window.document.getElementById('GridView1').style.fontSize.length - 2));
            var fontsize = window.document.getElementById('GridView1').style.fontSize.substring(0,window.document.getElementById('GridView1').style.fontSize.length - 2);
            fontsize = Number(fontsize) + 1;
//            alert(fontsize);
            window.document.getElementById('GridView1').style.fontSize =  fontsize + "pt"; 
            document.getElementById('btnZoomOut').disabled = false;
            if ( fontsize >= 20)
                document.getElementById('btnZoomIn').disabled = true;
        }
        function ZoomOut(){
            var fontsize = window.document.getElementById('GridView1').style.fontSize.substring(0,window.document.getElementById('GridView1').style.fontSize.length - 2);
            fontsize = Number(fontsize) - 1;
//            alert(fontsize);
            window.document.getElementById('GridView1').style.fontSize =  fontsize + "pt"; 
            document.getElementById('btnZoomIn').disabled = false;
            if ( fontsize <= 6)
                document.getElementById('btnZoomOut').disabled = true;
        }
        function openDetailPage(WorkID){
            var lUrl = 'WorksListDetail.aspx?WorkID=' + WorkID;
            window.open(lUrl,'WorkDetails','');
        }
    </script>
</head>

<body class="blankPageCenter" >
<center>
<form id="form1" runat="server">
<table style="height: 50px;" cellspacing="0px" class="SelectCondition">
    <tr>
        <td><asp:Label ID="Label1" Text="<%$Resources:Universal, WorksList_JobNo %>" runat="server"></asp:Label> : </td><td><asp:TextBox ID="txtJobNo" runat="Server" Width="80px"></asp:TextBox></td>
<%--        <td><asp:Label ID="Label2" Text="<%$Resources:Universal, Msg_Writer %>" runat="server"></asp:Label>  : </td><td><asp:TextBox ID="txtSelConditionProposer" runat="Server"></asp:TextBox></td>
--%>        
        <td><asp:Label ID="Label3" Text="<%$Resources:Universal, Comm_FABID %>" runat="server"></asp:Label> : </td><td><asp:TextBox ID="txtFABID" runat="Server" Width="80px"></asp:TextBox></td>
        <td><asp:Label ID="Label4" Text="<%$Resources:Universal, SES_ToolNo %>" runat="server"></asp:Label> : </td><td><asp:TextBox ID="txtTOOLID" runat="Server" Width="80px"></asp:TextBox></td>
        <td><asp:Label ID="Label5" Text="<%$Resources:Universal, WorksList_GroupID %>" runat="server"></asp:Label> : </td><td><asp:DropDownList ID="ddlDept" DataSourceID="ObjectDataSource3" runat="server" Width="80px"></asp:DropDownList></td>
        <td><asp:Label ID="Label6" Text="<%$Resources:Universal, WorksList_Responsibility %>" runat="server"></asp:Label> : </td><td><asp:TextBox ID="txtResponsibility" runat="Server" Width="80px"></asp:TextBox></td>
    </tr>
    <tr>
        <td><asp:Label ID="Label2" Text="<%$Resources:Universal, Comm_Status %>" runat="server"></asp:Label> : </td>
        <td><asp:DropDownList ID="ddlStatus" runat="server" Width="85px">
        </asp:DropDownList></td>
        <td><asp:Label ID="Label12" Text="<%$Resources:Universal, WorksList_TroubleNo %>" runat="server"></asp:Label> : </td><td><asp:TextBox ID="txtTroubleNo" runat="Server"  Width="80px"></asp:TextBox></td>
    </tr><tr>
        <td align="right" colspan="5" style="background-color: #ffdddd">
            <asp:CheckBox ID="chkExpectDate" Text="<%$ Resources:Universal,WorksList_Schedule %>" runat="Server" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:CheckBox ID="chkCreateDate" Text="<%$ Resources:Universal,Comm_CreateDate %>" runat="Server" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:CheckBox ID="chkFinishedDate" Text="<%$ Resources:Universal, WorksList_FinishedDate %>" runat="Server" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:CheckBox ID="chkDeliveryReportDate" Text="<%$ Resources:Universal, WorksList_DeliveryReportDate %>" runat="Server" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<=>
        </td>
        <td style="background-color: #ffdddd"><asp:Label ID="Label8" Text="<%$Resources:Universal, Comm_StartDate %>" runat="server"></asp:Label> : </td><td style="background-color: #ffdddd"><asp:TextBox ID="txtStartDate" runat="Server" Width="80px" ></asp:TextBox></td>
        <td style="background-color: #ffdddd"><asp:Label ID="Label9" Text="<%$Resources:Universal, Comm_EndDate %>" runat="server"></asp:Label> : </td><td style="background-color: #ffdddd"><asp:TextBox ID="txtEndDate" runat="Server" Width="80px"></asp:TextBox></td>
        <td style="background-color: #ffdddd" ></td>
        <td style="background-color: #ffdddd" ></td>
    </tr>
    <tr>
        <td colspan="8" align="center" class="bottomRow2">
            <asp:Label ID="btnPrompt" Text="<%$Resources:Universal, WorksList_MaxRowPrompt %>" runat="Server" Font-Size="Medium" Font-Bold="true" ForeColor="blue"></asp:Label>
        </td>
        <td colspan="1" align="right" class="bottomRow2">
            <asp:Button ID="btnToSelect" Text="<%$Resources:Universal, Data_Search %>" runat="Server" OnClick="btnToSelect_Click" />
        </td>
        <td colspan="1" align="right" class="bottomRow2">
            <asp:Label ID="lblZoomInOut" Text="<%$Resources:Universal, Comm_Zoom %>" runat="server"></asp:Label> : 
            <input id="btnZoomIn" type="button" value="+" onclick="ZoomIn()" style="width: 20px"/>
            <input id="btnZoomOut" type="button" value="-" onclick="ZoomOut()" style="width: 20px" />
        </td>
    </tr>
</table>
<hr style="width: 100%; line-height: 10px;" />
    <div>
        <asp:HyperLink ID="hlAddNew" runat="server" NavigateUrl="WorksListDetail.aspx" Text="<%$ Resources: Universal, Data_AddNew %>"></asp:HyperLink>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:LinkButton ID="lbToExcel" Text="Export to Excel" runat="server" OnClick="lbToExcel_OnClick"></asp:LinkButton>
        <asp:Button ID="btnToExcel" Text="To Excel" runat="server" OnClick="btnToExcel_OnClick" Visible="false" />
<%--        <pnwc:ExportLinkButton ID="ExportLinkButton1" Text="Export" runat="server"></pnwc:ExportLinkButton><br />
--%>        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="Both" 
        OnRowDataBound="GridView1_RowDataBound" OnDataBound="GridView1_DataBound" Font-Size = "10pt" AllowSorting="true" AllowPaging="true" PageSize="15"
        OnPageIndexChanging="gridView_PageIndexChanging" OnSorting="gridView_Sorting" emptydatatext="No data available." EmptyDataRowStyle-ForeColor="red" >
            <Columns>
                <asp:TemplateField HeaderText="<%$ resources:Universal, Data_Detail %>">
                    <ItemTemplate>
                        <asp:HyperLink ID="hlSubForm" Target="_self" NavigateUrl='<%# "WorksListDetail.aspx?WorkID=" + Eval("WorkID")%>' Text="<%$ resources:Universal,Data_Detail %>" runat="server"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ resources:Universal,WorksList_JobNo %>" SortExpression="JobNo" >
                    <ItemTemplate>
                        <asp:Label ID="lblJobNo" runat="server" Text='<%# Eval("JobNo") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="hidWorkID" runat="server" Text='<%# Bind("WorkID") %>' Visible="False"></asp:TextBox>
                        <asp:TextBox ID="hidCompleteDate" runat="server" Text='<%# Bind("CompleteDate") %>' Visible="False"></asp:TextBox>
                        <asp:TextBox ID="txtJobNo" runat="server" Text='<%# Bind("JobNo") %>' Width="30px"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
<%--                <asp:TemplateField HeaderText="<%$ resources:Universal,Comm_CreateDate %>">
                    <ItemTemplate>
                        <asp:Label ID="lblCreateDate" runat="server" Text='<%# Eval("CreateDate") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtCreateDate" runat="server" Text='<%# Bind("CreateDate") %>' Width="80px"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
--%>                <asp:TemplateField HeaderText="<%$ resources:Universal,Comm_FABID %>" SortExpression="FABID">
                    <ItemTemplate>
                        <asp:Label ID="lblFABID" runat="server" Text='<%# Eval("FABID") %>' Width="60px"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtFABID" runat="server" Text='<%# Bind("FABID") %>' Width="60px"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ resources:Universal,SES_ToolNo %>" SortExpression="SES_ToolNo">
                    <ItemTemplate>
                        <asp:Label ID="lblEQID" runat="server" Text='<%# Eval("SES_ToolNo") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtEQID" runat="server" Text='<%# Bind("SES_ToolNo") %>' Width="100px"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ resources:Universal,ProblemDescription %>">
                    <ItemTemplate>
                        <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("Description") %>' Width="250px"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDescription" runat="server" Text='<%# Bind("Description") %>' Rows="5" TextMode="MultiLine"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
<%--                <asp:TemplateField HeaderText="<%$ resources:Universal,WorksList_RootCause %>">
                    <ItemTemplate>
                        <asp:Label ID="lblRootCause" runat="server" Text='<%# Eval("RootCause") %>' Width="200px"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtRootCause" runat="server" Text='<%# Bind("RootCause") %>' Rows="5" TextMode="MultiLine"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
--%>                <asp:TemplateField HeaderText="<%$ resources:Universal,WorksList_LastDate %>">
                    <ItemTemplate>
                        <asp:Label ID="lblLastSchedule" runat="server" Text='<%# Eval("ExpectStartDate") %>' Width="80px"></asp:Label>
                        <asp:Label ID="lblFinishDate" runat="server" Text='<%# Eval("FinishDate") %>' Width="80px" Visible="false"></asp:Label>
                        <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("Status") %>' Visible="False"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtLastSchedule" runat="server" Text='<%# Bind("ExpectStartDate") %>' Rows="5" TextMode="MultiLine"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ resources:Universal,WorksList_DeliveryReportDate %>">
                    <ItemTemplate>
                        <asp:Label ID="lblDeliveryReportDate" runat="server" Text='<%# Eval("DeliveryReportDate") %>' Width="80px"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDeliveryReportDate" runat="server" Text='<%# Bind("DeliveryReportDate") %>' Rows="5" TextMode="MultiLine"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
<%--                <asp:TemplateField HeaderText="<%$ resources:Universal,WorksList_GroupID %>">
                    <ItemTemplate>
                        <asp:Label ID="lblGroupID" runat="server" Text='<%# Eval("GroupID") %>' Width="50px"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtGroupID" runat="server" Text='<%# Bind("GroupID") %>' Width="30px"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
--%>                <asp:TemplateField HeaderText="<%$ resources:Universal,WorksList_Responsibility %>">
                    <ItemTemplate>
                        <asp:Label ID="lblResponsibility" runat="server" Text='<%# Eval("Responsibility") %>' Width="70px"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtResponsibility" runat="server" Text='<%# Bind("Responsibility") %>' Rows="5" TextMode="MultiLine" Width="80px"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="<%$ resources:Universal,WorksList_Record %>">
                    <ItemTemplate>
                        <asp:Label ID="lblLastAction" runat="server" Text='<%# Eval("LastAction") %>' Width="250px"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtLastAction" runat="server" Text='<%# Bind("LastAction") %>' Rows="5" TextMode="MultiLine"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#E3EAEB" Width="100px" />
            <EditRowStyle BackColor="#7C6F57" Width="100px"/>
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" Width="100px" />
            <HeaderStyle Font-Size="Small" BackColor="#1C5E55" Font-Bold="True" ForeColor="White" Width="100px" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
    
    </div>
    </form>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="TEC_MainWorksData"
        SelectMethod="Select" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
        UpdateMethod="Update" DeleteMethod="Delete">
        <InsertParameters>
            <asp:Parameter Name="JobNo" Type="String" />
<%--            <asp:Parameter Name="CreateDate" Type="String" />
--%>            <asp:Parameter Name="FABID" Type="String" />
            <asp:Parameter Name="SES_ToolNo" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="GroupID" Type="String" />
            <asp:Parameter Name="Responsibility" Type="String" />
            <asp:Parameter Name="RootCause" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="WorkID" Type="String" />
            <asp:Parameter Name="JobNo" Type="String" />
            <asp:Parameter Name="CreateDate" Type="String" />
            <asp:Parameter Name="CompleteDate" Type="String" />
            <asp:Parameter Name="FABID" Type="String" />
            <asp:Parameter Name="SES_ToolNo" Type="String" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="GroupID" Type="String" />
            <asp:Parameter Name="Responsibility" Type="String" />
            <asp:Parameter Name="LastAction" Type="String" />
            <asp:Parameter Name="LastActionDate" Type="String" />
            <asp:Parameter Name="RootCause" Type="String" />
            <asp:Parameter Name="original_WorkID" Type="String" />
        </UpdateParameters>
        <DeleteParameters>
            <asp:Parameter Name="original_WorkID" Type="String" />
        </DeleteParameters>
        <SelectParameters>
            <asp:Parameter Name="Condition" DefaultValue="Status='Processing'" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    
    
    
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" TypeName="TEC_WorkStatusNameData" SelectMethod="SelectCNameAddEmptyItem" >
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" TypeName="HR_OrganizationData" SelectMethod="SelectOrganizationName" >
    </asp:ObjectDataSource>
</center>
</body>
</html>
