예제 #1
0
        // 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());
        }
예제 #2
0
        public ActionResult Edit(int id, GiftsDto gift)
        {
            try
            {
                GiftsLoader.Save(gift);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #3
0
        // 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));
        }
예제 #4
0
        public ActionResult Delete(int id)
        {
            try
            {
                GiftsLoader.Delete(id);
                // TODO: Add delete logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #5
0
        // GET: Gift/Details/5
        public ActionResult Details(int id)
        {
            var Gift = GiftsLoader.GetGift(id);

            return(View(Gift));
        }
예제 #6
0
        // GET: Gift
        public ActionResult Index()
        {
            var gifts = GiftsLoader.GetGifts();

            return(View(gifts));
        }