Esempio n. 1
0
        // GET: Brunch
        public ActionResult Index()
        {
            List <BrunchViewModel> x = BrunchLoader.GetBrunches();


            return(View(x));
        }
Esempio n. 2
0
        // 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));
        }
Esempio n. 3
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());
        }
Esempio n. 4
0
        // 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));
        }
Esempio n. 5
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));
        }
Esempio n. 6
0
 //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());
     }
 }
Esempio n. 7
0
        public ActionResult Create(BrunchDto brunch)
        {
            try
            {
                BrunchLoader.Save(brunch);
                TempData["SuccessMessage"] = "Created Successfully";
                // TODO: Add insert logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Esempio n. 8
0
        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());
            }
        }
Esempio n. 9
0
 // GET: Staff/Edit/5
 public ActionResult Edit(int id)
 {
     ViewBag.Positions = PositionLoader.GetAll();
     ViewBag.Brunches  = BrunchLoader.GetBrunches();
     return(View());
 }
Esempio n. 10
0
 // GET: Staff/Create
 public ActionResult Create()
 {
     ViewBag.Positions = PositionLoader.GetAll();
     ViewBag.Brunches  = BrunchLoader.GetBrunches();
     return(View());
 }