<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="Services.aspx.cs" Inherits="TruxWebPortal.Services" %>
<%@ Register TagPrefix="ucHeader" TagName="truxHeader" Src="header.ascx" %>
<%@ Register TagPrefix="ucFooter" TagName="truxFooter" Src="footer.ascx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="HeadServices" runat="server">
    <title>My Services</title>
    <link rel="stylesheet" type="text/css" href="_style/stylesheet.css" title="TRUX7" />
    <script src="Services.js" type="text/javascript"></script>
</head>
<body>
    <ucHeader:truxHeader ID="Hdr1" runat="server"></ucHeader:truxHeader>
    <div id="main_area">
        <div id="work_area">
            <form id="form1" runat="server" >
                <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
                <h1>My Services</h1>
                


                
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <p class="description" style="margin-bottom: 20px">
                            <span id="Span19">
                                <asp:Label ID="lblDesc" runat="server"></asp:Label><a href="_help/my_services.aspx" target="_blank"><asp:image runat="server" style="width: 18px; vertical-align: middle; margin-left: 5px;" ImageUrl="~/_images/help.png" /></a>
                            </span>
                        </p>
                        <p class="frm_error_lbl">
                            <asp:Label CssClass="label" ID="lblAddressMessage" runat="server" ForeColor="Red"></asp:Label>
                        </p>
                        <div style="overflow: auto;width: 100%">
                        <asp:Button Visible='<%# _onlineBinEnabled %>' ID="btnOrderTempService" CssClass="gridButton" style="float: right" runat="server" Text="Order Temp Service For New Location" OnClick="btnOrderTempService_Click" />
                        </div>
                        <div class="toolbar_icons">
                            <a href="#" onclick="ShowAllPanel()">
                                <asp:image  runat="server" ImageUrl="~/_images/expand_all_icon.png" alt="pExpand All" /></a> <a href="#" onclick="HideAllPanel()">
                                <asp:image  runat="server" ImageUrl="~/_images/collapse_all_icon.png" alt="Collapse All" /></a>
                        </div>

                        <asp:CheckBox ID="chkShowClosed" runat="server" AutoPostBack="true" OnCheckedChanged="chkShowClosed_CheckedChanged" />
                        <p style="display: inline">Show Closed Locations</p>
                        
                        <asp:GridView ID="gvSiteList"  runat="server" AllowPaging="True"
                            AutoGenerateColumns="False" GridLines="None"
                            OnPageIndexChanging="gvSiteList_PageIndexChanging"
                            OnRowDataBound="gvSiteList_RowDataBound" Width="100%" ShowHeader="False" OnRowCommand="gvSiteList_RowCommand" >
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <Columns>
           
                                <asp:TemplateField>
                                    <ItemTemplate>
                           
                                    <div id="SiteHeader" runat="server" style=" display: flex;  align-items:center">
                                        
                                        <asp:Label style="padding: 5px" ID="lblSiteInfo" runat="server" Text='<%# Eval("SiteInfo") %>'></asp:Label>
                                        
                                        <asp:LinkButton Visible='<%# _onlineBinEnabled %>' ID="btnOrder" OnClientClick="event.stopPropagation();" CommandName="BinOrder" CommandArgument='<%#Eval("CM04_SITE") %>' style="margin-left: auto; padding: 5px; text-decoration: underline; color: white" runat="server"  Text="Order Temp Service For This Location" ></asp:LinkButton>
                                        
                                    </div>
                             
                                        <asp:GridView ID="gvServiceList" runat="server" CssClass="mGrid" GridLines="None" AutoGenerateColumns="False" >
                                        
                                            <AlternatingRowStyle CssClass="alt_row" />
                                            <Columns>
                                                <asp:BoundField DataField="Service" HeaderText="Service" />
                                                <asp:BoundField DataField="Description" HeaderText="Description" />
                                                <asp:BoundField DataField="Size" HeaderText="Size" />
                                                <asp:BoundField DataField="Qty" HeaderText="Qty" />
                                                <asp:BoundField DataField="Schedule" HeaderText="Schedule" />
                                                <asp:BoundField DataField="Next Pickup Date" HeaderText="Next Pickup Date" />
                                                <asp:BoundField DataField="Last Activity Date" HeaderText="Last Activity Date" />
                                                <asp:BoundField DataField="Frequency" HeaderText="Frequency" />
                                                <asp:BoundField DataField="End Date" HeaderText="End Date" DataFormatString="{0:d}" HtmlEncode="False" />
                                                <asp:TemplateField ShowHeader="False">
                                                    <ItemTemplate>
                                                        <asp:Button ID="Button1" runat="server" Visible='<%# (int)Eval("activityCount") > 0 && !(bool)Eval("COD") %>' PostBackUrl='<%# string.Format("CreateWorkOrder.aspx?site={0}&service={1}",Eval("site"),Eval("service"))  %>' CausesValidation="false" CommandName="" Text="Extra Pickup" ClientIDMode="Static" />
                                                    </ItemTemplate>
                                                    <ControlStyle CssClass="gridButton" />
                                                </asp:TemplateField>
                                            </Columns>
                                            <HeaderStyle CssClass="col_headers" HorizontalAlign="Left" />
                                            <RowStyle CssClass="row" />
                                        
                                        </asp:GridView>
                        
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <RowStyle CssClass="mGrid_titlebar" />
                        </asp:GridView>
                        
                      
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="chkShowClosed" />
                        <asp:PostBackTrigger ControlID="gvSiteList" />
                        <asp:PostBackTrigger ControlID="btnOrderTempService" />
                    </Triggers>
                </asp:UpdatePanel>
            </form>
        </div>
    </div>

    <ucFooter:truxFooter ID="Ftr1" runat="server"></ucFooter:truxFooter>
</body>
</html>

