<%@ page language="C#" autoeventwireup="true" inherits="UserMaster, App_Web_usermaster.aspx.de3fb1ff" enableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/UserControls/iERPToolBar.ascx" TagName="iERPToolBar" TagPrefix="dsit" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head id="Head1" runat="server">
    <title>..:: ICDAS 2.1 ::..</title>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />

    <script type="text/javascript" language="javascript" src="../App_Include/JavaScript/js_functions.js"> </script>

    <script type="text/javascript" language="javascript" src="../App_Include/JavaScript/ScreenSaverStar.js"> </script>

    <script type="text/javascript" language="javascript">

        function resizeObject()
        {
            var w = getBrowserWindowSize().width;
            var h = getBrowserWindowSize().height - 10;
            //window.resizeTo(w, h);
            var cObj = document.getElementById("divChildBody");
            if (cObj != null)
            {
                //cObj.style.height = parseInt((h*79)/100) +"px";
                cObj.style.height = (parseInt(h) - 10) + "px";
                //cObj.style.width = parseInt(w) +"px";
            }
            hideWait();
        }


        function validateRecord()
        {
            var doc = document.forms[0];
            re = /[0-9]/;
            re1 = /[a-zA-Z]/;
            
            
            if (Trim(doc.txtUserName.value) == "")
            {
                alert("Please Enter User Name...");
                document.forms[0].txtUserName.focus();
                return false;
            }
            if (Trim(doc.txtLoginName.value) == "")
            {
                alert("Please Enter Login Name...");
                document.forms[0].txtLoginName.focus();
                return false;
            }
            if (Trim(doc.txtUserPassword.value) == "")
            {
                alert("Please Enter Password...");
                document.forms[0].txtUserPassword.focus();
                return false;
            }
            if (Trim(doc.txtUserPassword.value) != "")
            {
                var numaric = doc.txtUserPassword.value;
                if (numaric.length < 8)
                {
                    alert("Enter Password must have more than 8 Char...");
                    document.forms[0].txtUserPassword.focus();
                    return false;
                }
                for (var j = 0; j < numaric.length; j++)
                {
                    var alphaa = numaric.charAt(j);
                    var hh = alphaa.charCodeAt(0);
                    if ((hh > 47 && hh < 58) || (hh > 64 && hh < 91) || (hh > 96 && hh < 123) || (hh == 32))
                    {

                    }
                    else
                    {
                        alert("Enter Alfa-Numeric Password...");
                        document.forms[0].txtUserPassword.focus();
                        return false;
                    }
                }
            }
            if (!re.test(doc.txtUserPassword.value))
            {
                alert("Password must contain at least one number (0-9)!");
                doc.txtUserPassword.focus();
                return false;
            }
            if (!re1.test(doc.txtUserPassword.value))
            {
                alert("Password must contain at least one character (a-zA-Z)!");
                doc.txtUserPassword.focus();
                return false;
            }
            if (doc.cmbBusinessUnitId.selectedIndex == 0)
            {
                alert("Please Select Comm. Group...");
                document.forms[0].cmbBusinessUnitId.focus();
                return false;
            }
            
              if (doc.cmbBranchId.selectedIndex == 0)
            {
                alert("Please Select Department Name...");
                document.forms[0].cmbBranchId.focus();
                return false;
            }

            if (doc.cmbUserGroupId.selectedIndex == 0)
            {
                alert("Please Select Group...");
                document.forms[0].cmbUserGroupId.focus();
                return false;
            }
            if(Trim(doc.txtLoginName.value) == Trim(doc.txtUserPassword.value))
            {
                alert("Login Name and Password can not be same");
                document.getElementById("<%#txtUserPassword.ClientID%>").focus();
                return false;
            }
//            if (Trim(doc.txtPwdFrequency.value) == "")
//            {
//                alert("Please Enter Password Expiry ...");
//                document.forms[0].txtPwdFrequency.focus()
//                return false;
//            }
//            if (parseInt(doc.txtPwdFrequency.value) < 1)
//            {
//                alert("Please Enter Password Expiry > 0...");
//                document.forms[0].txtPwdFrequency.focus();
//                return false;
//            }
//            if (parseInt(doc.txtPwdFrequency.value) > 365)
//            {
//                alert("Please Enter Password Expiry <= 365...");
//                document.forms[0].txtPwdFrequency.focus();
//                return false;
//            }
            else
            {
                return true;
            }
        }
			
    </script>

