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

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

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

    <script type="text/javascript">
        function ValidatePopup(IdDisplayName, IdUserName, IdPass, IdCPass, IdSendEmail, IdCB) {
            var Txt_DisplayName = $get(IdDisplayName);
            var Txt_UserName = $get(IdUserName);
            var Txt_Pass = $get(IdPass);
            var Txt_CPass = $get(IdCPass);
            var Txt_SendEmail = $get(IdSendEmail);
            var Cb_SendEmail = $get(IdCB);
            if (Txt_DisplayName != null && Txt_UserName != null && Txt_Pass != null && Txt_CPass != null) {
                if (Txt_DisplayName.value == '')
                { alert(<% Response.Write("'" + Resources.Content.EM000001 + "'")%>); Txt_DisplayName.focus(); return false }
                else if (Txt_UserName.value == '')
                { alert(<% Response.Write("'" + Resources.Content.EM000001 + "'")%>); Txt_UserName.focus(); return false }
                else if (Txt_Pass.value == '')
                { alert(<% Response.Write("'" + Resources.Content.EM000001 + "'")%>); Txt_Pass.focus(); return false }
                else if (Txt_CPass.value == '')
                { alert(<% Response.Write("'" + Resources.Content.EM000001 + "'")%>); Txt_CPass.focus(); return false }
                else if (Txt_Pass.value != Txt_CPass.value)
                { alert(<% Response.Write("'" + Resources.Content.L0075 + "'")%>); Txt_Pass.focus(); return false }
                else if (Cb_SendEmail.checked) {

                    if (Txt_SendEmail.value == '')
                    { alert(<% Response.Write("'" + Resources.Content.EM000001 + "'")%>); Txt_SendEmail.focus(); return false }
                    else if (!(convertToASCIIAndValidate(Txt_SendEmail.value, EmailValidationExpression.toString())))
                    { alert(<% Response.Write("'" + Resources.Content.Dev487 + "'")%>); Txt_SendEmail.focus(); return false }
                    else
                    { return true }
            }
            else { return true }
}
}

