<%@ page language="C#" autoeventwireup="true" CodeFile="WorksListDetail.aspx.cs" inherits="Maintenance_TEC_WorksListDetail" title="Maintenance_TEC_WorksListDetail" theme="white" %>

<!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 id="Head1" runat="server">
    <script language="javascript" type="text/javascript" src="/SEST/Script/pupdate.js">
	    // calendar javascript file
	</script>

    <script language="javascript" type="text/javascript" src="/SEST/Script/OpenSubPage.js">
        // open sub page
    </script>
</head>
<body>
<center>
    <form id="form1" runat="server" defaultfocus="txtDate" defaultbutton="btnSearch">
    <asp:Label ID="lblWorkID" Visible="false" runat="server"></asp:Label>
    <table cellpadding="0" cellspacing="0" style="width:940px; background-color: #eeeeee; border: solid 3px #3399ff">
        <%-- 分格線 --%>
        <tr>
            <td class="titleRow" colspan="8">
                <asp:Label ID="lblTitle" Text="Work List Detail" runat="Server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="whiteEdge">
                <asp:Label ID="lblJobNo" runat="server" Text="<%$ Resources: Universal, WorksList_JobNo %>"></asp:Label></td>
            <td  class="whiteEdge" style="width:175px" align="left">
                <asp:TextBox ID="txtJobNo" Width="140px" runat="server"></asp:TextBox>
                <asp:HyperLink ImageUrl="~\imanges\more.gif" ID="hlJobNo" Target="_blank" runat="Server"></asp:HyperLink></td>
            <td  class="whiteEdge">
                <asp:Label ID="lblFABID" runat="server" Text="<%$ Resources: Universal, Comm_FABID %>"></asp:Label></td>
            <td  class="whiteEdge" align="left">
                <asp:TextBox ID="txtFABID" Width="140px" runat="server"></asp:TextBox>
                <asp:HyperLink ImageUrl="~\imanges\more.gif" ID="hlFABID" Target="_blank" runat="Server"></asp:HyperLink></td>
            <td  class="whiteEdge">
                <asp:Label ID="lblToolID" runat="server" Text="<%$ Resources: Universal, SES_ToolNo %>"></asp:Label></td>
            <td  class="whiteEdge" align="left">
                <asp:TextBox ID="txtSESToolNo" Width="140px" runat="server"></asp:TextBox>
                <asp:HyperLink ImageUrl="~\imanges\more.gif" ID="hlSES_ToolNo" Target="_blank" runat="Server"></asp:HyperLink></td>
            <td  class="whiteEdge">
                <asp:Label ID="lblStatus" runat="server" Text="<%$ Resources: Universal, Comm_Status %>"></asp:Label></td>
            <td  class="whiteEdge" align="left">
                <asp:DropDownList ID="ddlStatus" Width="140px" runat="server">
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td  class="whiteEdge">
                <asp:Label ID="lblCreateDate" runat="server" Text="<%$ Resources: Universal, Comm_CreateDate %>" Enabled="false"></asp:Label></td>
            <td  class="whiteEdge" align="left">
                <asp:TextBox ID="txtCreateDate" Width="140px" runat="server" Enabled="false"></asp:TextBox></td>
            <td  class="whiteEdge">
                <asp:Label ID="lblCreateFrom" runat="server" Text="<%$ Resources: Universal, WorksList_CreateFrom %>" Enabled="false"></asp:Label></td>
            <td  class="whiteEdge" align="left">
                <asp:TextBox ID="txtCreateFrom" Width="140px" runat="server" Enabled="false"></asp:TextBox></td>
            <td  class="whiteEdge">
                <asp:Label ID="lblProposer" runat="server" Text="<%$ Resources: Universal, Msg_Writer %>"></asp:Label></td>
            <td  class="whiteEdge" align="left">
                <asp:TextBox ID="txtProposer" Width="140px" runat="server"></asp:TextBox></td>
            <td  class="whiteEdge">
                <asp:Label ID="lblFinishDate" runat="server" Text="<%$ Resources: Universal, Comm_FinishDate %>"></asp:Label></td>
            <td  class="whiteEdge" align="left">
                <asp:TextBox ID="txtFinishDate" Width="140px" runat="server"></asp:TextBox>
                <asp:HyperLink ImageUrl="~\imanges\more.gif" ID="hlFinishDate" Target="_blank" runat="Server"></asp:HyperLink></td>
        </tr>
        <tr>
            <td  class="whiteEdge">
                <asp:Label ID="lblDescription" runat="server" Text="<%$ Resources: Universal, ProblemDescription %>"></asp:Label></td>
            <td  class="whiteEdge" colspan="3" align="left">
                <asp:TextBox ID="txtDescription" Width="380px" runat="server" Rows="5" TextMode="MultiLine" Font-Size="8pt"></asp:TextBox></td>
            <td  class="whiteEdge">
                <asp:Label ID="lblRootCause" runat="server" Text="<%$ Resources: Universal, WorksList_RootCause %>"></asp:Label></td>
            <td  class="whiteEdge" colspan="3" align="left">
                <asp:TextBox ID="txtRootCause" Width="380px" runat="server" Rows="5" TextMode="MultiLine" Font-Size="8pt"></asp:TextBox></td>
        </tr>
        <tr>
            <td  class="whiteEdge">
                <asp:Label ID="lblComment" runat="server" Text="<%$ Resources: Universal, Comm_Comment %>"></asp:Label></td>
            <td  class="whiteEdge" colspan="3" style="width: 380px;" align="left">
                <asp:TextBox ID="txtComment" runat="server" Width="380px" Rows="12" TextMode="MultiLine" Font-Size="8pt"></asp:TextBox></td>
            <td class="whiteEdge">
                <asp:Label ID="lblActionRecords" runat="server" Text="<%$ Resources: Universal, WorksList_Record %>" Enabled="false"></asp:Label></td>
            <td  class="whiteEdge" colspan="3" style="width: 380px" align="left">
                <asp:TextBox ID="txtActionRecords" runat="server" Rows="12" TextMode="MultiLine" Width="380px" Font-Size="8pt"></asp:TextBox>
                <asp:Panel ID="pnlRecordFiles" Wrap="false" runat="server" Height="18px" Width="380px" Visible="False" /></td>
        </tr>
        <tr>
            <td  class="whiteEdge" colspan="2" style="height: 24px">
                <asp:Label ID="lblDeliveryReportDate" runat="server" Text="<%$ Resources: Universal, WorksList_DeliveryReportDate %>"></asp:Label></td>
            <td  class="whiteEdge" colspan="2" style=" height: 24px" align="left">
                <asp:TextBox ID="txtDeliveryReportDate" runat="server" Width="180px"></asp:TextBox>
                <asp:HyperLink ImageUrl="~\imanges\more.gif" ID="hlDeliveryReportDate" Target="_blank" runat="Server"></asp:HyperLink></td>
            <td  class="whiteEdge" colspan="2" style="height: 24px">
                <asp:Label ID="lblTroubleNo" runat="server" Text="<%$ Resources: Universal, WorksList_TroubleNo %>"></asp:Label></td>
            <td  class="whiteEdge" colspan="2" style="height: 24px" align="left">
                <asp:TextBox ID="txtTroubleNo" runat="server" Width="213px"></asp:TextBox></td>
        </tr>
         <%-- 命令按鈕列 --%>
        <tr>
            <td colspan="8" style="height: 22px" class="bottomRow" align="center">
                <asp:Button ID="btnInsert" Visible="false" runat="server" Text="<%$ Resources: Universal, Data_Save %>" OnClick="btnInsert_Click"/>
                <asp:Button ID="btnUpdate" runat="server" Text="<%$ Resources: Universal, Data_Update %>" OnClick="btnUpdate_Click"/>
                <asp:Button ID="btnFinish" runat="server" Text="<%$ Resources: Universal, WorksList_Finish %>" Visible="false" OnClick="btnFinish_Click"/>
                <asp:Button ID="btnBack" runat="server" Text="<%$ Resources: Universal, Msg_Back %>" Visible="true" OnClientClick="javascript: document.location='WorksList.aspx'; return false;"/>
                <asp:Button ID="btnDelete" runat="server" Text="<%$ Resources: Universal, Data_Delete %>" OnClick="btnDelete_Click" OnClientClick="javascript: return confirm('Are you sure ?');"/></td>
        </tr>
    </table>
    &nbsp;
    <table id="tblAdditional" runat="server" cellpadding="0" cellspacing="0" style="width:940px; background-color: #eeeeee; border: solid 3px #3399ff">
        <%-- Attach Files Title --%>
        <tr>
            <td class="SeperateRow" colspan="8">
                <asp:Label ID="Label3" Text="Attach Files" runat="Server"></asp:Label>
            </td>
        </tr>
        <%-- Attach Files Selection area --%>
        <tr>
            <td id="tdAddAttachFilesForm" runat="Server" colspan="8" class="whiteEdge" style="height:auto; width: auto; border-right-color: White; background-color: #ddffff; ">
                <table cellpadding="0" cellspacing="0" style="height:auto; width: auto; ">
                    <tr>
                        <td style="height: 24px">
                            <asp:Label ID="lblAttachFiles" runat="server" Text="<%$ Resources: Universal, Msg_AttachFile %>"></asp:Label></td>
                        <td id="tdMyFiles" style="width: 380px; height: 24px" align="left">
                            <asp:FileUpload ID="FileSaveToServer" runat="server" Width="380px" /></td>
                        <td colspan="1" align="left" style="height:auto; width: auto; background-color: #ddffff; ">
                            <asp:Button ID="tdAddAttachFilesButton" Text="<%$ Resources: Universal, Data_AddNew %>" runat="server" OnClick="btnAddAttachFile_Click" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <%-- Files List --%>
        <tr>
            <td colspan="8" style="height:auto; width: auto; background-color: #ddffff; vertical-align:top; ">
               <asp:GridView ID="gvAttachFile" AutoGenerateColumns="False" DataSourceID="ObjectDataSource2" DataKeyNames="FilesStorageID" 
                    EmptyDataText="No any attached file for this job" EmptyDataRowStyle-ForeColor="red"
                   runat="server" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" OnRowDataBound="gvAttachFile_RowDataBound" OnRowDeleting="gvAttachFile_RowDeleting" >
                   <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                   <RowStyle BackColor="White" ForeColor="#330099" Font-Size="Small" />
                   <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                   <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                   <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" Font-Size="Small" />
                   <Columns>
                        <asp:CommandField ShowDeleteButton="True" DeleteText="<%$ Resources: Universal, Data_Delete %>" />
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:Label ID="lblFilesStorageID" Text='<%# Bind("FilesStorageID") %>' runat="Server" Visible="False"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$ Resources: Universal, Comm_CreateDate %>">
                            <ItemTemplate>
                                <asp:Label ID="lblCreateDate" Text='<%# Bind("CreateDate") %>' runat="Server"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="<%$ Resources: Universal, Msg_AttachFile %>">
                            <ItemTemplate>
                                <asp:Label ID="lblFileName" Text='<%# Bind("FileName") %>' runat="Server"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:HyperLink ID="hyLink" Text="Link" NavigateUrl='<%# Bind("PhysicalPath") %>' runat="Server"></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                   </Columns>
               </asp:GridView>
            </td>
        </tr>
        <%-- Scheduling Title --%>
        <tr>
            <td class="SeperateRow" colspan="8">
                <asp:Label ID="lblSchedule" Text="Scheduling" runat="Server"></asp:Label>
            </td>
        </tr>
        <%-- Scheduling monty and command area --%>
        <tr>
            <td class="whiteEdge" align="left" colspan="7" style="height:auto; width: auto; border-right-color: White; background-color: #ffddff; ">
                <asp:Panel ID="pnlHistoryData" runat="server"></asp:Panel>
            </td>
            <td id="td1" runat="Server" colspan="1" class="whiteEdge" style="height:auto; width: auto; border-right-color: White; background-color: #ffddff; ">
                <asp:Label ID="lblDate" runat="server" Text="<%$ Resources: Universal, Comm_Date %>"></asp:Label>
                <asp:TextBox ID="txtDate" runat="server" Width="60px"></asp:TextBox>
                <asp:Button ID="btnSearch" runat="server" Text="<%$ Resources: Universal, Data_Search %>" OnClick="btnSearch_Click"/>
                <asp:Button ID="btnUpdateSchedule" runat="server" Text="<%$ Resources: Universal, Data_Update %>" OnClick="btnUpdateSchedule_Click" /></td>
        </tr>
        <tr>
            <td id="td2" runat="Server" colspan="8" class="whiteEdge" style="height:auto; width: auto; border-right-color: White; background-color: #ffddff; ">
                <asp:Table ID="tblContents" runat="Server" CellPadding="1" CellSpacing="1" ></asp:Table>
            </td>
        </tr>
    </table>
    </form>
    
         <%-- Schedules --%>
        <asp:ObjectDataSource ID="obScheduleing" runat="server" TypeName="TEC_MainWorkSchedulesData"
        SelectMethod="SelectByWorkID" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
        UpdateMethod="Update" DeleteMethod="Delete" >
        <InsertParameters>
            <asp:Parameter Name="WorkID" Type="String" />
            <asp:Parameter Name="ExpectStartDate" Type="String" />
            <asp:Parameter Name="ExpectEndDate" Type="String" />
            <asp:Parameter Name="Responsibility" Type="String" />
            <asp:Parameter Name="GroupName" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="ExpectStartDate" Type="String" />
            <asp:Parameter Name="ExpectEndDate" Type="String" />
            <asp:Parameter Name="Responsibility" Type="String" />
            <asp:Parameter Name="GroupName" Type="String" />
            <asp:Parameter Name="original_ScheduleID" Type="String" />
        </UpdateParameters>
        <DeleteParameters>
            <asp:Parameter Name="original_ScheduleID" Type="String" />
        </DeleteParameters>
        <SelectParameters>
            <asp:QueryStringParameter Name="WorkID" QueryStringField="WorkID" DefaultValue="0" Type="String" />
        </SelectParameters>
        </asp:ObjectDataSource>



         <%-- Files --%>
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" TypeName="Common_FilesStorageData"
        SelectMethod="Select" OldValuesParameterFormatString="original_{0}" DeleteMethod="Delete" >

        <DeleteParameters>
            <asp:Parameter Name="original_FilesStorageID" Type="String" />
        </DeleteParameters>
        <SelectParameters>
            <asp:Parameter Name="PageName" DefaultValue="MainWorks" Type="String" />
            <asp:QueryStringParameter Name="PageKeys" QueryStringField="WorkID" DefaultValue="NoWorkID" Type="String" />
        </SelectParameters>
        </asp:ObjectDataSource>
</center>

</body>
</html>
