// 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()); }
public ActionResult Edit(int id, GiftsDto gift) { try { GiftsLoader.Save(gift); return(RedirectToAction("Index")); } catch { return(View()); } }
// 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)); }
public ActionResult Delete(int id) { try { GiftsLoader.Delete(id); // TODO: Add delete logic here return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: Gift/Details/5 public ActionResult Details(int id) { var Gift = GiftsLoader.GetGift(id); return(View(Gift)); }
// GET: Gift public ActionResult Index() { var gifts = GiftsLoader.GetGifts(); return(View(gifts)); }