// GET: Shift public ActionResult Index() { WFMDBDataContext db = new WFMDBDataContext(); List <uspWFMGetShiftResult> lstShift = db.uspWFMGetShift(this.TenantID, null).ToList(); return(View(lstShift)); }
protected void GetShiftDDList(string shiftID, bool hasExtraHeader, bool isShowTime) { List <SelectListItem> lstItem = new List <SelectListItem>(); List <uspWFMGetShiftResult> lstShift = new List <uspWFMGetShiftResult>(); if (hasExtraHeader) { lstItem.Insert(0, new SelectListItem { Text = "指定なし", Value = "" }); } using (WFMDBDataContext db = new WFMDBDataContext()) { lstShift = db.uspWFMGetShift(this.TenantID, this.TenantSpecialFlag).ToList(); } foreach (var item in lstShift) { if (!isShowTime) { lstItem.Add(new SelectListItem { Text = item.vShiftName, Value = item.iShiftID.ToString(), Selected = (item.iShiftID.ToString().Equals(shiftID)) }); } else { lstItem.Add(new SelectListItem { Text = item.vShiftName + " (" + item.vStartTime + "~" + item.vEndTime + ")", Value = item.iShiftID.ToString(), Selected = (item.iShiftID.ToString().Equals(shiftID)) }); } } ViewData["lstShift"] = lstItem; }
//private static CodeDescription[] codes = new CodeDescription[] //{ // new CodeDescription("M","Male","Gender"), // new CodeDescription("F","Female","Gender"), // new CodeDescription("S","Single","MaritalStatus"), // new CodeDescription("M","Married","MaritalStatus"), // new CodeDescription("CN","China","Country"), // new CodeDescription("US","Unite States","Country"), // new CodeDescription("UK","Britain","Country"), // new CodeDescription("SG","Singapore","Country") //}; public static Collection<CodeDescription> GetCodes(string category, string vTenantID, string vTenantFlag) { Collection<CodeDescription> codeCollection = new Collection<CodeDescription>(); WFMDBDataContext db = new WFMDBDataContext(); List<uspWFMGetShiftResult> lstShift = db.uspWFMGetShift(vTenantID, vTenantFlag).ToList(); foreach(var item in lstShift) { codeCollection.Add(new CodeDescription(item.iShiftID.ToString(), item.vShiftName, "Shift")); } //foreach(var code in codes.Where(code=>code.Category == category)) //{ // codeCollection.Add(code); //} return codeCollection; }
protected void GetShiftDDList(string shiftID, bool hasExtraHeader, bool isShowTime) { List<SelectListItem> lstItem = new List<SelectListItem>(); List<uspWFMGetShiftResult> lstShift = new List<uspWFMGetShiftResult>(); if (hasExtraHeader) { lstItem.Insert(0, new SelectListItem { Text = "指定なし", Value = "" }); } using (WFMDBDataContext db = new WFMDBDataContext()) { lstShift = db.uspWFMGetShift(this.TenantID, this.TenantSpecialFlag).ToList(); } foreach (var item in lstShift) { if (!isShowTime) lstItem.Add(new SelectListItem { Text = item.vShiftName, Value = item.iShiftID.ToString(), Selected = (item.iShiftID.ToString().Equals(shiftID)) }); else lstItem.Add(new SelectListItem { Text = item.vShiftName + " (" + item.vStartTime + "~" + item.vEndTime + ")", Value = item.iShiftID.ToString(), Selected = (item.iShiftID.ToString().Equals(shiftID)) }); } ViewData["lstShift"] = lstItem; }
// GET: Shift public ActionResult Index() { WFMDBDataContext db = new WFMDBDataContext(); List<uspWFMGetShiftResult> lstShift = db.uspWFMGetShift(this.TenantID, null).ToList(); return View(lstShift); }