Esempio n. 1
0
        private void ModifyConfig()
        {
            this.RadlUserGroup.DataSource = UserGroups.GetGroupTable(GroupType.Register);
            this.RadlUserGroup.DataBind();
            SiteConfigInfo info = SiteConfig.ConfigInfo();

            this.RadlEnableUserReg.SelectedValue = this.SelectValue(info.UserConfig.EnableUserReg);
            BasePage.SetSelectedIndexByValue(this.RadlUserGroup, info.UserConfig.GroupId.ToString());
            this.RadlEmailCheckReg.SelectedValue          = this.SelectValue(info.UserConfig.EmailCheckReg);
            this.RadlAdminCheckReg.SelectedValue          = this.SelectValue(info.UserConfig.AdminCheckReg);
            this.RadlEnableMultiRegPerEmail.SelectedValue = this.SelectValue(info.UserConfig.EnableMultiRegPerEmail);
            this.RadlEnableCheckCodeOfReg.SelectedValue   = this.SelectValue(info.UserConfig.EnableCheckCodeOfReg);
            this.RadlEnableQAofReg.SelectedValue          = this.SelectValue(info.UserConfig.EnableQAofReg);
            BasePage.SetSelectedIndexByValue(this.RadlGetPasswordType, info.UserConfig.UserGetPasswordType.ToString());
            this.TxtRegQuestion1.Text         = info.UserConfig.RegQuestion1;
            this.TxtRegAnswer1.Text           = info.UserConfig.RegAnswer1;
            this.TxtRegQuestion2.Text         = info.UserConfig.RegQuestion2;
            this.TxtRegAnswer2.Text           = info.UserConfig.RegAnswer2;
            this.TxtRegQuestion3.Text         = info.UserConfig.RegQuestion3;
            this.TxtRegAnswer3.Text           = info.UserConfig.RegAnswer3;
            this.TxtUserNameLimit.Text        = info.UserConfig.UserNameLimit.ToString();
            this.TxtUserNameMax.Text          = info.UserConfig.UserNameMax.ToString();
            this.TxtUserName_RegDisabled.Text = info.UserConfig.UserNameRegDisabled;
            string regFieldsMustFill   = info.UserConfig.RegFieldsMustFill;
            string regFieldsSelectFill = info.UserConfig.RegFieldsSelectFill;

            this.HdnRegFields_MustFill.Value   = regFieldsMustFill;
            this.HdnRegFields_SelectFill.Value = regFieldsSelectFill;
            List <string> list  = new List <string>();
            List <string> list2 = new List <string>();

            if (!string.IsNullOrEmpty(regFieldsMustFill))
            {
                foreach (string str3 in regFieldsMustFill.Split(new char[] { ',' }))
                {
                    list.Add(str3);
                    if (this.m_RegFields.ContainsKey(str3))
                    {
                        this.LitRegFields_MustFill.Items.Add(this.m_RegFields[str3]);
                    }
                }
            }
            if (!string.IsNullOrEmpty(regFieldsSelectFill))
            {
                foreach (string str4 in regFieldsSelectFill.Split(new char[] { ',' }))
                {
                    list2.Add(str4);
                    if (this.m_RegFields.ContainsKey(str4))
                    {
                        this.LitRegFields_SelectFill.Items.Add(this.m_RegFields[str4]);
                    }
                }
            }
            foreach (string str5 in this.m_RegFields.Keys)
            {
                if (!list.Contains(str5) && !list2.Contains(str5))
                {
                    this.LitRegFields.Items.Add(this.m_RegFields[str5]);
                }
            }
            this.TxtPresentExp.Text                 = info.UserConfig.PresentExp.ToString();
            this.TxtPresentMoney.Text               = info.UserConfig.PresentMoney.ToString();
            this.TxtPresentPoint.Text               = info.UserConfig.PresentPoint.ToString();
            this.TxtPresentValidNum.Text            = info.UserConfig.PresentValidNum.ToString();
            this.DropPresentValidUnit.SelectedValue = info.UserConfig.PresentValidUnit.ToString();
            this.RadlEnableCheckCodeOfLogin.Items[this.SelectIndex(info.UserConfig.EnableCheckCodeOfLogOn)].Selected = true;
            this.RadlEnableMultiLogin.Items[this.SelectIndex(info.UserConfig.EnableMultiLogOn)].Selected             = true;
            this.TxtPresentExpPerLogin.Text       = info.UserConfig.PresentExpPerLogOn.ToString();
            this.TxtMoneyExchangePoint.Text       = info.UserConfig.MoneyExchangePointByMoney.ToString();
            this.TxtMoneyExchangeValidDay.Text    = info.UserConfig.MoneyExchangeValidDayByMoney.ToString();
            this.TxtUserExpExchangePoint.Text     = info.UserConfig.UserExpExchangePointByExp.ToString();
            this.TxtUserExpExchangeValidDay.Text  = info.UserConfig.UserExpExchangeValidDayByExp.ToString();
            this.TxtCMoneyExchangePoint.Text      = info.UserConfig.MoneyExchangePointByPoint.ToString();
            this.TxtCMoneyExchangeValidDay.Text   = info.UserConfig.MoneyExchangeValidDayByValidDay.ToString();
            this.TxtCUserExpExchangePoint.Text    = info.UserConfig.UserExpExchangePointByPoint.ToString();
            this.TxtCUserExpExchangeValidDay.Text = info.UserConfig.UserExpExchangeValidDayByValidDay.ToString();
            this.TxtPointName.Text       = info.UserConfig.PointName;
            this.TxtPointUnit.Text       = info.UserConfig.PointUnit;
            this.TxtEmailOfRegCheck.Text = info.UserConfig.EmailOfRegCheck;
            this.RadlEnableRegCompany.Items[this.SelectIndex(info.UserConfig.EnableRegCompany)].Selected = true;
            if (!info.SiteOption.EnablePointMoneyExp)
            {
                this.PresentExp.Style.Add("display", "none");
                this.PresentMoney.Style.Add("display", "none");
                this.PresentPoint.Style.Add("display", "none");
                this.PresentValidNum.Style.Add("display", "none");
                this.PresentExpPerLogin.Style.Add("display", "none");
                this.MoneyExchangePoint.Style.Add("display", "none");
                this.MoneyExchangeValidDay.Style.Add("display", "none");
                this.UserExpExchangePoint.Style.Add("display", "none");
                this.UserExpExchangeValidDay.Style.Add("display", "none");
                this.PointName.Style.Add("display", "none");
                this.PointUnit.Style.Add("display", "none");
            }
        }