public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txt_passWord1.Text.Trim().Length == 0) { strErr += "原密码不能为空!\\n"; } if (this.txt_passWord3.Text.Trim().Length == 0) { strErr += "新密码不能为空!\\n"; } if (this.txt_passWord2.Text.Trim().Length == 0) { strErr += "密码不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string passWord1 = MD5Enctypt.MD5.Md5Encrypt(this.txt_passWord1.Text.Trim()); string passWord2 = MD5Enctypt.MD5.Md5Encrypt(this.txt_passWord2.Text.Trim()); string passWord3 = MD5Enctypt.MD5.Md5Encrypt(this.txt_passWord3.Text.Trim()); WalleProject.Model.t_staff model = (Model.t_staff)Session["UserInfo"]; if (passWord1 == model.sta_passWord) { if (passWord2 == passWord3) { model.sta_passWord = passWord2; WalleProject.BLL.t_staff bll = new WalleProject.BLL.t_staff(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "Default.aspx"); } else { strErr += "新密码不匹配!\\n"; MessageBox.Show(this, strErr); return; } } else { strErr += "原密码不正确!\\n"; MessageBox.Show(this, strErr); return; } }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtsta_userName.Text.Trim().Length == 0) { strErr += "用户名不能为空!\\n"; } if (this.txtsta_IDNumber.Text.Trim().Length == 0) { strErr += "身份证号码不能为空!\\n"; } if (this.txtsta_phone.Text.Trim().Length == 0) { strErr += "电话号码不能为空!\\n"; } if (this.txtsta_name.Text.Trim().Length == 0) { strErr += "姓名不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string sta_userName = this.txtsta_userName.Text; string sta_maritalStatus = this.txtsta_maritalStatus.Text; string sta_IDNumber = this.txtsta_IDNumber.Text; string sta_homeAddress = this.txtsta_homeAddress.Text; string sta_phone = this.txtsta_phone.Text; string sta_name = this.txtsta_name.Text; WalleProject.Model.t_staff model = new BLL.t_staff().GetModel(Convert.ToInt32(staffid.InnerText)); model.sta_userName = sta_userName; model.sta_maritalStatus = sta_maritalStatus; model.sta_IDNumber = sta_IDNumber; model.sta_homeAddress = sta_homeAddress; model.sta_phone = sta_phone; model.sta_name = sta_name; WalleProject.BLL.t_staff bll = new WalleProject.BLL.t_staff(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "Default.aspx"); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtEdit_sta_userName.Text.Trim().Length == 0) { strErr += "sta_userName不能为空!\\n"; } if (!PageValidate.IsDateTime(txtEdit_sta_entryDate.Text)) { strErr += "sta_entryDate格式错误!\\n"; } if (this.txtEdit_sta_passWord.Text.Trim().Length == 0) { strErr += "sta_passWord不能为空!\\n"; } if (this.txtEdit_sta_maritalStatus.Text.Trim().Length == 0) { strErr += "sta_maritalStatus不能为空!\\n"; } if (this.txtEdit_sta_IDNumber.Text.Trim().Length == 0) { strErr += "sta_IDNumber不能为空!\\n"; } if (this.txtEdit_sta_homeAddress.Text.Trim().Length == 0) { strErr += "sta_homeAddress不能为空!\\n"; } if (this.txtEdit_sta_phone.Text.Trim().Length == 0) { strErr += "sta_phone不能为空!\\n"; } if (this.txtEdit_sta_name.Text.Trim().Length == 0) { strErr += "sta_name不能为空!\\n"; } if (!PageValidate.IsNumber(txtEdit_sta__pic_id.Text)) { strErr += "sta__pic_id格式错误!\\n"; } if (!PageValidate.IsNumber(txtEdit_sta_tra_id.Text)) { strErr += "sta_tra_id格式错误!\\n"; } if (!PageValidate.IsDateTime(txtEdit_sta_lastLogindate.Text)) { strErr += "sta_lastLogindate格式错误!\\n"; } if (!PageValidate.IsDecimal(txtEdit_sta_salary.Text)) { strErr += "sta_salary格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } long sta_id = long.Parse(this.lblsta_id.Text); string sta_userName = this.txtEdit_sta_userName.Text; DateTime sta_entryDate = DateTime.Parse(this.txtEdit_sta_entryDate.Text); string sta_passWord = this.txtEdit_sta_passWord.Text; string sta_maritalStatus = this.txtEdit_sta_maritalStatus.Text; string sta_IDNumber = this.txtEdit_sta_IDNumber.Text; string sta_homeAddress = this.txtEdit_sta_homeAddress.Text; string sta_phone = this.txtEdit_sta_phone.Text; string sta_name = this.txtEdit_sta_name.Text; int sta__pic_id = int.Parse(this.txtEdit_sta__pic_id.Text); int sta_tra_id = int.Parse(this.txtEdit_sta_tra_id.Text); DateTime sta_lastLogindate = DateTime.Parse(this.txtEdit_sta_lastLogindate.Text); decimal sta_salary = decimal.Parse(this.txtEdit_sta_salary.Text); WalleProject.Model.t_staff model = new WalleProject.Model.t_staff(); model.sta_id = sta_id; model.sta_userName = sta_userName; model.sta_entryDate = sta_entryDate; model.sta_passWord = sta_passWord; model.sta_maritalStatus = sta_maritalStatus; model.sta_IDNumber = sta_IDNumber; model.sta_homeAddress = sta_homeAddress; model.sta_phone = sta_phone; model.sta_name = sta_name; model.sta__pic_id = sta__pic_id; model.sta_tra_id = sta_tra_id; model.sta_lastLogindate = sta_lastLogindate; model.sta_salary = sta_salary; WalleProject.BLL.t_staff bll = new WalleProject.BLL.t_staff(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "StaffManage.aspx"); }