// GET: Brunch public ActionResult Index() { List <BrunchViewModel> x = BrunchLoader.GetBrunches(); return(View(x)); }
// GET: Brunch/Details/5 public ActionResult Details(int id) { var brunch = BrunchLoader.GetBrunch(id); ViewBag.Staff = brunch.Staff; ViewBag.Oredrs = brunch.Orders; return(View(brunch)); }
// GET: Orders/Edit/5 public ActionResult Edit(int id) { ViewBag.Staff = StaffLoader.GetAll(); ViewBag.Gifts = GiftsLoader.GetGifts(); ViewBag.Brunches = BrunchLoader.GetBrunches(); ViewBag.Clients = ClientLoader.GetAll(); return(View()); }
// GET: Staff public ActionResult Index() { var list = StaffLoader.GetAll(); foreach (var item in list) { item.Brunch = BrunchLoader.GetInsertedById(item.Brunch_id); item.Position = PositionLoader.GetInsertedById(item.Position_id); } return(View(list)); }
// GET: Orders public ActionResult Index() { var result = OrderLoader.GetOrders(); foreach (var item in result) { item.Client = ClientLoader.GetInsertedById((item.Client_id).GetValueOrDefault()); item.Brunch = BrunchLoader.GetInsertedById((item.Brunch_id).GetValueOrDefault()); item.Staff = StaffLoader.GetInsertedById((item.Staff_id).GetValueOrDefault()); item.Gifts = GiftsLoader.GetInsertedById((item.Gift_id).GetValueOrDefault()); } return(View(result)); }
//Brunch/Delete/5 public ActionResult Delete(int id) { try { // TODO: Add delete logic here BrunchLoader.Delete(id); TempData["SuccessMessage"] = "Deleted Successfully"; return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(BrunchDto brunch) { try { BrunchLoader.Save(brunch); TempData["SuccessMessage"] = "Created Successfully"; // TODO: Add insert logic here return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, BrunchDto brunch) { try { if (id == brunch.Id) { BrunchLoader.Save(brunch); TempData["SuccessMessage"] = "Updated Successfully"; } else { TempData["FailMessage"] = "Updated Failed"; return(View()); } return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: Staff/Edit/5 public ActionResult Edit(int id) { ViewBag.Positions = PositionLoader.GetAll(); ViewBag.Brunches = BrunchLoader.GetBrunches(); return(View()); }
// GET: Staff/Create public ActionResult Create() { ViewBag.Positions = PositionLoader.GetAll(); ViewBag.Brunches = BrunchLoader.GetBrunches(); return(View()); }