</head>
<body bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0" onload="resizeObject(); resizeHolder(); init(); initScreenSaver('1',<%=Session["AutoLogOutTime"]%>);">
    <form id="Form1" runat="server" class="formbg" target="_blank">
    <asp:ToolkitScriptManager runat="Server" EnablePartialRendering="true" AsyncPostBackTimeout="0"
        ID="ToolkitScriptManager1" />
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="left" class="formbg">
        <tr>
            <td valign="top" align="left">
                <div id="divMainBody" align="center" runat="server" width="100%" height="100%">
                    <div id="divHeader" runat="server" style="border-style: none; height: 26px; width: 100%;
                        position: absolute; left: 1px; top: 8px;" align="center">
                        <dsit:iERPToolBar ID="iERPToolBar1" runat="server" Caption="Branch Master" PageAccess="11111" />
                    </div>
                    <asp:UpdatePanel ID="uplChildBody" runat="server" UpdateMode="Always">
                        <ContentTemplate>
                            <asp:HiddenField ID="hdnRecordKeyId" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnRecordIds" runat="server" />
                            <asp:HiddenField ID="hdnUserId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnBusinessUnitId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnBranchId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnAccessibleBranchId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnUserPassword" runat="server" />
                            <asp:HiddenField ID="hdnLoginName" runat="server" />
                            <asp:HiddenField ID="hdnUserLevel" runat="server" Value="" />
                            <asp:HiddenField ID="hdnUserType" runat="server" Value="" />
                            <asp:HiddenField ID="hdnLocalUserLevel" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnLocalUserType" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnstatus" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnBlockStatus" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnAccountIds" runat="server" Value="0" />
                            <asp:HiddenField ID="hdntxtLoginName" runat="server" Value="0" />
                            <div id="divChildBody" runat="server" style="overflow: auto; width: 99%;">
                                <table width="100%" align="left" cellpadding="1" cellspacing="0" class="tablefont">
                                    <tr height="62px">
                                        <td colspan="5">
                                            &nbsp
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            User Name*
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtUserName" runat="server" Width="50%" MaxLength="30"></asp:TextBox>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%">
                                            Login Name*
                                        </td>
                                        <td width="80%">
                                            <asp:TextBox ID="txtLoginName" runat="server" Width="50%" MaxLength="15"></asp:TextBox>
                                            &nbsp;(Max 15 Char)
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%">
                                            Password*
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtUserPassword" runat="server" Width="150px" MaxLength="15" TextMode="Password"></asp:TextBox>
                                            &nbsp;(min 8 Char, max 15 Char)(Password should be Aa-Zz,0-9)
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Comm. Group*
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbBusinessUnitId" runat="server" Width="50%" OnSelectedIndexChanged="cmbBusinessUnitId_SelectedIndexChanged"
                                                AutoPostBack="true">
                                            </asp:DropDownList>
                                            <asp:ImageButton ImageAlign="AbsMiddle" ID="ImageBtnBusinessUnit" runat="server"
                                                AlternateText="Click For Refresh" BorderWidth="0px" BackColor="Transparent" ImageUrl="../Images/refresh-icon.gif"
                                                OnClick="ImageBtnBusinessUnit_Click" Visible="false" />
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Department Name*
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbBranchId" runat="server" Width="50%" OnSelectedIndexChanged="cmbBranchId_SelectedIndexChanged"
                                                AutoPostBack="true">
                                            </asp:DropDownList>
                                            <asp:ImageButton ImageAlign="AbsMiddle" ID="ImageBtnBranch" runat="server" AlternateText="Click For Refresh"
                                                BorderWidth="0px" BackColor="Transparent" ImageUrl="../Images/refresh-icon.gif"
                                                OnClick="ImageBtnBranch_Click" Visible="false" />
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <asp:Panel ID="pnlDepartment" runat="server" Visible="false">
                                        <tr>
                                            <td valign="top">
                                                Accessible Department
                                            </td>
                                            <td valign="top">
                                                <asp:ListBox ID="lstAccessibleBranchId" runat="server" Width="50%" SelectionMode="Multiple">
                                                </asp:ListBox>
                                                <asp:ImageButton ImageAlign="AbsMiddle" ID="ImageLstBranchUnit" runat="server" AlternateText="Click For Refresh"
                                                    BorderWidth="0px" BackColor="Transparent" ImageUrl="../Images/refresh-icon.gif"
                                                    OnClick="ImageLstBranch_Click" Visible="false" />
                                            </td>
                                            <td>
                                            </td>
                                            <td>
                                            </td>
                                            <td>
                                            </td>
                                        </tr>
                                    </asp:Panel>
                                    <tr>
                                        <td>
                                            Group*
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="cmbUserGroupId" runat="server" Width="50%">
                                            </asp:DropDownList>
                                            <%-- <asp:ImageButton ImageAlign="AbsMiddle" ID="ImageBtnUserGroup" runat="server" AlternateText="Click For Refresh"
                                                BorderWidth="0px" BackColor="Transparent" ImageUrl="../Images/refresh-icon.gif" OnClick="ImageBtnUserGroup_Click" />--%>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Set Password Duration
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtPwdFrequency" runat="server" Width="35px" MaxLength="3" Text="365"
                                                CssClass="numInput" ReadOnly="true"></asp:TextBox>
                                            &nbsp;Days ( Min 1 to Max 365 )
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Status
                                        </td>
                                        <td>
                                            <asp:RadioButton ID="rdBtnActive" runat="server" GroupName="UserStatus" Text="Active"
                                                Checked="True" />
                                            <asp:RadioButton ID="rdBtnDeActive" runat="server" GroupName="UserStatus" Text="De Active" />
                                            <asp:RadioButton ID="rdBtnBlocked" runat="server" GroupName="UserStatus" Text="Blocked" />
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </ContentTemplate>
                        <Triggers>
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
