public ActionResult Edit(int id) { WFMDBDataContext db = new WFMDBDataContext(); List<uspWFMGetSingleShiftResult> lstShift = db.uspWFMGetSingleShift(id).ToList(); if (lstShift.Count > 0) { ShiftModel shift = new ShiftModel(); shift.ShiftID = lstShift[0].iShiftID; shift.ShiftName = lstShift[0].vShiftName; shift.StartTime = lstShift[0].vStartTime; shift.EndTime = lstShift[0].vEndTime; return View(shift); } else { return RedirectToAction("Message", "Error", new { Error = "シフト在しません。" }); } }
public ActionResult Edit(int id) { WFMDBDataContext db = new WFMDBDataContext(); List <uspWFMGetSingleShiftResult> lstShift = db.uspWFMGetSingleShift(id).ToList(); if (lstShift.Count > 0) { ShiftModel shift = new ShiftModel(); shift.ShiftID = lstShift[0].iShiftID; shift.ShiftName = lstShift[0].vShiftName; shift.StartTime = lstShift[0].vStartTime; shift.EndTime = lstShift[0].vEndTime; return(View(shift)); } else { return(RedirectToAction("Message", "Error", new { Error = "シフト在しません。" })); } }
// GET: CallPrediction public ActionResult Index(int? currentShiftID) { if (currentShiftID.HasValue) { GetShiftDDList(currentShiftID.Value.ToString(), false, true); WFMDBDataContext db = new WFMDBDataContext(); List<uspWFMGetSingleShiftResult> lstShift = db.uspWFMGetSingleShift(currentShiftID.Value).ToList(); GetAgentListWithShiftNameForOneDay(DateTime.Parse(DateTime.Now.AddDays(1).ToString(AppConst.Const_Format_YMD)), lstShift[0].vShiftName, false, true); } else { GetShiftDDList("-1", false, true); var currentShiftId = int.Parse((ViewData["lstShift"] as List<SelectListItem>)[0].Value); WFMDBDataContext db = new WFMDBDataContext(); List<uspWFMGetSingleShiftResult> lstShift = db.uspWFMGetSingleShift(currentShiftId).ToList(); GetAgentListWithShiftNameForOneDay(DateTime.Parse(DateTime.Now.AddDays(1).ToString(AppConst.Const_Format_YMD)), lstShift[0].vShiftName, false, true); } //GetAgentListWithShiftName("-1", false, true); return View(); }
// GET: CallPrediction public ActionResult Index(int?currentShiftID) { if (currentShiftID.HasValue) { GetShiftDDList(currentShiftID.Value.ToString(), false, true); WFMDBDataContext db = new WFMDBDataContext(); List <uspWFMGetSingleShiftResult> lstShift = db.uspWFMGetSingleShift(currentShiftID.Value).ToList(); GetAgentListWithShiftNameForOneDay(DateTime.Parse(DateTime.Now.AddDays(1).ToString(AppConst.Const_Format_YMD)), lstShift[0].vShiftName, false, true); } else { GetShiftDDList("-1", false, true); var currentShiftId = int.Parse((ViewData["lstShift"] as List <SelectListItem>)[0].Value); WFMDBDataContext db = new WFMDBDataContext(); List <uspWFMGetSingleShiftResult> lstShift = db.uspWFMGetSingleShift(currentShiftId).ToList(); GetAgentListWithShiftNameForOneDay(DateTime.Parse(DateTime.Now.AddDays(1).ToString(AppConst.Const_Format_YMD)), lstShift[0].vShiftName, false, true); } //GetAgentListWithShiftName("-1", false, true); return(View()); }