public ActionResult GetMenuDetailsForUpdate(string menuID, string FCName, string CName, string DName, string SDate, string NoP) { FoodCourtAdminDAL agent = new FoodCourtAdminDAL(); UpdateMenuDetails obj = new UpdateMenuDetails(); obj.MenuItem = new MenuDetails(); obj.MenuID = Convert.ToInt32(menuID); obj.MenuItem.FoodCourtName = FCName; obj.MenuItem.CatererName = CName; obj.MenuItem.DishName = DName; obj.MenuItem.ServingDate = Convert.ToDateTime(SDate); obj.MenuItem.NumberOfPlates =Convert.ToInt32(NoP); List<string> tempList = new List<string>(); tempList = agent.FoodCourts(); tempList.Remove(FCName); ViewBag.list1 = tempList; tempList = agent.Caterers(); tempList.Remove(CName); ViewBag.list2 = tempList; tempList = agent.Dishes(); tempList.Remove(CName); ViewBag.list3 = tempList; return PartialView("_AddMenuPartial", obj); }
public ActionResult GetLists(string option) { int searchType = Convert.ToInt32(option); List<string> collectedList = new List<string>(); FoodCourtAdminDAL agent = new FoodCourtAdminDAL(); switch (searchType) { case 1: collectedList = agent.FoodCourts(); break; case 2: collectedList = agent.Caterers(); break; case 3: collectedList = agent.GetSpecialties(); break; } ViewBag.list = collectedList; ViewBag.option = searchType; return PartialView("_SearchMealPartial"); }
// // GET: /FoodCourtAdmin/AddMenu public ActionResult AddMenu() { //Authentication string type = (string)Session["UserRole"]; if (type == null) { return RedirectToAction("Register", "UserAccount"); } else if (type.CompareTo("F") != 0) { Session["UserID"] = null; Session["UserRole"] = null; return RedirectToAction("Login", "UserAccount"); } FoodCourtAdminDAL agent = new FoodCourtAdminDAL(); ViewBag.list1 = agent.FoodCourts(); ViewBag.list2 = agent.Caterers(); ViewBag.list3 = agent.Dishes(); return View(); }