コード例 #1
0
        private void BindDomain()
        {
            DataSet dsDomains = DataManagerDevice.ProviderDevice.ApplicationSettings.ProvideDomainNames();

            if (dsDomains.Tables[0].Rows.Count > 0)
            {
                //TextBoxUserId.Enabled = true;
                //TextBoxUserPassword.Enabled = true;
                //DropDownListDomainList.Visible = true;
                //LabelNoDomains.Visible = false;
                //LinkButtonLogOn.Enabled = true;

                DropDownListDomainList.DataSource     = dsDomains;
                DropDownListDomainList.DataTextField  = "AD_DOMAIN_NAME";
                DropDownListDomainList.DataValueField = "AD_DOMAIN_NAME";
                DropDownListDomainList.DataBind();
                DropDownListDomainList.SelectedValue = domainName;
            }
            else
            {
                //TextBoxUserId.Enabled = false;
                //TextBoxUserPassword.Enabled = false;
                //LinkButtonLogOn.Enabled = false;
                //DropDownListDomainList.Visible = false;
                //LabelNoDomains.Visible = true;
                //LabelNoDomains.Text = "Domains are not configured";
            }
        }
コード例 #2
0
        /// <summary>
        /// Builds the UI.
        /// </summary>
        /// <remarks>
        /// Sequence Diagram:<br/>
        ///     <img src="SequenceDiagrams/SD_PrintReleaseDevice.Mfp.ManualLogOn.BuildUI.jpg"/>
        /// </remarks>
        private void BuildUI()
        {
            TextBoxUserPassword.Attributes.Add("istyle", "10");
            allowedRetiresForLogin = int.Parse(DataManagerDevice.ProviderDevice.ApplicationSettings.ProvideSetting("Allowed retries for user login"), CultureInfo.CurrentCulture);
            string hostAddress = Request.ServerVariables["HTTP_HOST"];

            TextBoxPrintReleaseServer.Text = hostAddress;

            if (userSource == Constants.USER_SOURCE_DB)
            {
                TableRowDomain.Visible = false;
            }
            else
            {
                // Get the Domains List from Database and Bind it to Drop Down List
                DataSet dsDomains = DataManagerDevice.ProviderDevice.ApplicationSettings.ProvideDomainNames();
                if (dsDomains.Tables[0].Rows.Count > 0)
                {
                    TextBoxUserId.Enabled          = true;
                    TextBoxUserPassword.Enabled    = true;
                    DropDownListDomainList.Visible = true;
                    LabelNoDomains.Visible         = false;
                    LinkButtonLogOn.Enabled        = true;

                    DropDownListDomainList.DataSource     = dsDomains;
                    DropDownListDomainList.DataTextField  = "AD_DOMAIN_NAME";
                    DropDownListDomainList.DataValueField = "AD_DOMAIN_NAME";
                    DropDownListDomainList.DataBind();

                    DropDownListDomainList.SelectedValue = domainName;
                }
                else
                {
                    TextBoxUserId.Enabled          = false;
                    TextBoxUserPassword.Enabled    = false;
                    LinkButtonLogOn.Enabled        = false;
                    DropDownListDomainList.Visible = false;
                    LabelNoDomains.Visible         = true;
                    LabelNoDomains.Text            = "Domains are not configured";
                }
                TableRowDomain.Visible = true;

                /// Commented because, Text box is not used now
                //TextBoxDomain.Text = domainName;
                //string lockDomainField = Session["LockDomainField"] as string;
                //if (lockDomainField == "True")
                //{
                //    TextBoxDomain.ReadOnly = true;
                //}
            }
        }