function CBChange(CB_Id, Tr_Id) {
    var Tr = document.getElementById(Tr_Id);
    var CB = document.getElementById(CB_Id);

    if (CB.checked == true) {
        Tr.style.display = '';
    }
    else {
        Tr.style.display = 'none';
    }

}
    </script>

    <div class="col-xs-12">
        <div class="card">
            <div class="header">
                <h2>
                    <asp:Literal ID="Ltl_SubsInfo" runat="server" /></h2>
            </div>
            <div class="body">
                <ajax:UpdatePanel ID="UP" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <EM:TabContainer ID="TC_ADDetail" runat="server" OnClientActiveTabChanged="loadTabPanel">
                            <EM:TabPanel ID="Tab_DCDetail" runat="server" HeaderText="<%$Resources:Content,SM0101%>">
                                <ContentTemplate>
                                    <asp:Button ID="Btn_Tab0" runat="server" Style="display: none;" />
                                    <asp:Panel ID="Pnl_TabContent0" runat="server" Visible="true">
                                        <div id="Tbl_Edit" runat="server">
                                            <div class="row">
                                                <div class="col-sm-3 col-xs-12 row-label">
                                                    <label>*<asp:Literal ID="Literal7" runat="server" Text="<%$Resources:Content,String80%>" EnableViewState="false"></asp:Literal>:</label>
                                                </div>
                                                <div class="col-sm-4 col-xs-12">
                                                    <div class="form-group">
                                                        <div class="form-line">
                                                            <asp:TextBox ID="TxBx_DCName" Text="" runat="server" MaxLength="255" data-label="Name"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxBx_DCName"
                                                                Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-sm-3 col-xs-12 row-label">
                                                    <label>
                                                        *<asp:Literal ID="Literal3" runat="server" Text="<%$Resources:Content,String140%>" EnableViewState="false"></asp:Literal>:</label>
                                                </div>
                                                <div class="col-sm-4 col-xs-12">
                                                    <div class="form-group">
                                                        <div class="form-line">
                                                            <asp:TextBox ID="TxBx_DCNetBiosName" Text="" runat="server" MaxLength="255" data-label="Net BIOS Name"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxBx_DCNetBiosName"
                                                                Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-sm-3 col-xs-12 row-label">
                                                    <label>*<asp:Literal ID="Literal4" runat="server" Text="<%$Resources:Content,DGN1110434%>" EnableViewState="false"></asp:Literal>:</label>
                                                </div>
                                                <div class="col-sm-4 col-xs-12">
                                                    <div class="form-group">
                                                        <div class="form-line">
                                                            <asp:TextBox ID="TxBx_DomainAdminlogin" runat="server" MaxLength="100" data-label="Domain Admin Login"></asp:TextBox>
                                                            <asp:RequiredFieldValidator ID="RFV_DomainAdminlogin" runat="server" ControlToValidate="TxBx_DomainAdminlogin"
                                                                Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-sm-3 col-xs-12 row-label">
                                                    <label>
                                                        <asp:Literal ID="Literal6" runat="server" Text="<%$Resources:Content,DGN1110435%>" EnableViewState="false"></asp:Literal>:</label>
                                                </div>
                                                <div class="col-sm-4 col-xs-12">
                                                    <div class="form-group">
                                                        <div class="form-line">
                                                            <asp:TextBox ID="TxBx_DomAdminpassword" TextMode="Password" runat="server" MaxLength="100" data-label="Domain Admin Password" data-secure="1"></asp:TextBox>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-sm-3 col-xs-12 row-label">
                                                    <label>
                                                        <asp:Literal ID="Literal5" runat="server" Text="<%$Resources:Content,GN0001196%>" EnableViewState="false"></asp:Literal>:</label>
                                                </div>
                                                <div class="col-sm-4 col-xs-12">
                                                    <div class="form-group">
                                                        <div class="form-line">
                                                            <asp:TextBox ID="TxBx_CPass" TextMode="Password" runat="server" MaxLength="100" data-label="Confirm Password" data-state="hidden"></asp:TextBox>
                                                        </div>
                                                    </div>
                                                    <asp:CompareValidator ID="CompareValidator3" runat="server" ControlToCompare="TxBx_DomAdminpassword"
                                                        ErrorMessage="<%$ Resources:Content,DGN1110005 %>" ControlToValidate="TxBx_CPass"
                                                        Display="None"></asp:CompareValidator>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-sm-3 col-xs-12 row-label">
                                                    <label>*<asp:Literal ID="Literal2" runat="server" Text="<%$Resources:Content,GenerateRandomGUID%>" EnableViewState="false"></asp:Literal>:</label>
                                                </div>
                                                <div class="col-sm-1 col-xs-12">
                                                    <asp:CheckBox ID="CB_GenerateRandomGUID" runat="server" Checked="false" Text=" " data-label="Generate Random GUID Allowed" />
                                                </div>
                                                <div class="col-sm-8 col-xs-12">
                                                    <asp:Literal ID="Ltl" runat="server" Text="<%$Resources:Content,GenerateRandomGUIDHelpText%>"></asp:Literal>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-sm-3 col-xs-12 row-label">
                                                    <label>
                                                        <asp:Literal ID="Literal1" runat="server" Text="<%$Resources:Content,FAM00156%>" EnableViewState="false"></asp:Literal>:</label>
                                                </div>
                                                <div class="col-sm-4 col-xs-12">
                                                    <asp:CheckBox ID="CB_AppendUPNSuffix" runat="server" Checked="true" Text=" " data-label="Append UPN Suffix" />
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-xs-12">
                                                    <asp:Button ID="Btn_Save" class="btn btn-primary waves-effect btnAction" Text='<%$ Resources:Content,GN0000281%>'
                                                        runat="server" />
                                                    <asp:Button ID="Btn_CancelEdit" class="btn btn-primary waves-effect" CausesValidation="false" Text='<%$ Resources:Content,GN0000572%>'
                                                        runat="server" />
                                                    <asp:ValidationSummary ID="ValidationSum_1" runat="server" HeaderText='<%$ Resources:Content,EM000001 %>'
                                                        ShowMessageBox="True" ShowSummary="False" />
                                                </div>
                                            </div>
                                        </div>
                                        <div id="Tbl_List" runat="server">
                                            <div class="row">
                                                <div class="col-sm-3 col-xs-12 row-label">
                                                    <asp:Literal ID="Literal12" runat="server" Text="<%$Resources:Content,String80%>" EnableViewState="false"></asp:Literal>:
                                                </div>
                                                <div class="col-sm-9 col-xs-12" id="Td_DCName" runat="server"></div>
                                            </div>
                                            <div class="row">
                                                <div class="col-sm-3 col-xs-12 row-label">
                                                    <asp:Literal ID="Literal13" runat="server" Text="<%$Resources:Content,String140%>" EnableViewState="false"></asp:Literal>:
                                                </div>
                                                <div class="col-sm-9 col-xs-12" id="Td_NetBIOS" runat="server"></div>
                                            </div>
                                            <div class="row">
                                                <div class="col-sm-3 col-xs-12 row-label">
                                                    <asp:Literal ID="Literal14" runat="server" Text="<%$Resources:Content,DGN1110434%> " EnableViewState="false"></asp:Literal>:
                                                </div>
                                                <div class="col-sm-9 col-xs-12" id="Td_Login" runat="server"></div>
                                            </div>
                                            <div class="row">
                                                <div class="col-sm-3 col-xs-12 row-label">
                                                    <asp:Literal ID="Literal9" runat="server" Text="<%$Resources:Content,FAM00156%>" EnableViewState="false"></asp:Literal>:
                                                </div>
                                                <div class="col-sm-9 col-xs-12">
                                                    <asp:Image runat="server" ID="Img_AppendUPNSuffix" ImageUrl="~/Images/icons/yes.png" />
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="col-xs-12">
                                                    <asp:Button ID="btn_Edit" class="btn btn-primary waves-effect" Text='<%$ Resources:Content,GN0000276%>' runat="server" />
                                                </div>
                                            </div>
                                        </div>
                                    </asp:Panel>
                                </ContentTemplate>
                            </EM:TabPanel>
                            <EM:TabPanel ID="TP_ADUsers" Enabled="false" runat="server" HeaderText="<%$Resources:Content,SM0104%>">
                                <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">
                                                <asp:GridView CssClass="table table-bordered table-striped table-hover" EmptyDataText="<%$ Resources:Content, GN00001375 %>"
                                                    DataKeyNames="ServiceType,UserLogonName" ID="GV_ADUserList" runat="server" AutoGenerateColumns="False" AllowPaging="false">

                                                    <Columns>
                                                        <asp:TemplateField HeaderText="<%$ Resources:Content,GN00001113 %>" HeaderStyle-CssClass="col-xs-5" ItemStyle-CssClass="col-xs-5">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Lbl_DisplayName" runat="server"></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="<%$ Resources:Content, String436 %>" HeaderStyle-CssClass="col-xs-5" ItemStyle-CssClass="col-xs-5">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Lbl_LogOnNme" 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 ID="Lb_ChPWD" runat="server" class="btn btn-primary waves-effect" Text="Change Password"></asp:LinkButton>--%>
                                                                <asp:LinkButton ID="Lb_ChPWD" runat="server" class="btn btn-primary waves-effect btnAction" Text="<%$ Resources:Content, M0087 %>"
                                                                    CausesValidation="false" CommandName="CPWD" CommandArgument='<%# DataBinder.Eval(Container,"DataItem.ADUserId")%>'></asp:LinkButton>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <%--PagerTemplate Start--%>
                                                    <PagerTemplate>
                                                        <EM:Pager ID="Pager1" runat="server" />
                                                    </PagerTemplate>
                                                    <%--PagerTemplate End--%>
                                                </asp:GridView>
                                            </div>
                                        </div>
                                    </asp:Panel>
                                </ContentTemplate>
                            </EM:TabPanel>
                        </EM:TabContainer>
                    </ContentTemplate>
                </ajax:UpdatePanel>
            </div>
        </div>
    </div>

    <ajax:UpdatePanel ID="UP_ChangePWD" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Panel ID="Pnl_ChangePWD" runat="server" CssClass="width-modal-popup-auto">
                <asp:HiddenField ID="HF_ServiceType" runat="server" />
                <div class="col-xs-12">
                    <div class="card">
                        <div class="header">
                            <h3>Change Password</h3>
                        </div>
                        <div class="body">
                            <div class="row" style="display: none">
                                <div class="col-sm-4 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Ltrl_DisplayName" runat="server" Text="<%$ Resources:Content,GN00001113 %>" EnableViewState="false"></asp:Literal>:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_DisplayName" runat="server" ValidationGroup="UPChange" Enabled="false"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RFV_DispName" runat="server" ControlToValidate="TxBx_DisplayName"
                                                Display="none" ValidationGroup="UPChange" SetFocusOnError="true"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-4 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Ltrl_UserName" runat="server" Text="<%$ Resources:Content,GN0000567 %>" EnableViewState="false"></asp:Literal>:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_UserName" runat="server" ValidationGroup="UPChange" ReadOnly="true"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RFV_UserName" runat="server" ControlToValidate="TxBx_UserName"
                                                Display="none" ValidationGroup="UPChange" SetFocusOnError="true"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-4 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Ltrl_Password" runat="server" Text="<%$ Resources:Content,GN0000569 %>" EnableViewState="false"></asp:Literal>:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_Password" runat="server" TextMode="Password" ValidationGroup="UPChange"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RFV_Password" runat="server" ControlToValidate="TxBx_Password"
                                                Display="none" ValidationGroup="UPChange" SetFocusOnError="true"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-4 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Literal8" runat="server" Text="<%$ Resources:Content,GN0001196 %>" EnableViewState="false"></asp:Literal>:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_CPassword" runat="server" TextMode="Password" ValidationGroup="UPChange"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RFV_CPassword" runat="server" ControlToValidate="TxBx_CPassword"
                                                Display="none" ValidationGroup="UPChange" SetFocusOnError="true"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                    <asp:CompareValidator ID="CV" runat="server" ControlToValidate="TxBx_CPassword" ControlToCompare="TxBx_Password"
                                        ValidationGroup="UPChange">
                                    </asp:CompareValidator>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-4 col-xs-12 row-label">
                                    <label>
                                        <asp:Literal ID="Ltrl_Option" runat="server" Text="<%$ Resources:Content,GN0000752 %>" EnableViewState="false"></asp:Literal>:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <asp:CheckBox ID="ChBx_SendEmail" runat="server" Checked="true" Text=" " />
                                </div>
                            </div>
                            <div class="row" runat="server" id="Tr_SendEmail">
                                <div class="col-sm-4 col-xs-12 row-label">
                                    <label>*<asp:Literal ID="Ltrl_EAddress" runat="server" Text="<%$ Resources:Content,GN0000491 %>" EnableViewState="false"></asp:Literal>:</label>
                                </div>
                                <div class="col-sm-4 col-xs-12">
                                    <div class="form-group">
                                        <div class="form-line">
                                            <asp:TextBox ID="TxBx_SendEmail" runat="server"></asp:TextBox>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-xs-12">
                                    <asp:Button ID="Btn_OK" runat="server" Text="<%$Resources:Content,GN0000858%>" class="btn btn-primary waves-effect" ValidationGroup="UPChange"
                                        CausesValidation="true" />
                                    <asp:Button ID="Btn_Cancel" runat="server" Text="<%$Resources:Content,GN0000572%>" class="btn btn-primary waves-effect" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </asp:Panel>
            <asp:Button ID="Btn_Dummy" runat="server" Style="display: none" />
            <EM:ModalPopupExtender ID="MPE_ChangePWD" runat="server" TargetControlID="Btn_Dummy"
                BackgroundCssClass="modalBackground" DropShadow="False" PopupControlID="Pnl_ChangePWD"
                CancelControlID="Btn_Cancel">
            </EM:ModalPopupExtender>
        </ContentTemplate>
    </ajax:UpdatePanel>
</asp:Content>
