public ActionResult Index() { if ((string)(Session["User"]) == null || (string)(Session["Department"]) == null) { Session["url"] = "Home"; return(RedirectToAction("Index", "Login")); } ViewData["FormProductType"] = M_Cal.GetProductType(); //Get list of product type radio ViewBag.Productions = this.GetProductions(); var DepartmentGroup = M_Detail.GetDepartmentGroup(); //Get raw group of departments List <DepartmentList> departmentList = new List <DepartmentList>(); foreach (string GroupName in DepartmentGroup) { List <Department> departments = new List <Department>(); departments = M_Detail.GetDepartmentByGroup(GroupName); departmentList.Add(new DepartmentList() { Name = GroupName.Replace(" ", "_"), Department = departments }); //Convert raw group into department list for radio } ViewData["DepartmentList"] = departmentList; return(View()); }
public List <Production> GetProductions() { ViewData["FormProductType"] = M_Cal.GetProductType(); //Get list of product type radio List <Production> Productions = new List <Production>(); for (var i = 1; i <= 7; i++) { if (i == 3) { Productions.Add(new Production { FullName = $"Production 3 Manual", ShortName = $"P3M" }); Productions.Add(new Production { FullName = $"Production 3 Auto", ShortName = $"P3A" }); } else { Productions.Add(new Production { FullName = $"Production {i}", ShortName = $"P{i}" }); } } return(Productions); }
public ActionResult Index() { ViewBag.Departments = GetDepartmentList(); if ((string)(Session["User"]) == null || (string)(Session["Department"]) == null) { Session["url"] = "Home"; return(RedirectToAction("Index", "Login")); } ViewData["FormProductType"] = M_Cal.GetProductType(); //Get list of product type radio ViewBag.Productions = this.GetProductions(); return(View()); }