<%@ page language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" inherits="RCC_Billing_EstimatedUsage, MachSol.MachPanel.Web" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" TagPrefix="EM" %>
<%@ Register Assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="System.Web.UI" TagPrefix="cc1" %>

<asp:Content ID="Content5" ContentPlaceHolderID="CPH_Content" runat="Server">

    <div class="col-xs-12">
        <div class="card">
            <div class="body">
                <EM:TabContainer ID="TbCntr_O365EstimatedUsage" runat="server" OnClientActiveTabChanged="loadTabPanel">

                    <EM:TabPanel ID="Tab_Report" runat="server" HeaderText="<%$ Resources:Content,StrEstimatedUsageReport%>">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab0" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent0" runat="server">

                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="card">
                                            <div class="header">
                                                <h3>
                                                    <%= Resources.Content.GN00001320%>                                                                                                                                 
                                                </h3>
                                            </div>
                                            <div class="body">
                                                <div class="clearfix">
                                                    <asp:Button ID="Btn_ExportReportToExcel" class="btn btn-primary waves-effect" runat="server"
                                                        Text='<%$ Resources:Content,Ex001 %>' />

                                                    <asp:Button ID="Btn_ExportReportToPDF" class="btn btn-primary waves-effect" runat="server"
                                                        Text='<%$ Resources:Content,strExportToPDF %>' />
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <asp:Panel ID="Pnl_Filter" runat="server" DefaultButton="Btn_Filter">

                                    <div class="row">
                                        <div class="panel-group search-panel" id="AS_SearchFilter" role="tablist" aria-multiselectable="true">
                                            <div class="col-xs-12" role="tab" id="SH_SearchFilter">
                                                <div class="card">
                                                    <div class="header" role="button" data-toggle="collapse" data-parent="#AS_SearchFilter" href="#<%= CSB_SearchFilter.ClientID%>" aria-expanded="true" aria-controls="SH_SearchFilter">
                                                        <h3>
                                                            <%= Resources.Content.GN0000395%>
                                                        </h3>
                                                    </div>
                                                    <div id="CSB_SearchFilter" runat="server" class="body panel-collapse collapse" role="tabpanel" aria-labelledby="SH_SearchFilter" aria-expanded="false">

                                                        <div class="row">
                                                            <div class="col-md-3 col-sm-6 col-xs-12" id="td_DDL_Owner" runat="server">
                                                                <div class="form-group form-float">
                                                                    <asp:DropDownList ID="DDL_Owner" runat="server" onchange="setOwnerCookie(this)"></asp:DropDownList>
                                                                </div>
                                                            </div>
                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <asp:DropDownList ID="DDL_ProductTypes" runat="server">
                                                                        <asp:ListItem Text="<%$ Resources:Content, USM0128 %>" Value="0" Selected="True"></asp:ListItem>
                                                                        <%--GN000135--%>
                                                                    </asp:DropDownList>
                                                                </div>
                                                            </div>
                                                            <div class="col-md-3 col-sm-6 col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_SubscriptionName" MaxLength="200" runat="server"></asp:TextBox>
                                                                        <asp:Label ID="Ltrl_SubscriptionName" runat="server" class="form-label" Text='<%$ Resources:Content,DGN1110287 %>'></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12" id="td_customername" runat="server">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_CustomerName" MaxLength="255" runat="server"></asp:TextBox>
                                                                        <asp:Label ID="Ltrl_CustomerName" runat="server" class="form-label" Text="<%$ Resources:Content,GN0000268%>"></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-md-3 col-sm-6 col-xs-12" id="td_companyname" runat="server">
                                                                <div class="form-group form-float">
                                                                    <div class="form-line">
                                                                        <asp:TextBox ID="TxBx_CustCompanyName" MaxLength="255" runat="server"></asp:TextBox>
                                                                        <asp:Label ID="Ltrl_CompanyName" runat="server" class="form-label" Text='<%$ Resources:Content,GN00001077%>'></asp:Label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="col-xs-12">
                                                                <div class="form-group form-float">
                                                                    <asp:Button ID="Btn_Filter" class="btn btn-primary waves-effect" runat="server" Text='<%$ Resources:Content,GN0000395 %>' />
                                                                    <asp:Button ID="Btn_Clear" Visible="false" class="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,String289 %>" />
                                                                </div>
                                                            </div>

                                                        </div>

                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </asp:Panel>



                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="double-scroll-wrapper1">
                                            <div>
                                            </div>
                                        </div>
                                        <div class="double-scroll-wrapper2">
                                            <asp:GridView ID="GV_Report" Style="width: 1800px" CssClass="table table-bordered table-striped table-hover table-layout-fixed" AllowSorting="true"
                                                AllowPaging="true" EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server"
                                                AutoGenerateColumns="False">

                                                <Columns>
                                                    <asp:TemplateField SortExpression="Customer" HeaderText='<%$ Resources:Content,GN0000850%>'
                                                        HeaderStyle-Width="200px">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="LB_Customer" runat="server" Text='<%#Eval("CustomerID") & " " & Eval("Customer")%>' href='<%# ResolveUrl("~/RCC/Clients/ClientDetail.aspx?CID=" + Eval("CustomerId").ToString())%>'></asp:HyperLink>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField SortExpression="CustomerNumber"
                                                        HeaderText='<%$ Resources:Content,GN000924%>' HeaderStyle-Width="100px">
                                                        <ItemTemplate>
                                                            <%#Eval("CustomerNumber")%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField SortExpression="CustCompanyName"
                                                        HeaderText='<%$ Resources:Content,GN00001077%>' HeaderStyle-Width="200px">
                                                        <ItemTemplate>
                                                            <%#Eval("CustCompanyName")%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField SortExpression="Owner" HeaderText='<%$ Resources:Content, SPT002811 %>'
                                                        HeaderStyle-Width="200px">
                                                        <ItemTemplate>
                                                            <%#Eval("Owner")%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField SortExpression="SubscriptionName" HeaderText="<%$ Resources:Content,DGN1110287 %>" HeaderStyle-Width="200px">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="HL_SubscriptionName" runat="server" Text='<%# Eval("SubscriptionName").ToString()%>'></asp:HyperLink>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField SortExpression="HostingId" HeaderText="<%$ Resources:Content,HostingId %>" HeaderStyle-Width="100px">
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="HL_HostingId" runat="server" Text='<%# Eval("HostingId").ToString()%>'></asp:HyperLink>
                                                        </ItemTemplate>

                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,SMI53140 %>" HeaderStyle-Width="150px">
                                                        <ItemTemplate>
                                                            <%# Eval("IsResellerService") %>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,strLicensedServicesEstimate %>" SortExpression="LicensedEstimatedAmount" HeaderStyle-Width="180px">
                                                        <ItemTemplate>
                                                            <%# Eval("CurrencySymbol").ToString() & " " & Eval("LicensedEstimatedAmount")%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,strUsageServicesEstimate %>" SortExpression="UsageEstimatedAmount" HeaderStyle-Width="180px">
                                                        <ItemTemplate>
                                                            <%# Eval("CurrencySymbol").ToString() & " " & Eval("UsageEstimatedAmount")%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,strEstimateCalculatedAt %>" HeaderStyle-Width="150px">
                                                        <ItemTemplate>
                                                            <%# Eval("EstimateTime").ToString() %>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,GN0000360 %>" HeaderStyle-Width="100px">
                                                        <ItemTemplate>
                                                            <ul class="option-menu">
                                                                <li class="dropdown">
                                                                    <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                                                                        <i class="material-icons">menu</i>
                                                                    </a>
                                                                    <ul class="dropdown-menu pull-right" id="UL_OptionMenu" runat="server">
                                                                        <li>
                                                                            <asp:LinkButton ID="Lbtn_Details" runat="server" Text='<%$Resources:Content,GN0000843 %>'
                                                                                CommandName="detail" CommandArgument='<%# Eval("HostingId")%>'></asp:LinkButton></li>
                                                                        <li>
                                                                            <asp:LinkButton ID="Lbtn_CalculateNow" Text="<%$ Resources:Content,strCalculateNow%>"
                                                                                CommandName="calculate" runat="server" CommandArgument='<%# Eval("HostingId")%>' /></li>
                                                                    </ul>
                                                                </li>
                                                            </ul>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <%--Customer, CompanyName, Owner, Subscription Name, SubscriptionId, ResellerSubscription (yes/no), User Licenses Estimate,--%>
                                                    <%--Azure Estimate, Estimate Time, Options: Calculate Now, Detail.--%>
                                                </Columns>
                                                <%--PagerTemplate Start--%>
                                                <PagerTemplate>
                                                    <EM:Pager ID="Pager1" runat="server" />
                                                </PagerTemplate>
                                                <%--PagerTemplate End--%>
                                            </asp:GridView>
                                        </div>
                                    </div>
                                </div>
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>

                    <EM:TabPanel ID="Tab_Detail" runat="server" HeaderText="<%$ Resources:Content,StrEstimateDetail%>" Enabled="false">
                        <ContentTemplate>
                            <asp:Button ID="Btn_Tab1" runat="server" Style="display: none;" />
                            <asp:Panel ID="Pnl_TabContent1" runat="server" Visible="false">

                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="card">
                                            <div class="header">
                                                <h3>
                                                    <%= Resources.Content.GN00001320%>                                                                                                                                 
                                                </h3>
                                            </div>
                                            <div class="body">
                                                <div class="clearfix">
                                                    <asp:Button ID="Btn_Details_ExportToExcel" class="btn btn-primary waves-effect" runat="server"
                                                        Text='<%$ Resources:Content,Ex001 %>' />
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="card">
                                            <div class="body">
                                                <div class="row">
                                                    <div class="col-xs-12 col-sm-3">
                                                        <label class="row-label">
                                                            <asp:Literal ID="Ltrl_EstimatedDetail_Customer" runat="server" Text="<%$ Resources:Content,Customer %>"></asp:Literal>:
                                                        </label>
                                                    </div>
                                                    <div class="col-xs-12 col-sm-6">
                                                        <asp:Literal ID="Ltrl_EstimatedDetail_CustomerInfo" runat="server"></asp:Literal>
                                                    </div>
                                                </div>
                                                <div class="row">
                                                    <div class="col-xs-12 col-sm-3">
                                                        <label class="row-label">
                                                            <asp:Literal ID="Ltrl_EstimatedDetail_Tenant" runat="server" Text="<%$ Resources:Content,strTenant %>"></asp:Literal>:
                                                        </label>
                                                    </div>
                                                    <div class="col-xs-12 col-sm-6">
                                                        <asp:Literal ID="Ltrl_EstimatedDetail_TenantInfo" runat="server"></asp:Literal>
                                                    </div>
                                                </div>
                                                <div class="row" id="DivDomain" runat="server">
                                                    <div class="col-xs-12 col-sm-3">
                                                        <label class="row-label">
                                                            <asp:Literal ID="Ltrl_EstimatedDetail_Domain" runat="server" Text="<%$ Resources:Content,GN0000653 %>"></asp:Literal>:
                                                        </label>
                                                    </div>
                                                    <div class="col-xs-12 col-sm-6">
                                                        <asp:Literal ID="Ltrl_EstimatedDetail_DomainInfo" runat="server"></asp:Literal>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="double-scroll-wrapper1">
                                            <div>
                                            </div>
                                        </div>
                                        <div class="double-scroll-wrapper2">
                                            <asp:GridView ID="GV_EstimateDetails" CssClass="table table-bordered table-striped table-hover" AllowSorting="true"
                                                AllowPaging="false" EmptyDataText='<%$ Resources:Content, GN00001375 %>' runat="server"
                                                AutoGenerateColumns="False">

                                                <Columns>
                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,GN000135 %>" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                                        <ItemTemplate>
                                                             <asp:Literal ID="ServiceType" runat="server"></asp:Literal>
                                                            <%# [Enum].GetName(GetType(MachSol.MachPanel.Utility.Constants.InvoiceEstimateAccountType), Eval("AccountType"))%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,Service %>" HeaderStyle-CssClass="col-xs-4" ItemStyle-CssClass="col-xs-4">
                                                        <ItemTemplate>
                                                            <%# Eval("ServiceName")%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,String35 %>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                                        <ItemTemplate>
                                                            <%# Eval("Quantity")%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="<%$ Resources:Content,StrEstimateAmount %>" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                                        <ItemTemplate>
                                                            <%# Eval("CurrencySymbol").ToString() & " " & Eval("EstimatedAmount")%>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>
                                        </div>
                                    </div>
                                </div>
                            </asp:Panel>
                        </ContentTemplate>
                    </EM:TabPanel>

                </EM:TabContainer>
            </div>
        </div>
    </div>

</asp:Content>

