public ActionResult DoResign([Bind(Include = "resignTypeId, staffNr, resignAt,resignChecker,remark")] ResignRecord record) { //用户创建员工离职记录: //• 离职原因(选择,不可空) //• 离职日期(选择,不可空) //• 离职批准人(输入,可空) //• 备注(输入,可空) //如果离职记录创建成功,则将人员在职状态改为:离职 ResultMessage msg = new ResultMessage(); IResignRecordService ss = new ResignRecordService(Settings.Default.db); msg = ss.Create(record); if (msg.Success) { IStaffService staffSi = new StaffService(Settings.Default.db); Staff staff = staffSi.FindByNr(record.staffNr); staff.workStatus = (int)WorkStatus.OffWork; staff.resignAt = record.resignAt; staffSi.Update(staff); } // 创建离职记录##User## try { IMessageRecordService mrs = new MessageRecordService(Settings.Default.db); mrs.CreateStaffResignMessage(record.staffNr, (Session["user"] as User).id); } catch { } return(Json(msg)); }
public ResultMessage Create(ResignRecord model) { ResultMessage msg = new ResultMessage(); try { bool isSucceed = rep.Create(model); msg.Success = isSucceed ? true : false; } catch (Exception ex) { msg.Content = ex.Message; } return(msg); }
public bool Update(ResignRecord model) { return(rep.Update(model)); }