Ejemplo n.º 1
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     this.ChkAdminLevel(nameof(user_config), DTEnums.ActionEnum.Edit.ToString());
     Rain.BLL.userconfig   userconfig = new Rain.BLL.userconfig();
     Rain.Model.userconfig model      = userconfig.loadConfig();
     try
     {
         model.regstatus         = Utils.StrToInt(this.regstatus.SelectedValue, 0);
         model.regmsgstatus      = Utils.StrToInt(this.regmsgstatus.SelectedValue, 0);
         model.regmsgtxt         = this.regmsgtxt.Text;
         model.regkeywords       = this.regkeywords.Text.Trim();
         model.regctrl           = Utils.StrToInt(this.regctrl.Text.Trim(), 0);
         model.regsmsexpired     = Utils.StrToInt(this.regsmsexpired.Text.Trim(), 0);
         model.regemailexpired   = Utils.StrToInt(this.regemailexpired.Text.Trim(), 0);
         model.regverify         = !this.regverify.Checked ? 0 : 1;
         model.mobilelogin       = !this.mobilelogin.Checked ? 0 : 1;
         model.emaillogin        = !this.emaillogin.Checked ? 0 : 1;
         model.regrules          = !this.regrules.Checked ? 0 : 1;
         model.regrulestxt       = this.regrulestxt.Text;
         model.invitecodeexpired = Utils.StrToInt(this.invitecodeexpired.Text.Trim(), 1);
         model.invitecodecount   = Utils.StrToInt(this.invitecodecount.Text.Trim(), 0);
         model.invitecodenum     = Utils.StrToInt(this.invitecodenum.Text.Trim(), 0);
         model.pointcashrate     = Utils.StrToDecimal(this.pointcashrate.Text.Trim(), new Decimal(0));
         model.pointinvitenum    = Utils.StrToInt(this.pointinvitenum.Text.Trim(), 0);
         model.pointloginnum     = Utils.StrToInt(this.pointloginnum.Text.Trim(), 0);
         userconfig.saveConifg(model);
         this.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改用户配置信息");
         this.JscriptMsg("修改用户配置成功!", "user_config.aspx");
     }
     catch
     {
         this.JscriptMsg("文件写入失败,请检查是否有权限!", string.Empty);
     }
 }
Ejemplo n.º 2
0
 public Rain.Model.userconfig loadConfig()
 {
     Rain.Model.userconfig userconfig = CacheHelper.Get <Rain.Model.userconfig>("dt_cache_user_config");
     if (userconfig == null)
     {
         CacheHelper.Insert("dt_cache_user_config", (object)this.dal.loadConfig(Utils.GetXmlMapPath("Userpath")), Utils.GetXmlMapPath("Userpath"));
         userconfig = CacheHelper.Get <Rain.Model.userconfig>("dt_cache_user_config");
     }
     return(userconfig);
 }
Ejemplo n.º 3
0
 public Rain.Model.userconfig saveConifg(Rain.Model.userconfig model, string configFilePath)
 {
     lock (userconfig.lockHelper)
         SerializationHelper.Save((object)model, configFilePath);
     return(model);
 }
Ejemplo n.º 4
0
 public Rain.Model.userconfig saveConifg(Rain.Model.userconfig model)
 {
     return(this.dal.saveConifg(model, Utils.GetXmlMapPath("Userpath")));
 }