public ActionResult Edit() { Manpower_apply _manpower_apply = manpowerapplyRepository.GetByid(Convert.ToInt32(Request.Form["Apply_ID"])); _manpower_apply.Applicant = Request.Form["Applicant"]; //申請人 _manpower_apply.Applicant_phone = Request.Form["Applicant_phone"]; //申請人電話 //_manpower_apply.Work_place = Request.Form["Work_place"]; //值班地點] _manpower_apply.Apply_description = Request.Form["Apply_description"]; //工作項目與流程 _manpower_apply.Application_unit_Supervisor = Request.Form["Application_unit_Supervisor"]; //單位主管 //_manpower_apply.Application_unit_heads = Request.Form["Application_unit_heads"]; //部門主管 _manpower_apply.Application_number = Convert.ToInt32(Request.Form["Application_number"]); //申請人數 _manpower_apply.Remarks = Request.Form["Remarks"]; //備註 var q = from s in dbContext.Stages //申請階段 where s.Stage1 == "新申請" select s.Stage_ID; _manpower_apply.Apply_state = q.ToList().First(); manpowerapplyRepository.Update(_manpower_apply); //呼叫靜態方法 string morning = Request.Cookies["morning"].Value; string afternoon = Request.Cookies["afternoon"].Value; string night = Request.Cookies["night"].Value; string assistance = Request.Cookies["assistance"].Value; int totalPeople = Convert.ToInt32(Request.Cookies["countPeple"].Value); ManpowerDataContext.ModifiedPeriod(Convert.ToInt32(Request.Form["Apply_ID"]), morning, afternoon, night, assistance, totalPeople); return(RedirectToAction("Index")); }
public ActionResult Cancel(int id) { var q = from s in dbContext.Stages where s.Stage1 == "取消申請" && s.Stage_type == "人力申請" select s.Stage_ID; Manpower_apply manpower_apply = manpowerapplyRepository.GetByid(id); manpower_apply.Apply_state = q.ToList().First(); manpowerapplyRepository.Update(manpower_apply); return(RedirectToAction("Index")); }