public ActionResult ViewWaitInterviewCheck(int PID) { string name = Server.UrlDecode(Request.Cookies["NickName"].Value); T_PersonnelInterviewRecord model = db.T_PersonnelInterviewRecord.FirstOrDefault(a => a.PID == PID && a.State == 0); ViewData["NextInterviewer"] = getApproveName((int)model.Step + 1); return(View(model)); }
} //简历新增 public JsonResult InterviewEditSave(T_PersonnelInterviewRecord model, string NextInterviewer) { using (TransactionScope sc = new TransactionScope()) { try { string name = Server.UrlDecode(Request.Cookies["NickName"].Value); T_PersonnelInterviewRecord editModel = db.T_PersonnelInterviewRecord.Find(model.ID); editModel.State = model.State; editModel.Memo = model.Memo; editModel.Interviewer = name; editModel.Date = DateTime.Now; db.Entry <T_PersonnelInterviewRecord>(editModel).State = System.Data.Entity.EntityState.Modified; T_PersonnelFile perModel = db.T_PersonnelFile.Find(editModel.PID); if (model.State == 1) { if (NextInterviewer != "结束") //进入下一轮面试 { T_PersonnelInterviewRecord newRecord = new T_PersonnelInterviewRecord(); newRecord.Interviewer = NextInterviewer; newRecord.Memo = ""; newRecord.PID = editModel.PID; newRecord.State = 0; newRecord.Step = editModel.Step + 1; db.T_PersonnelInterviewRecord.Add(newRecord); perModel.CurrentInterviewer = NextInterviewer; perModel.InterviewStep = newRecord.Step; perModel.InterviewState = 0; } else //面试通过 { perModel.CurrentInterviewer = ""; perModel.InterviewStep = 99; perModel.InterviewState = 1; //发送短信 //string[] msg = { "恭喜您通过面试" }; //Lib.SendSMS.Send(msg, "15608486578"); } } else //面试不通过 { perModel.CurrentInterviewer = ""; perModel.InterviewStep = 99; perModel.InterviewState = 2; } db.Entry <T_PersonnelFile>(perModel).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); //ModularByZP(); sc.Complete(); return(Json(new { State = "Success" }, JsonRequestBehavior.AllowGet)); } catch (DbEntityValidationException e) { return(Json(new { State = "Faile", Message = e.EntityValidationErrors.First().ValidationErrors.First().ErrorMessage }, JsonRequestBehavior.AllowGet)); } } }
public JsonResult ResumeAddSave(EmploymentRegistration model) { using (TransactionScope sc = new TransactionScope()) { try { T_PersonnelFile PerFile = model.perInfo; PerFile.IsDelete = 0; PerFile.ApplyDate = DateTime.Now; PerFile.Code = ""; PerFile.NickName = ""; PerFile.OnJob = -1; PerFile.online = "电子商务部"; PerFile.InterviewState = -1; PerFile.InterviewStep = 1; PerFile.isZhuanzheng = 0; PerFile.CurrentInterviewer = db.T_PersonnelInterviewConfig.FirstOrDefault(a => a.Step == 1 && a.Type == "面试官").Name; db.T_PersonnelFile.Add(PerFile); db.SaveChanges(); T_PersonnelInterviewRecord InterviewRecord = new T_PersonnelInterviewRecord(); InterviewRecord.Interviewer = PerFile.CurrentInterviewer; InterviewRecord.PID = PerFile.ID; InterviewRecord.State = 0; InterviewRecord.Memo = ""; InterviewRecord.Step = 1; db.T_PersonnelInterviewRecord.Add(InterviewRecord); db.SaveChanges(); foreach (var EduBackgroud in model.EduBackgroud) { if (!string.IsNullOrWhiteSpace(EduBackgroud.School)) { EduBackgroud.PID = PerFile.ID; db.T_PersonnelEduBackgroud.Add(EduBackgroud); } } foreach (var WorkExperience in model.WorkExperience) { if (!string.IsNullOrWhiteSpace(WorkExperience.Job)) { WorkExperience.PID = PerFile.ID; db.T_PersonnelWorkExperience.Add(WorkExperience); } } foreach (var Family in model.Family) { if (!string.IsNullOrWhiteSpace(Family.Name)) { Family.Pid = PerFile.ID; db.T_PersonnelFamily.Add(Family); } } db.SaveChanges(); //ModularByZP(); sc.Complete(); return(Json(new { State = "Success" }, JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(new { State = "Faile", Message = e.Message }, JsonRequestBehavior.AllowGet)); } } } //简历新增