/// <summary> /// 修改员工信息 /// </summary> private void UpdateEmp(int id) { empmodel = new FinanceSys.PersonnelSys.Model.Employee_Model(); empmodel.ID = id; empmodel.EmpName = this.txtName.Text.Trim(); empmodel.Sex = cbxSex.Text; empmodel.EntryTime = DateTime.Parse(dtpEntrytime.Text); empmodel.DepartID = int.Parse(cbxDepart.SelectedValue.ToString()); empmodel.Job = this.txtJob.Text.Trim(); empmodel.Mobile = this.txtMobile.Text.Trim(); empmodel.OfficePhone = this.txtOffice.Text.Trim(); empmodel.Status = cbxState.Text; empmodel.Remark = this.txtRemark.Text.Trim(); if (empbll.Update(empmodel) > 0) { App_Code.Message.InfoMsg("修改成功。"); Log_BLL.Add(DateTime.Now, "员工信息修改", App_Code.Canshu.LoginName, "员工信息修改", Dns.GetHostName().ToUpperInvariant(), Systems.GetOSNameByUserAgent(Environment.OSVersion.ToString()), 3); this.Close(); } else { App_Code.Message.InfoMsg("修改失败。"); } }
/// <summary> /// 双击时传递的参数接收 /// </summary> private void ShowInfo(int id) { empmodel = new FinanceSys.PersonnelSys.Model.Employee_Model(); empmodel = empbll.GetModel(id); this.txtEmpName.Text = empmodel.EmpName; this.txtDepart.Text = departbll.GetModel(empmodel.DepartID).DepartName; this.txtRemark.Text = empmodel.Remark; this.txtSex.Text = empmodel.Sex; }
private void NoLeave(FinanceSys.PersonnelSys.Model.Employee_Model empmodel) { this.txtName.Text = empmodel.EmpName; cbxSex.Text = empmodel.Sex; dtpEntrytime.Text = empmodel.EntryTime.ToString(); cbxDepart.Text = departbll.GetModel(empmodel.DepartID).DepartName; this.txtJob.Text = empmodel.Job; this.txtMobile.Text = empmodel.Mobile; this.txtOffice.Text = empmodel.OfficePhone; cbxState.Text = empmodel.Status; this.txtRemark.Text = empmodel.Remark; }
private void Form_EmployeeAdd_Load(object sender, EventArgs e) { if (id != 0) { ShowInfo(id); } if (id != 0 && state.Equals("离职")) { empmodel = new FinanceSys.PersonnelSys.Model.Employee_Model(); empmodel = empbll.GetModel(id); LeavesTwo(empmodel); } }
/// <summary> /// 双击时传递的参数接收 /// </summary> private void ShowInfo(int id) { empmodel = new FinanceSys.PersonnelSys.Model.Employee_Model(); empmodel = empbll.GetModel(id); switch (empmodel.Status) { case "离职": Leaves(empmodel); break; default: NoLeave(empmodel); break; } }