<%@ control language="VB" autoeventwireup="false" inherits="PCC_VPS_CC_VMLocations, MachSol.MachPanel.Web" %>



<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Assembly="MachSol.MachPanel.Utility" Namespace="MachSol.MachPanel.Utility" TagPrefix="EM" %>
<%@ Register Src="~/Template/CC/Selectable_Selected_LBX.ascx" TagName="AddSelectableSelected" TagPrefix="EM" %>

<asp:Panel ID="Pnl_Listing" runat="server">

    <asp:Panel ID="Panel5" runat="server" DefaultButton="btnSGAddVMLocation">
        <%--<div class="col-xs-12" >--%>
        <div class="card" id="tblVMLocations" runat="server">
            <div class="header">
                <h3>
                    <asp:Literal ID="Literal13" runat="server" Text='<%$ Resources:Content, strVMStorageLocations %>' EnableViewState="false"></asp:Literal>
                </h3>
            </div>
            <div class="body">
                <div class="row Div_OpsRow" id="trOperations" runat="server">
                    <div class="col-xs-12">
                        <div class="card">
                            <div class="header">
                                <h3>
                                    <%= Resources.Content.GN00001320%>                                                                                                                                 
                                </h3>
                            </div>
                            <div class="body">
                                <div class="row">
                                    <div class="col-xs-12">
                                        <asp:Button ID="btnAddNewVMLocation" class="btn btn-primary waves-effect btnAction" CausesValidation="false" runat="server" Text='<%$ Resources:Content,strAddNewVMPath %>' />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row" id="TrAddVMLocation" visible="false" runat="server">
                    <div class="col-xs-12">
                        <div class="row" runat="server">
                            <div class="col-sm-2 col-xs-12 row-label">
                                *<asp:Literal ID="Literal14" runat="server" Text='<%$ Resources:Content, strVMStorageLocation %>' EnableViewState="false"></asp:Literal>: 
                            </div>
                            <div class="col-sm-3 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="txtVMPath" runat="server" CssClass="CommonPropertiesForTextBox"></asp:TextBox>
                                    </div>
                                </div>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ValidationGroup="VMLocation" ControlToValidate="txtVMPath"
                                    Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegExpForLocalAndUNCPath" ControlToValidate="txtVMPath" runat="server"
                                    ErrorMessage='<%$ Resources:Content, strPathIsInValid%>' ValidationExpression="^[a-zA-Z]\:\\.*|^\\\\.*"
                                    ValidationGroup="VMLocation">
                                </asp:RegularExpressionValidator>
                            </div>
                            <div class="col-sm-3 col-xs-12">
                                <div class="form-group">
                                    <button type="button" class="btn btn-info btn-block btn-xs waves-effect" style="width: 30px;" data-trigger="focus" data-container="body" data-toggle="popover"
                                        data-placement="left" title="Storage Lacation Example" data-content="C:\Folders OR \\UNCPath">
                                        <i class="material-icons">info</i>
                                    </button>
                                </div>
                            </div>
                        </div>


                        <div class="row">
                            <div class="col-sm-2 col-xs-12 row-label">
                                *<asp:Literal ID="Literal1" runat="server" Text='<%$ Resources:Content,strVHDPath %>' EnableViewState="false"></asp:Literal>:
                            </div>
                            <div class="col-sm-3 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="txtSGVHDPath" runat="server" CssClass="CommonPropertiesForTextBox"></asp:TextBox>
                                    </div>
                                </div>

                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="VHDLocation" ControlToValidate="txtSGVHDPath"
                                    Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="txtSGVHDPath" runat="server"
                                    ErrorMessage='<%$ Resources:Content, strPathIsInValid%>' ValidationExpression="^[a-zA-Z]\:\\.*|^\\\\.*"
                                    ValidationGroup="VHDLocation">
                                </asp:RegularExpressionValidator>
                            </div>
                            <div class="col-sm-1 col-xs-12 row-label">
                                *<asp:Literal ID="Literal2" runat="server" Text='<%$ Resources:Content, strMaxSizeGBs%>' EnableViewState="false"></asp:Literal>: 
                            </div>
                            <div class="col-sm-1 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="txtSGVHDLocationMaxSize" runat="server" MaxLength="6" CssClass="CommonPropertiesForTextBox"></asp:TextBox>
                                    </div>
                                </div>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ValidationGroup="VHDLocation" ControlToValidate="txtSGVHDLocationMaxSize"
                                    Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" ControlToValidate="txtSGVHDLocationMaxSize" runat="server"
                                    ErrorMessage='<%$ Resources:Content, strOnlyNumbersAllowed%>' ValidationExpression="\d+">
                                </asp:RegularExpressionValidator>
                            </div>
                            <div class="col-sm-1 col-xs-12 row-label">
                                *<asp:Literal ID="Literal3" runat="server" Text='<%$ Resources:Content, strStorageType%>' EnableViewState="false"></asp:Literal>: 
                            </div>
                            <div class="col-sm-2 col-xs-12">
                                <div class="form-group">
                                    <asp:DropDownList ID="ddl_StorageType" runat="server"></asp:DropDownList>
                                </div>
                            </div>


                            <div class="col-sm-1 col-xs-12">
                                <asp:Button ID="btnAddVHD" runat="server" Text='<%$ Resources: Content,strAdd %>' class="btn btn-primary waves-effect" ValidationGroup="VHDLocation"></asp:Button>
                            </div>
                        </div>

                        <div class="row" id="trLstVHDLocation" runat="server">
                            <div class="col-xs-12">
                                <EM:MPGridView ID="GV_VHDLocations" CurrentSortExpression="VHDLocations" CurrentSortDirection="Asc"
                                    CssClass="table table-bordered table-striped table-hover" runat="server" AllowPaging="false"
                                    AutoGenerateColumns="false" DataKeyNames='VMVHDLocationId'>
                                    <Columns>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content, strVHDPath %>"
                                            HeaderStyle-CssClass="col-xs-4" ItemStyle-CssClass="col-xs-4">
                                            <ItemTemplate>
                                                <asp:Label ID="lblVHDLocation" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.VHDPath")%>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content, strMaxSizeGBs %>"
                                            HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                            <ItemTemplate>
                                                <asp:Label ID="lblMaxSize" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.MaxSize") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="<%$ Resources:Content,strStorageType %>"
                                            HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                            <ItemTemplate>
                                                <asp:Label ID="lblStorageType" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content, GN0000360 %>"
                                            HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                            <ItemTemplate>
                                                <%--<asp:LinkButton CssClass="btn btn-primary waves-effect" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.VHDLocationId ")%>'
                                            ID="LB_Edit" CommandName="EditRow" runat="server" Text="<%$ Resources:Content,GN0000276%>" CausesValidation="false" />--%>
                                                <asp:LinkButton CssClass="btn btn-primary waves-effect btnAction" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.VMVHDLocationId")%>'
                                                    ID="LB_Remove" CommandName="Remove" runat="server" Text="<%$ Resources:Content,GN0000278%>" CausesValidation="false" />
                                                <EM:ConfirmButtonExtender ID="CBE_Remove" ConfirmText="<%$ Resources:Content,strAreyousuretodeleteVHDLocation%>" TargetControlID="LB_Remove" runat="server">
                                                </EM:ConfirmButtonExtender>

                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </EM:MPGridView>
                            </div>
                        </div>

                        <div class="row" runat="server">
                            <div class="col-sm-2 col-xs-12 row-label">
                                *<asp:Literal ID="Literal15" runat="server" Text='<%$ Resources:Content, DeletedVHDspath%>' EnableViewState="false"></asp:Literal>: 
                            </div>
                            <div class="col-sm-3 col-xs-12">
                                <div class="form-group">
                                    <div class="form-line">
                                        <asp:TextBox ID="txtDeletedVHDsPath" runat="server" CssClass="CommonPropertiesForTextBox"></asp:TextBox>
                                    </div>
                                </div>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ValidationGroup="VMLocation" ControlToValidate="txtDeletedVHDsPath"
                                    Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" ControlToValidate="txtDeletedVHDsPath" runat="server"
                                    ErrorMessage='<%$ Resources:Content, strPathIsInValid%>' ValidationExpression="^[a-zA-Z]\:\\.*|^\\\\.*"
                                    ValidationGroup="VMLocation">
                                </asp:RegularExpressionValidator>
                            </div>


                            <div class="col-sm-1 col-xs-12 row-label">
                                *<asp:Literal ID="Literal24" runat="server" Text='<%$ Resources:Content,ArchiveDeletedVHD %>' EnableViewState="false"></asp:Literal>:                        
                            </div>
                            <div class="col-sm-1">
                                <asp:DropDownList ID="DDL_ArchiveDays" runat="server">
                                    <asp:ListItem Text="0" Value="0"></asp:ListItem>
                                    <asp:ListItem Text="5" Value="5"></asp:ListItem>
                                    <asp:ListItem Text="10" Value="10"></asp:ListItem>
                                    <asp:ListItem Text="15" Value="15"></asp:ListItem>
                                    <asp:ListItem Text="30" Value="30"></asp:ListItem>
                                    <asp:ListItem Text="60" Value="60"></asp:ListItem>
                                    <asp:ListItem Text="90" Value="90"></asp:ListItem>
                                    <asp:ListItem Text="180" Value="180"></asp:ListItem>
                                </asp:DropDownList>
                            </div>
                            <div class="col-sm-1">
                                <asp:Literal ID="Literal25" runat="server" Text='<%$ Resources:Content,SPT0010056 %>' EnableViewState="false"></asp:Literal>
                            </div>
                        </div>

                        <div class="row" id="trCustomers" runat="server">
                            <div class="col-xs-12 row-label">
                                <asp:Label ID="Label4" runat="server" Text="<%$ Resources:Content,GN0000850 %>" />:
                            </div>
                            <div class="col-xs-12">
                                <EM:AddSelectableSelected ID="UCCustomer" runat="server" />
                            </div>
                        </div>

                        <div class="row" id="trbtnAdd" runat="server">
                            <div class="col-xs-12">
                                <asp:Button ID="btnSGAddVMLocation" runat="server" Text='<%$ Resources:Content,GN0000659 %>' CausesValidation="true" ValidationGroup="VMLocation" class="btn btn-primary waves-effect" />
                                <asp:Button ID="BtnCancel" CausesValidation="false" runat="server" Text='<%$ Resources:Content,GN0000572 %>' class="btn btn-primary waves-effect" />
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row" id="trVMLocationListing" runat="server">
                    <div class="col-xs-12">
                        <EM:MPGridView ID="GV_VMLocations" CurrentSortExpression="VMLocationId" CurrentSortDirection="Asc"
                            CssClass="table table-bordered table-striped table-hover" runat="server" AllowPaging="false" EmptyDataText='<%$ Resources:Content, GN00001375 %>'
                            AutoGenerateColumns="false" DataKeyNames='VMlocationId'>
                            <Columns>
                                <asp:TemplateField HeaderStyle-CssClass="col-xs-4" ItemStyle-CssClass="col-xs-4"><%--HeaderText="<%$ Resources:Content, strVMLocationSettings %>" --%>
                                    <HeaderTemplate>
                                        <%= Resources.Content.strVMLocationSettings %>
                                    </HeaderTemplate>

                                    <ItemTemplate>

                                        <table class="table small">
                                            <tr>
                                                <td class="row-label" style="width: 30%">
                                                    <%= Resources.Content.HVServer17 %>:                                                                                                             
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblVMLocation" runat="server"></asp:Label>
                                                    <%--Text='<%# DataBinder.Eval(Container, "DataItem.VMFilePath")%>'--%>
                                                </td>
                                            </tr>
                                            <tr id="trDiskPath" runat="server">
                                                <td class="row-label">
                                                    <%= Resources.Content.DeletedVHDspath %>:
                                                </td>
                                                <td>
                                                    <asp:Label ID="LblVMArchiveFilePath" runat="server"></asp:Label>
                                                    <%--Text='<%# DataBinder.Eval(Container, "DataItem.VMArchiveFilePath") %>'--%>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="row-label">
                                                    <%= Resources.Content.ArchiveDeletedVHD %>:
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblArchiveVHDsFor" runat="server"></asp:Label>
                                                    <%--Text='<%# DataBinder.Eval(Container, "DataItem.KeepArchiveFilesForDays") %>'--%>
                                                    <asp:Label ID="lblDays" runat="server" Text='<%$ Resources:Content,strDays %>'></asp:Label>
                                                </td>
                                            </tr>

                                        </table>


                                    </ItemTemplate>

                                </asp:TemplateField>

                                <asp:TemplateField HeaderStyle-CssClass="col-xs-4" ItemStyle-CssClass="col-xs-4"><%--HeaderText="<%$ Resources:Content, strVHDLocationSettings  %>"--%>
                                    <HeaderTemplate>
                                        <table class="table small">
                                            <tr id="trVHDHeader" runat="server">
                                                <th class="row-label" style="width: 40%"><%= Resources.Content.strVHDPath %> </th>
                                                <th class="row-label" style="width: 25%"><%= Resources.Content.strMaxSizeGBs %>     </th>
                                                <th class="row-label" style="width: 30%"><%= Resources.Content.strStorageType %></th>
                                            </tr>
                                        </table>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:Repeater ID="repVHDLocations" runat="server">
                                            <ItemTemplate>
                                                <table class="table small">
                                                    <tr>
                                                        <td style="width: 40%">
                                                            <asp:Label ID="LblVHDPath" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.VHDPath")%>'></asp:Label>
                                                        </td>
                                                        <td style="width: 25%">
                                                            <asp:Label ID="lblMaxSiz" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.MaxSize")%>'></asp:Label>
                                                        </td>
                                                        <td style="width: 30%">
                                                            <asp:Label ID="LblStorageType" runat="server" Text='<%# BusinessObjects.CommonEF.GetVPSStorageNameById(DataBinder.Eval(Container, "DataItem.VPSStorageTypeId")) %>'></asp:Label>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </asp:Repeater>

                                    </ItemTemplate>

                                </asp:TemplateField>


                                <asp:TemplateField HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2"><%--HeaderText="<%$ Resources:Content,GN0000850 %>"--%>
                                    <HeaderTemplate>
                                        <%= Resources.Content.GN0000850 %>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LB_Details" runat="server" />
                                        <div id="Div_Details" runat="server" style="display: none" />
                                        <%--<asp:Label ID="lblCustomers" runat="server"></asp:Label>--%>
                                        <%--Text='<%# DataBinder.Eval(Container, "DataItem.Customers") %>'--%>
                                    </ItemTemplate>

                                </asp:TemplateField>

                                <asp:TemplateField HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2"><%--HeaderText="<%$ Resources:Content, GN0000360 %>"--%>
                                    <HeaderTemplate>
                                        <%= Resources.Content.GN0000360 %>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:LinkButton CssClass="btn btn-primary waves-effect" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.VMLocationID")%>'
                                            ID="LB_Edit" CommandName="EditRow" runat="server" Text="<%$ Resources:Content,GN0000276%>" CausesValidation="false" />
                                        <asp:LinkButton CssClass="btn btn-primary waves-effect btnAction" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.VMLocationID")%>'
                                            ID="LB_Remove" CommandName="Remove" runat="server" Text="<%$ Resources:Content,GN0000278%>" CausesValidation="false" />
                                        <EM:ConfirmButtonExtender ID="CBE_Remove" ConfirmText="<%$ Resources:Content,strAreyousuretodeleteVMLocation%>" TargetControlID="LB_Remove" runat="server">
                                        </EM:ConfirmButtonExtender>

                                    </ItemTemplate>
                                </asp:TemplateField>

                            </Columns>
                        </EM:MPGridView>
                    </div>
                </div>

            </div>
        </div>
        <asp:Button ID="Dummy" runat="server" Style="display: none" />

        <asp:Panel ID="Panel1" runat="server" CssClass="width-modal-popup-auto"
            Style="display: none;">
            <div class="col-xs-12">
                <div class="card">
                    <div class="header">
                        <h3>
                            <%= Resources.Content.SM200001%>
                            <span>
                                <button type="button" class="close" onclick="$find('<%=MP1.ClientID%>').hide();">&times;</button>
                            </span>
                        </h3>
                    </div>
                    <div class="body">
                        <div class="row">
                            <div class="col-xs-12">
                                <div id="Div_ShowDetails" runat="server" />

                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-12 row-label">
                            <asp:Button ID="Btn_Close" CssClass="btn btn-primary waves-effect" runat="server" Text="<%$ Resources:Content,GN000150%>" />
                        </div>
                    </div>
                </div>
            </div>

        </asp:Panel>

        <EM:ModalPopupExtender runat="server" ID="MP1" BackgroundCssClass="modalBackground"
            DropShadow="false" PopupControlID="Panel1" TargetControlID="Dummy" CancelControlID="Btn_Close">
        </EM:ModalPopupExtender>
        <%--</div>--%>
        <asp:ValidationSummary HeaderText='<%$ Resources:Content,EM000001 %>' ID="ValidationSummary2"
            runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="VMLocation" />
    </asp:Panel>
</asp:Panel>

