public void UpdateSQL(FrameBaseFunction.Model.ClsUserInfoMod model, DataTable dt) { ArrayList arrList = new ArrayList(); string sSQL = UpdateUser(model); arrList.Add(sSQL); sSQL = "delete dbo._UserRoleInfo " + "where vchrUserID = '" + model.vchrUid + "' "; arrList.Add(sSQL); for (int i = 0; i < dt.Rows.Count; i++) { FrameBaseFunction.Model.ClsUserRoleMod clsMod = new FrameBaseFunction.Model.ClsUserRoleMod(); if (dt.Rows[i]["bChoosed"].ToString().Trim() == "√") { clsMod.vchrUserID = model.vchrUid; clsMod.vchrRoleID = dt.Rows[i]["vchrRoleID"].ToString().Trim(); string s = AddUserRole(clsMod); arrList.Add(s); } } clsSQL.ExecSqlTran(arrList); }
public FrmUserEdit(Color color, FrameBaseFunction.Model.ClsUserInfoMod clsUserMod) { InitializeComponent(); this.BackColor = color; sState = "edit"; clsMod = clsUserMod; clsMod.vchrPwd = clsDES.Decrypt(clsUserMod.vchrPwd.Trim()); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(FrameBaseFunction.Model.ClsUserInfoMod model, DataTable dt) { //ArrayList arrList = new ArrayList(); AddUserBll(model.vchrUid); AddRoleBll(dt); dal.AddSQL(model, dt); }
private void SetValue(FrameBaseFunction.Model.ClsUserInfoMod clsMod) { this.txtUid.Text = clsMod.vchrUid; this.txtName.Text = clsMod.vchrName; this.txtPwd.Text = clsMod.vchrPwd; this.txtPwdRep.Text = clsMod.vchrPwd; this.dtmCreate.DateTime = clsMod.dtmCreate; this.dtmClose.DateTime = clsMod.dtmClose; this.txtReamrk.Text = clsMod.vchrRemark; }
/// <summary> /// 更新一条数据 /// </summary> private string UpdateUser(FrameBaseFunction.Model.ClsUserInfoMod model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update _UserInfo set "); strSql.Append("vchrPwd='" + clsDES.Encrypt(model.vchrPwd) + "',"); strSql.Append("vchrName='" + model.vchrName + "',"); strSql.Append("vchrRemark='" + model.vchrRemark + "',"); strSql.Append("dtmCreate='" + model.dtmCreate + "',"); strSql.Append("dtmClose='" + model.dtmClose + "'"); strSql.Append(" where vchrUid='" + model.vchrUid + "'"); return(strSql.ToString()); }
/// <summary> /// 增加一条数据 /// </summary> private string AddUser(FrameBaseFunction.Model.ClsUserInfoMod model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into _UserInfo("); strSql.Append("vchrUid,vchrName,vchrPwd,vchrRemark,dtmCreate,dtmClose"); strSql.Append(")"); strSql.Append(" values ("); strSql.Append("'" + model.vchrUid + "',"); strSql.Append("'" + model.vchrName + "',"); strSql.Append("'" + clsDES.Encrypt(model.vchrPwd) + "',"); strSql.Append("'" + model.vchrRemark + "',"); strSql.Append("'" + model.dtmCreate + "',"); strSql.Append("'" + model.dtmClose + "'"); strSql.Append(")"); return(strSql.ToString()); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(FrameBaseFunction.Model.ClsUserInfoMod model, DataTable dt) { dal.UpdateSQL(model, dt); }