<%@ Page Language="C#" MasterPageFile="~/masterpages/eReport.master" ValidateRequest = "false"  AutoEventWireup="True" Inherits="site_Reports_BundleDetails" Title="Bundle Job Details" Theme="eMain" Codebehind="BundleDetails.aspx.cs" %>
<asp:Content ID="Content1" ContentPlaceHolderID="eContent" Runat="Server">
<h1><asp:Localize ID = "Localize1" runat = "server" Text = "Bundle Job Details"></asp:Localize></h1>
    <asp:Label ID = "lblCompletedAndApproved" runat = "server" Visible = "false" ForeColor = "Green" Text = "Completed and Approved" Font-Size="1.1em" Font-Bold="true" />
    <asp:GridView ID = "grdBundleJobDetails" runat = "server" Width = "100%" AutoGenerateColumns = "false" OnRowDataBound = "grdBundleJobDetails_RowDataBound" OnRowEditing = "grdBundleJobDetails_RowEditing" OnRowCancelingEdit = "grdBundleJobDetails_RowCancellingEditing" OnRowUpdating = "grdBundleJobDetails_RowUpdating">
        <Columns>
            <asp:BoundField DataField = "BundleGateDescription" HeaderText = "Gates" ReadOnly = "true" />
            <asp:TemplateField HeaderText = "Status">
                <ItemTemplate>
                    <asp:Label ID = "Label1" runat = "server" Text = "<%# ((HITSWebService.ReportBundleJobWorkflowItem)Container.DataItem).StatusDescription %>" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:DropDownList ID = "ddlStatus" runat = "server" />
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField = "ReviewerName" HeaderText = "Reviewer" ReadOnly = "true" NullDisplayText = "Not Reviewed" />
            <asp:BoundField DataField = "ReviewedOn" HeaderText = "Reviewed On" ReadOnly = "true" NullDisplayText = "Not Reviewed" />
            
            <asp:TemplateField HeaderText = "Notes" ItemStyle-Width = "250px">
                <ItemTemplate>
                    <asp:Label ID = "lblNotes" runat = "server" Text = "<%# ((HITSWebService.ReportBundleJobWorkflowItem)Container.DataItem).Notes %>" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID = "txtNotes" runat = "server" TextMode = "MultiLine" Width = "250px" Height = "50px" />
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText = "Revised Bundle" ItemStyle-HorizontalAlign = "Center" ItemStyle-Width = "125px">
                <ItemTemplate>
                    <asp:ImageButton ID="ibtnDownloadRevisedBundle" runat="server" OnClick="ibtnDownloadRevisedBundle_Click"  CommandArgument='<%# ((HITSWebService.ReportBundleJobWorkflowItem)Container.DataItem).RevisedFullBundleFileName %>'
                    ToolTip="Download Revised Bundle File" ImageUrl="../../images/document_plain.png" Visible='<%# !string.IsNullOrEmpty(((HITSWebService.ReportBundleJobWorkflowItem)Container.DataItem).RevisedFullBundleFileName) %>'
                    CausesValidation="false" />
                    <asp:Label ID="lblBundleFileSize" runat="server" Text='<%# string.Format("{0:#,0 (bytes);;}",((HITSWebService.ReportBundleJobWorkflowItem)Container.DataItem).RevisedBundleFileSize) %>' />
                    <asp:HiddenField ID = "hdnDataItem" runat = "server" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:FileUpload ID = "fuRevisedBundle" ToolTip="<%$ Resources : Default,FileUploadBrowse %>" runat = "server" />
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID = "lbEdit" runat = "server" Text = "Edit" CommandName = "Edit" />
                    <asp:LinkButton ID = "lbRevert" runat = "server" Text = "Revert" OnClientClick = "return window.confirm('Are you sure you want to revert to this bundle gate?')" CommandName = "Revert" OnClick = "lbRevert_Click"/>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:LinkButton ID = "lbUpdate" runat = "server" Text = "Update" CommandName = "Update" />
                    <asp:LinkButton ID = "lbCancel" runat = "server" Text = "Cancel" CommandName = "Cancel" />
                    <asp:HiddenField ID = "hdnDataItem" runat = "server" />
                </EditItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
  
</asp:Content>

