<%@ Page Language="C#" MasterPageFile="~/masterpages/eDashboard.master" AutoEventWireup="true" Inherits="site_HITS_User_Add" Title="Brightstar Device Protection: Create New User"
    Theme="eMain" Culture="auto" UICulture="auto" Codebehind="Add.aspx.cs" %>

<%@ Register Src="~/Controls/ChildHeader.ascx" TagName="ChildHeader" TagPrefix="uc" %>
<%@ Register Src="~/Controls/PhoneNumber.ascx" TagName="PhoneNumber" TagPrefix="uc1" %>
<%@ Register Src="~/Controls/PersistNav.ascx" TagName="PersistNav" TagPrefix="uc2" %>
<%@ Register Assembly="eSecuritel.HITS.UI.Components" Namespace="eSecuritel.HITS.UI.Components"
    TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="eContent" runat="Server">

    <script src="../../../script/eSetFormControls.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            if ('[id$=_m_txtPhoneNumber]')[0]
            {
                $('[id$=_m_txtPhoneNumber]')[0].style.width = "121px"
            }
            if ($.browser.msie && parseFloat($.browser.version) < 8) {
                $('[id$=_m_txtZipCode]')[0].style.width = "250px"
                $('[id$=_m_txtWorkPhoneExtension]')[0].style.width = "63px"
                $('[id$=m_txtOrgUnit]')[0].style.width = "230px"
           
            }
            if ($.browser.msie && parseFloat($.browser.version) == 8) {
                $('[id$=_m_txtZipCode]')[0].style.width = "245px"
                $('[id$=m_txtWorkPhoneExtension]')[0].style.width = "66px"
                $('[id$=m_txtOrgUnit]')[0].style.width = "230px"
            }

            if ($.browser.msie && parseFloat($.browser.version) > 8) {
                $('[id$=m_txtOrgUnit]')[0].style.width = "225px"
                $('[id$=_m_txtZipCode]')[0].style.width = "235px"
                $('[id$=m_txtWorkPhoneExtension]')[0].style.width = "65px"
                        }
                     });
        </script>
    <cc1:ExtendedValidationSummary ID="m_extValidationSummaryTop" runat="server" HeaderText="<%$ Resources: UsersManagement, HeaderMessageFollowingItemsReviewedBeforeCreating %>"
        />
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <h1>
                    <asp:Literal ID="m_litAddNewUserHeader" runat="server" Text="<%$ Resources: UsersManagement, LabelCreateNewUser %>" />
                </h1>
            </td>
            <td valign="top">
                <uc2:PersistNav ID="PersistNav1" runat="server" />
            </td>
        </tr>
    </table>
    <uc:ChildHeader ID = "ChildHeader1" runat = "server" />
    <h2>
        <asp:Literal ID="m_litGeneralInfoHeader" runat="server" Text="<%$ Resources: UsersManagement, LabelGeneralInformation %>" />
        <asp:Panel ID="m_pnlStatus" runat="server">
                <asp:Label ID="m_lblStatus" runat="server" />
            </asp:Panel>
    </h2>
    <div class="greyblock">
        <b><span style="color: #ff0000">* </span></b>
        <asp:Literal ID="m_litRequired" runat="server" Text="<%$ Resources: Default, LabelIndicatesRequiredField %>" />
        <table border="0" cellpadding="0" cellspacing="0" class="gvTable">
            <tr>
                <td align = "right" nowrap>
                    <asp:Literal ID="m_litOrganization" runat="server" Text="<%$ Resources: OrganizationManagement, LabelOrganizationColon %>" />
                    <b><span style="color: #ff0000">*</span></b>
                </td>
                <td nowrap>
                    <asp:DropDownList ID="m_ddlOrg" runat="server" Width="239px" AutoPostBack="True"
                        OnSelectedIndexChanged="m_ddlOrg_SelectedIndexChanged">
                    </asp:DropDownList>
                    <asp:CustomValidator ID="m_cvOrganization" runat="server" ControlToValidate="m_ddlOrg"
                        Text="<%$ Resources:Default, ValidatorText %>" ErrorMessage="<%$ Resources: OrganizationManagement, ErrorMessageYouMustSelectOrganization %>"
                        ToolTip="<%$ Resources: OrganizationManagement, ToolTipYouMustSelectOrganization %>" OnServerValidate="cvOrganization_ServerValidate"
                        />
                </td>
            </tr>
            <asp:Panel ID="m_pnlCannotAdd" runat="server" Visible="False">
                <tr>
                    <td>
                        <div style="color: Red;" nowrap>
                            <asp:Literal ID="m_litCannotAdd" runat="server" Text="<%$ Resources: UsersManagement, LabelOnlyRootLevelUserAddNeweSecuritelUser %>"
                                />
                        </div>
                    </td>
                </tr>
            </asp:Panel>
                        
            <asp:Panel ID="m_pnlOrgUnitSelect" runat="server" Visible="false">
                  <tr>
                        <td style="padding-top:20px"></td>
                        <td style="padding-top:20px"><asp:Localize ID="litSearchOrgUnit" runat="server" Text="<%$ Resources: Default, LabelSearchOrgUnit %>" /></td>
                  </tr>
                  <tr>                              
                        <td align="right">
                            <asp:Label ID = "Label1" runat = "server" EnableViewState = "false" Text ="<%$ Resources: AddressResources, City %>" />
                        </td>
                        <td colspan="3">
                           <asp:DropDownList ID = "m_ddlCities" runat = "server" Width="240px"/>        
                            &nbsp; &nbsp;        
                            <asp:Label ID = "Label2" runat = "server" EnableViewState = "false" Text = "<%$ Resources:AddressResources, Zip  %>"  />                            
                            <asp:TextBox ID = "m_txtZipCode" runat = "server" Width="210px"/>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="m_txtZipCode"
                            ValidationExpression="<%$ Resources:AddressResources, ZipValidation %>" Text="<%$ Resources:Default, ValidatorText %>"
                            Display="Dynamic" ErrorMessage="<%$ Resources:AddressResources, ErrorMessageZipCodeisInAnInvalidFormat %>" ToolTip="<%$ Resources:AddressResources, ErrorMessageZipCodeisInAnInvalidFormat %>">
                            </asp:RegularExpressionValidator>
                            &nbsp; &nbsp;                   
                            <asp:Label ID = "Label3" runat = "server" EnableViewState = "false" Text = "<%$ Resources: OrganizationManagement, LabelOrgUnitColon %>" />
                       
                            <asp:TextBox ID = "m_txtOrgUnit" runat = "server" Width= "230px"/>
                            <asp:Button ID="m_btnSearchFulfillmentLocations" runat = "server" CausesValidation="false" EnableViewState="false" Visible="true" OnClick="m_btnSearchOrganizationUnitLocations_Clicked" Text = "<%$ Resources: Default, ButtonSearch %>" CssClass = "pagebuttonClaimWizard" />
                        </td>                                    
                    </tr>               
            </asp:Panel>
            <asp:Panel ID="m_pnlUserDetails" runat="server" Visible="False">                   
                <tr>
                    <td style="padding-top:10px"></td>
                    <td style="padding-top:10px">
                         <asp:Literal ID="litSearchResults" runat="server" />
                     </td>                    
                </tr>    
                <tr>
                    <td align="right">
                        <asp:Literal ID="litOrganizationUnit" runat="server" Text="<%$ Resources: OrganizationManagement, OrganizationUnitLabel %>" />
                        <b><span style="color: #ff0000">*</span></b>
                    </td>               
                    <td colspan="3">                    
                        <asp:ListBox ID="m_lbOrgUnit" runat="server" SelectionMode="Multiple" Rows="10" style="min-width: 100px;" Width="240px">
                        </asp:ListBox>
                        
                          <asp:RequiredFieldValidator ID="rfOrganizationUnit" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                            ErrorMessage="<%$ Resources: OrganizationManagement, ErrorMessageYouMustSelectOrganizationUnit %>" ToolTip="<%$ Resources: ORganizationManagement, ToolTipYouMustSelectOrganizationUnit %>"
                            ControlToValidate="m_lbOrgUnit" ></asp:RequiredFieldValidator>                 
                                             
                          <asp:LinkButton ID = "m_btnClearOrganizationUnitLocations" runat = "server" CausesValidation = "false" EnableViewState = "false" Visible="true" OnClick = "m_btnClearOrganizationUnitLocations_Clicked" Text = "<%$ Resources: Default, LinkButtonClearSearchResults %>" />
                    </td>
                </tr>
                <tr>
                  <td style="padding-bottom:25px">
                  </td>
                  <td colspan="3" style="padding-bottom:25px">
                          <asp:Localize id="litListBoxSelect" runat="server" EnableViewState="false" Text="<%$ Resources: Default, LabelListBoxSelect %>" /><br />
                          <asp:Localize id="litListBoxDeselect" runat="server" EnableViewState="false" Text="<%$ Resources: Default, LabelListBoxDeselect %>" />                    
                  </td>
                </tr>
                <tr>
                    <td align = "right" nowrap>
                        <asp:Literal ID="m_litTitle" runat="server" Text="<%$ Resources: UsersManagement, LabelTitle %>" />
                        <b><span style="color: #ff0000">*</span></b>
                    </td>
                    <td nowrap>
                        <asp:TextBox ID="m_txtTitle" runat="server" Width="230px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="m_rfvTitle" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                            ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageTitleIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipTitleIsRequired %>" ControlToValidate="m_txtTitle"
                            ></asp:RequiredFieldValidator>
                    </td>
                                        <td align = "right" nowrap>
                        <asp:Literal ID="m_litEmail" runat="server" Text="<%$ Resources: UsersMAnagement, LabelUserEmail %>" />
                        <b><span style="color: #ff0000">*</span></b>
                    </td>
                    <td nowrap>
                        <asp:TextBox ID="m_txtEmail" runat="server" Width="230px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="m_rfvEmailAddress" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                            ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageEmailAddressIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipEmailAddressIsRequired %>" 
                            ControlToValidate="m_txtEmail"></asp:RequiredFieldValidator>                        
                        <asp:RegularExpressionValidator ID="m_regExValEmail" runat="server" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                            Display="Dynamic" ControlToValidate="m_txtEmail" Text="<%$ Resources:Default, ValidatorText %>"
                            ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageEmailNotInInvalidFormat %>" ToolTip="<%$ Resources: UsersManagement, ToolTipEmailNotInInvalidFormat %>"
                             />
                    </td>
                </tr>
                <tr>
                    <td align = "right" nowrap>
                        <asp:Literal ID="m_litFirstName" runat="server" Text="<%$ Resources: UsersManagement, LabelUserFirstName %>" />
                        <b><span style="color: #ff0000">*</span></b>
                    </td>
                    <td nowrap>
                        <asp:TextBox ID="m_txtFirstName" runat="server" Width="230px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                            ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageFirstNameIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipFirstNameIsRequired %>" ControlToValidate="m_txtFirstName"
                            ></asp:RequiredFieldValidator>
                    </td>
                    <td align = "right" nowrap>
                        <asp:Literal ID="m_litLastName" runat="server" Text="<%$ Resources: UsersManagement, LabelUserLastName %>" />
                        <b><span style="color: #ff0000">*</span></b>
                    </td>
                    <td nowrap>
                        <asp:TextBox ID="m_txtLastName" runat="server" Width="230px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                            ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageLastNameIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipLastNameIsRequired %>" ControlToValidate="m_txtLastName"
                            ></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td align = "right" nowrap>
                        <asp:Literal ID="m_litWorkPhone" runat="server" Text="<%$ Resources: UsersManagement, LabelWorkPhoneNumber %>" />
                    </td>
                    <td nowrap>
                        <uc1:PhoneNumber ID="m_ucPhoneNumber" runat="server" Required="false" />
                        <asp:Literal ID="m_litExtension" runat="server" Text="<%$ Resources: UsersMAnagement, LabelUserExtColon %>" />
                        <asp:TextBox ID="m_txtWorkPhoneExtension" runat="server" Width="63px"></asp:TextBox>
                    </td>
                    <td align="right"  nowrap="nowrap">
                        <asp:Label ID="TimeZoneLabel" runat="server" Text="<%$ Resources: OrganizationManagement, LabelTimeZoneColon %>" Width="75px" />
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlTimeZone" runat="server" Width="243px"/>
                    </td>


                </tr>
                <tr>
                    <td align = "right" nowrap>
                        <asp:Literal ID="litLogin" runat="server" Text="<%$ Resources: UsersManagement, LabelUserLogin %>" />
                        <b><span style="color: #ff0000">*</span></b>
                    </td>
                    <td nowrap>
                        <asp:TextBox ID="m_txtLogin" runat="server" Width="230px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                            ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageLoginIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipLoginIsRequired %>" ControlToValidate="m_txtLogin"
                            ></asp:RequiredFieldValidator>
                    </td>
                                                            <td align = "right" nowrap>
                        <asp:Literal ID="m_litActive" runat="server" Text="<%$ Resources: Default, LoginStatus %>" />
                    </td>
                    <td nowrap>
                        <%--<asp:CheckBox ID="m_chkActive" runat="server" />--%>
                        <asp:RadioButtonList id="m_rdolistLoginStatus" runat="server" DataTextField="RefName" DataValueField="ID" RepeatDirection="Horizontal" >

                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td align = "right" nowrap>
                        <asp:Literal ID="litPassword" runat="server" Text="<%$ Resources: UsersManagement, LabelUserPassword %>" />
                        <b><span style="color: #ff0000">*</span></b>
                    </td>
                    <td nowrap>
                        <asp:TextBox ID="m_txtPassword" runat="server" Width="230px" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="m_RequiredFieldValidator7" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                            ErrorMessage="<%$ Resources: UsersManagement, ErrorMessagePasswordIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipPasswordIsRequired %>" ControlToValidate="m_txtPassword"
                            ></asp:RequiredFieldValidator>
                        <asp:CustomValidator ID="m_cvPassword" runat="server" ControlToValidate="m_txtPassword"
                            OnServerValidate="cvPassword_ServerValidate" Text="<%$ Resources:Default, ValidatorText %>" />
                    </td>
                                        <td align="right">
                        <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources: Default, LabelSystemAccount%>" />
                         
                    </td>
                        <td>
                            <asp:CheckBox ID="m_chkSystemAccount" runat="server"  Enabled="false" />
                        </td>
                   
                </tr>
                <tr>
                     <td align = "right" nowrap>
                        <asp:Literal ID="litRetypePassword" runat="server" Text="<%$ Resources: UsersManagement, LabelRetypePassword %>" />
                        <b><span style="color: #ff0000">*</span></b>
                    </td>
                    <td nowrap>
                        <asp:TextBox ID="m_txtRetypePassword" runat="server" Width="230px" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="m_RequiredFieldValidator8" runat="server" Text="<%$ Resources:Default, ValidatorText %>"
                            ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageRetypePasswordIsRequired %>" ToolTip="<%$ Resources: UsersManagement, ToolTipRetypePasswordIsRequired %>"
                            ControlToValidate="m_txtRetypePassword" />
                        <asp:CompareValidator ID="m_compValRetypePassword" runat="server" ControlToValidate="m_txtRetypePassword"
                            ControlToCompare="m_txtPassword" Text="<%$ Resources:Default, ValidatorText %>"
                            ErrorMessage="<%$ Resources: UsersManagement, ErrorMessageBothPasswordFieldsMustMatch %>" ToolTip="<%$ Resources: UsersManagement, ToolTipBothPasswordFieldsMustMatch %>" />
                    </td>
                    </tr>
                <tr>

                    <asp:Panel ID="m_pnlRootUser" runat="server">
                        <td align = "right" nowrap>
                            <asp:Literal ID="m_litRootUser" runat="server" Text="<%$ Resources: UsersManagement, LabelRootUser %>" />
                        </td>
                        <td    >
                            <asp:CheckBox ID="m_chkRootUser" runat="server" />
                        </td>
                    </asp:Panel>
                </tr>
                <tr>
                    

                </tr>
            </asp:Panel>
        </table>
    </div>
   <asp:Panel ID="m_pnlButtons" runat="server" Visible="False"> 
    <div style="padding-left: 330px">
        <asp:Button ID="m_btnAdd" runat="server" CssClass="pagebutton" OnClick="m_btnAdd_Click"
            Text="<%$ Resources: Default, ButtonCreate %>" />
        <asp:Button ID="m_btnCancel" runat="server" CssClass="pagebutton" OnClick="m_btnCancel_Click"
            CausesValidation="False" Text="<%$ Resources: Default, ButtonCancel %>" />
    </div>
   </asp:Panel>
    
    <cc1:ExtendedValidationSummary ID="m_extValidationSummaryBottom" runat="server" HeaderText="<%$ Resources: UsersManagement, HeaderMessageFollowingItemsReviewedBeforeCreating %>"
         />
</asp:Content>
