private void DataUpdate() { try { this.dbo = new DB_OPT(); this.dbo.Open(); if (((this.txtbh.Text.Trim() == "") || (this.txtName.Text.Trim() == "")) || ((this.txtssbmpk.Value.Trim() == "") || (this.txtssjspk.Value.Trim() == ""))) { Const.ShowMessage("带*的数据必须填写!", this.Page); } else { string strEditMess = ""; if (!PageDo.IsChanged(ref strEditMess, true, this.Page) && (this.txtxbbak.Text == this.rblsex1.SelectedIndex.ToString())) { Const.ShowMessage("没有修改任何信息,请修改信息后再保存!", this.Page); } else { if (this.txtxbbak.Text != this.rblsex1.SelectedIndex.ToString()) { string str2 = strEditMess; strEditMess = str2 + "性别从 " + this.txtxbbak.Text + " 修改为 " + this.rblsex1.SelectedIndex.ToString(); } string strUser = base.Request.QueryString["PK"].ToString().Trim(); EmployeeModel model = new EmployeeDal { EmployeePK = strUser, BH = this.txtbh.Text.Trim(), Name = this.txtName.Text.Trim(), Sex = this.rblsex1.SelectedItem.Value }; if (this.txtage.Text.Trim() != "") { model.Age = int.Parse(this.txtage.Text.Trim()); } if (this.txtworkage.Text.Trim() != "") { model.WorkAge = int.Parse(this.txtworkage.Text.Trim()); } model.MZ = this.txtmz.Text.Trim(); model.Nationals = this.txtnational.Text.Trim(); model.Province = this.txtprovince.Text.Trim(); model.Area = this.txtarea.Text.Trim(); model.City = this.txtcity.Text.Trim(); model.PostalCode = this.txtpostcode.Text.Trim(); model.Address = this.txtaddress.Text.Trim(); model.Phone = this.txthousetel.Text.Trim(); model.OfficePhone = this.txtofficetel.Text.Trim(); model.Mobile1 = this.txtmobile1.Text.Trim(); model.Mobile2 = this.txtmobile2.Text.Trim(); model.QQNum = this.txtqq.Text.Trim(); model.ICQNum = this.txticq.Text.Trim(); model.MSNNum = this.txtmsn.Text.Trim(); model.Email = this.txtemail.Text.Trim(); if (this.txtBirthDay.Value.Trim() != "") { model.BirthDay = DateTime.Parse(this.txtBirthDay.Value.Trim()); } model.OtherLink = this.txtother.Text.Trim(); model.BranchPK = this.txtssbmpk.Value.Trim(); model.RolePK = this.txtssjspk.Value.Trim(); model.pk_corp = this.txtssgspk.Value.Trim(); if (model.Update(this.dbo) > 0) { UserModel model2 = new UserDal { EmployeePK = strUser }; if (model2.ExistsByEmpPK(this.dbo) > 0) { UserBll bll = new UserBll(); if (bll.Updateuserinfo(strUser, this.txtssbmpk.Value, this.txtssjspk.Value.Trim(), this.txtName.Text, this.txtssgspk.Value.Trim(), this.dbo) <= 0) { Const.DoSuccessClose("修改员工信息成功,但联动修改用户信息失败,请手动修改用户信息!", this.Page); } } Const.DoSuccessClose("修改员工信息成功!", this.Page); strEditMess = "编号为:" + this.txtbh.Text.Trim() + " 名称为:" + this.txtName.Text.Trim() + " 的职员修改信息:" + strEditMess; OperationLogBll.insertOp("修改", "职员列表", strEditMess, "Y", this.Page); } else { Const.ShowMessage("", 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 = "DataUpdate()"; this.el.WriteExceptionLog(true); Const.OpenErrorPage("操作失败,请联系管理员!", this.Page); } finally { if (this.dbo != null) { this.dbo.Close(); } } }