예제 #1
0
 public int Updateuserinfo(string strUser, string power, string strname, string pk_corp)
 {
     int num;
     UserModel model = new UserDal();
     DB_OPT dbo = new DB_OPT();
     try
     {
         dbo.Open();
         model.EmployeePK = strUser;
         model.UserName = strname;
         model.Power = power;
         model.pk_corp = pk_corp;
         num = model.Update(UserUpdatePowerType.BranchAndRole, UserUpdateIndex.AllowEmployeePK, dbo);
     }
     catch (Exception exception)
     {
         throw exception;
     }
     finally
     {
         dbo.Close();
     }
     return num;
 }
예제 #2
0
 public int Updateuserinfo(string strUser, string bmpk, string rolepk, string strname, string pk_corp, DB_OPT opt)
 {
     int num;
     UserModel model = new UserDal();
     try
     {
         model.EmployeePK = strUser;
         model.UserName = strname;
         model.BranchPK = bmpk;
         model.RolePK = rolepk;
         model.pk_corp = pk_corp;
         num = model.Update(UserUpdatePowerType.BranchAndRole, UserUpdateIndex.AllowEmployeePK, opt);
     }
     catch (Exception exception)
     {
         throw exception;
     }
     return num;
 }
예제 #3
0
 private void UpdateUser()
 {
     try
     {
         this.dbo = new DB_OPT();
         this.dbo.Open();
         if (((this.txtUserName.Text.Trim() == "") || (this.txtssbmpk.Value.Trim() == "")) || ((this.txtssgspk.Value.Trim() == "") || (this.txtssjspk.Value.Trim() == "")))
         {
             Const.ShowMessage("带*的数据必须填写!", this.Page);
         }
         else
         {
             string strEditMess = "";
             string powerText = this.PowerMenu1.GetPowerText();
             string cz = this.PowerCompany1.GetPowerText();
             string str4 = this.PowerRow1.GetPowerText();
             if ((!PageDo.IsChanged(ref strEditMess, true, this.Page) && (this.txtmenubak.Value == powerText)) && ((this.txtcombak.Value == cz) && (this.txtrowbak.Value == str4)))
             {
                 Const.ShowMessage("没有修改任何信息,请修改信息后再保存!", this.Page);
             }
             else
             {
                 if (this.txtmenubak.Value != powerText)
                 {
                     string str5 = PowerClass.SubTwoPower(this.txtmenubak.Value, powerText, "|");
                     string str6 = PowerClass.SubTwoPower(powerText, this.txtmenubak.Value, "|");
                     string str7 = strEditMess;
                     strEditMess = str7 + "菜单权限去掉了 " + str5 + " 增加了 " + str6;
                 }
                 if (this.txtcombak.Value != cz)
                 {
                     string str8 = Public.DelRelTxt(this.txtcombak.Value, cz, '|');
                     string str9 = Public.DelRelTxt(cz, this.txtcombak.Value, '|');
                     string str10 = strEditMess;
                     strEditMess = str10 + "管理范围去掉了 " + str8 + " 增加了 " + str9;
                 }
                 if (this.txtrowbak.Value != str4)
                 {
                     string str11 = Public.DelRelTxt(this.txtrowbak.Value, str4, '|');
                     string str12 = Public.DelRelTxt(str4, this.txtrowbak.Value, '|');
                     string str13 = strEditMess;
                     strEditMess = str13 + "数据行权限去掉了 " + str11 + " 增加了 " + str12;
                 }
                 UserModel model = new UserDal
                 {
                     UserPK = base.Request.QueryString["PK"].ToString().Trim()
                 };
                 model.GetModel(this.dbo);
                 string str14 = PowerClass.SubTwoPower(this.PowerMenu1.GetPower(), this.txtrolepower.Value, "|");
                 model.Power = str14;
                 string str15 = PowerClass.SubTwoPower(this.PowerCompany1.GetPower(), this.txtcompower.Value, "|");
                 model.CompanyPower = str15;
                 model.UserName = this.txtUserName.Text.Trim();
                 model.TrueName = this.txtTrueName.Text.Trim();
                 model.BranchPK = this.txtssbmpk.Value.Trim();
                 model.RolePK = this.txtssjspk.Value.Trim();
                 if (this.txtPwd.Text.Trim() != "")
                 {
                     model.Password = QxRoom.QxConst.QxConst.Encrypt(this.txtPwd.Text.Trim(), "powerich").Trim();
                 }
                 model.pk_corp = this.txtssgspk.Value.Trim();
                 Const.UpdateSuccess(model.Update(UserUpdatePowerType.All, UserUpdateIndex.AllowUserPK, this.dbo), this.Page);
                 strEditMess = "用户名为:" + this.txtUserName.Text.Trim() + " 真实姓名为:" + this.txtTrueName.Text.Trim() + " 的用户修改信息:" + strEditMess;
                 OperationLogBll.insertOp("修改", "用户列表", strEditMess, "Y", this.Page);
             }
         }
     }
     catch (Exception exception)
     {
         this.el = new ExceptionLog.ExceptionLog();
         this.el.ErrClassName = base.GetType().ToString();
         this.el.ErrMessage = exception.Message.ToString();
         this.el.ErrMethod = "UpdateUser()";
         this.el.WriteExceptionLog(true);
         Const.OpenErrorPage("操作失败,请联系管理员!", this.Page);
     }
     finally
     {
         if (this.dbo != null)
         {
             this.dbo.Close();
         }
     }
 }