<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Application_User.aspx.cs" Inherits="Neclog_3_0.Application_User" %>
<%@ Register Src="~/UserControls/ucSearchControl.ascx" TagName="ucSearchControl" TagPrefix="ucSearch" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function grdSearch_OnClientDblClick(recordIndex) {
            grdSearch_OnInternalClientDblClick(recordIndex);
            var cObj = document.getElementById("<%= btnEdit.ClientID%>");
            cObj.click();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class='divtable'>
        <asp:HiddenField ID="hdnRecordKeyId" runat="server" />
        <asp:HiddenField ID="hdnLoginName" runat="server" />
        <asp:HiddenField ID="hdntxtLoginName" runat="server" />
        <asp:HiddenField ID="hdnUserPassword" runat="server" />
        <asp:HiddenField ID="hdnUserType" runat="server" />
        <asp:HiddenField ID="hdnstatus" runat="server" />
        <asp:HiddenField ID="hdnBlockStatus" runat="server" />
        <asp:HiddenField ID="hdnAccessibleBranchId" runat="server" />
        <div class='form-box'>
            <div class="box box-success">
                <div class="box-header with-border">
                    <div class='row'>
                        <div class='col-md-7'>
                            <asp:Label ID="lblTitle" runat="server" class="box-title"></asp:Label>
                            <asp:HiddenField ID="hdnHeaderNote" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnFooterNote" Value="0" runat="server" />
                        </div>
                        <div class='col-md-5' align="right">
                            <asp:UpdatePanel runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:Button ID="btnSearch" runat="server" Text="Find" OnClick="SearchData" CssClass="myButton" CausesValidation="false" ToolTip="Find" />&nbsp;
                                    <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="AddData" CssClass="myButton" CausesValidation="false"  ToolTip="Add" />&nbsp;
                                    <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="SaveData" CssClass="myButton" ToolTip="Save" />&nbsp;
                                    <asp:Button ID="btnEdit" runat="server" Text="Edit" OnClick="btnEdit_Click" CssClass="myButton" ToolTip="Edit" />&nbsp;
                                    <asp:Button ID="btnDelete" runat="server" Text="Delete" OnClientClick="return validateDelete();" OnClick="btnDelete_Click" CssClass="myButton" ToolTip="Delete" />&nbsp;
                                    <asp:Button ID="btnPrint" runat="server" Text="Print" OnClick="btnPrint_Click" CssClass="myButton" CausesValidation="false" ToolTip="Print" />
                                    </ContentTemplate>
                                <Triggers>
                                <asp:PostBackTrigger ControlID="btnPrint" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </div>
                    </div>
                </div>
                <!-- /.box-header -->
                <!-- form start -->


                <div class="form-horizontal">
                    <asp:Panel ID="pnlFormContent" runat="server">
                        <div class="box-body" id="divFormContent" runat="server">
                            <div class="form-group">
                                <asp:Label ID="Label1" runat="server" Text="User Name*" class="col-sm-2 control-label"></asp:Label>
                                <div class="col-sm-5">
                                    <asp:TextBox runat="server" ID="txtUserName" MaxLength="150" class="form-control" />
                                </div>
                                <div class="col-sm-5">
                                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtUserName"
                                        CssClass="text-alert" ErrorMessage="User Name field is required." />
                                </div>
                            </div>
                            <div class="form-group">
                                <asp:Label ID="Label32" runat="server" Text="Login Name*" class="col-sm-2 control-label"></asp:Label>
                                <div class="col-sm-3">
                                    <asp:TextBox runat="server" ID="txtLoginName" MaxLength="150" class="form-control" />
                                </div>
                                <div class="col-sm-2">
                                    <asp:Label ID="Label33" runat="server" Text="(Max 150 Char)" class="control-label"></asp:Label>
                                </div>
                                <div class="col-sm-5">
                                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtLoginName"
                                        CssClass="text-alert" ErrorMessage="Login Name field is required." />
                                </div>
                            </div>
                            <div class="form-group">
                                <asp:Label ID="Label34" runat="server" Text=" Password*" class="col-sm-2 control-label"></asp:Label>
                                <div class="col-sm-3">
                                    <asp:TextBox runat="server" ID="txtUserPassword" TextMode="Password" MaxLength="15" class="form-control" />
                                </div>
                                <div class="col-sm-5">
                                    <asp:Label ID="Label35" runat="server" Text="(min 8 Char, max 15 Char)(Password should be Aa-Zz and 0-9)" class="control-label"></asp:Label>
                                </div>
                                <div class="col-sm-6">
                                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtUserPassword"
                                        CssClass="text-alert" ErrorMessage="Password is required." />
                                    <asp:RegularExpressionValidator runat="server" ControlToValidate="txtUserPassword"
                                        CssClass="text-alert" ErrorMessage="Password constraints not matching." ValidationExpression="^(?=.*\d)(?=.*[a-zA-Z]).{8,15}$" />
                                </div>
                            </div>
                            <div class="form-group" id="divCommGroup" runat="server">
                                <asp:Label ID="Label2" runat="server" Text="Comm. Group*" class="col-sm-2 control-label"></asp:Label>
                                <div class="col-sm-3">
                                    <asp:DropDownList ID="cmbBusinessUnitId" AutoPostBack="true" OnSelectedIndexChanged="cmbBusinessUnitId_SelectedIndexChanged" runat="server" class="form-control">
                                    </asp:DropDownList>
                                </div>
                                <div class="col-sm-5">
                                    <asp:RequiredFieldValidator runat="server" ControlToValidate="cmbBusinessUnitId"
                                        CssClass="text-alert" ErrorMessage="Comm. Group field is required." InitialValue="0" />
                                </div>
                            </div>
                            <div class="form-group">
                                <asp:Label ID="Label3" runat="server" Text="Department Name*" class="col-sm-2 control-label"></asp:Label>
                                <div class="col-sm-3">
                                    <asp:DropDownList ID="cmbBranchId" AutoPostBack="true" runat="server" OnSelectedIndexChanged="cmbBranchId_SelectedIndexChanged" class="form-control">
                                    </asp:DropDownList>
                                </div>
                                <div class="col-sm-5">
                                    <asp:RequiredFieldValidator runat="server" ControlToValidate="cmbBranchId"
                                        CssClass="text-alert" ErrorMessage="Department Name field is required." InitialValue="0" />
                                </div>
                            </div>
                            <div class="form-group" id="divAccessibleBranchId" runat="server">
                                <asp:Label ID="Label36" runat="server" Text="Accesible Department" class="col-sm-2 control-label"></asp:Label>
                                <div class="col-sm-4">
                                    <asp:ListBox ID="lstAccessibleBranchId" runat="server" SelectionMode="Multiple" CssClass="form-control"></asp:ListBox>
                                </div>
                            </div>
                            <div class="form-group">
                                <asp:Label ID="Label37" runat="server" Text="User Group*" class="col-sm-2 control-label"></asp:Label>
                                <div class="col-sm-3">
                                    <asp:DropDownList ID="cmbUserGroupId" runat="server" class="form-control">
                                    </asp:DropDownList>
                                </div>
                                <div class="col-sm-5">
                                    <asp:RequiredFieldValidator runat="server" ControlToValidate="cmbUserGroupId" InitialValue="0" Display="Dynamic" 
                                        CssClass="text-alert" ErrorMessage="User Group field is required." />
                                </div>
                            </div>

                            <div class="form-group">
                                <asp:Label ID="Label38" runat="server" Text="Set Password Duration*" class="col-sm-2 control-label"></asp:Label>
                                <div class="col-sm-1">
                                    <asp:TextBox runat="server" ID="txtPwdFrequency" ReadOnly="true" MaxLength="3" Text="1" class="form-control" />
                                </div>
                                <div class="col-sm-3">
                                    <asp:Label ID="Label39" runat="server" Text="Days ( Min 1 to Max 365 )" class="control-label"></asp:Label>
                                </div>
                                <div class="col-sm-5">
                                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtPwdFrequency"
                                        CssClass="text-alert" ErrorMessage="Password Duration field is required." />
                                    <asp:RangeValidator ID="txtRangePwdFrequency" ErrorMessage="Enter value between 1 to 180" CssClass="text-alert" Type="Integer"  MinimumValue="1" MaximumValue="365" ControlToValidate="txtPwdFrequency" runat="server" />
                                </div>
                                <div class="col-sm-5">
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server"
                                        ControlToValidate="txtPwdFrequency"
                                        ErrorMessage="Password Duration numeric value is required." CssClass="text-alert"
                                        ValidationExpression="^[0-9]*$">
                                    </asp:RegularExpressionValidator>
                                </div>
                            </div>

                            <div class="form-group">
                                <asp:Label ID="Label7" runat="server" Text="Status" class="col-sm-2 control-label"></asp:Label>
                                <div class="col-sm-5" style="vertical-align: middle; margin-top: 5px;">
                                    <asp:RadioButton ID="rdBtnActive" runat="server" GroupName="UserStatus" Text="Active"
                                        Checked="True" CssClass="control-label" />
                                    <asp:RadioButton ID="rdBtnDeActive" runat="server" GroupName="UserStatus" Text="De Active"
                                         CssClass="control-label"  />
                                    <asp:RadioButton ID="rdBtnBlocked" runat="server" GroupName="UserStatus" Text="Blocked"
                                         CssClass="control-label"  />
                                </div>
                            </div>

                        </div>
                    </asp:Panel>                    
                </div>
                <div class="box-body" id="divSearchContent" runat="server" visible="false">
                    <ucSearch:ucSearchControl ID="ucSearch" runat="server" strSearchProcedurename = "UserMaster_Search" 
                        strDelePrecedure="UserMaster_Delete"  strDeletekeys="0, -1" strDeleteColName="@hdnRecordKeyId,@sssUserId" blnOutParameter="true" strColWidth="0,0,30,0,15,15,15,0" />
                </div>
            </div>

        </div>
    </div>


</asp:Content>
