public ActionResult Delete(int id)
        {
            BLLServiceGateway<Food> gate = new BLLServiceGateway<Food>();

            gate.DeleteItems("api/Food/" + id + "");
            return RedirectToAction("Index");
        }
示例#2
0
        public ActionResult Index()
        {
            BLLServiceGateway<IEnumerable<HomePic>> gate = new BLLServiceGateway<IEnumerable<HomePic>>();
            var homepics = gate.GetItems("api/HomePic/");

            return View(homepics);
        }
 public ActionResult Create()
 {
     BLLServiceGateway<IEnumerable<Category>> gate = new BLLServiceGateway<IEnumerable<Category>>();
     var cats = gate.GetItems("api/Category/");
     ViewBag.CategaryId = new SelectList(cats, "Id", "Name");
       return View();
 }
        // GET: AdminBooking
        public ActionResult Index()
        {
            BLLServiceGateway<IEnumerable<Booking>> gate = new BLLServiceGateway<IEnumerable<Booking>>();
            var booking = gate.GetItems("api/Booking/").Where(model => model.BookingTime.Date == DateTime.Today);

            return View(booking);
        }
 public ActionResult Edit(int id)
 {
     BLLServiceGateway<HomePic> gate = new BLLServiceGateway<HomePic>();
       //  HomepicViewModel hvm = new HomepicViewModel();
     HomePic hc = gate.GetItems("api/HomePic/" + id + "");
     return View("Edit", hc);
 }
 public ActionResult Index(Booking booking)
 {
     BLLServiceGateway<Booking> gate = new BLLServiceGateway<Booking>();
     booking.Nowday = DateTime.Now;
     gate.PostItems("api/Booking/", booking);
     return RedirectToAction("Index");
 }
        // GET: AdminFood
        public ActionResult Index()
        {
            BLLServiceGateway<IEnumerable<Food>> gate = new BLLServiceGateway<IEnumerable<Food>>();
            var food = gate.GetItems("api/Food/");

            return View(food);
        }
 //Chinese Buffet
 public ActionResult AdminChineseBuffet()
 {
     BLLServiceGateway<IEnumerable<Menu>> gate = new BLLServiceGateway<IEnumerable<Menu>>();
     int Typeid = 1;//Buffet
     int CategoryId = 1;//Chinese
     var menus = gate.GetItems("api/Menu/").Where(item => item.MenuTypeId == Typeid).Where(item => item.food.CategaryId == CategoryId);
     return View(menus);
 }
 //takeaway Sushi
 public ActionResult AdminSushiTake()
 {
     BLLServiceGateway<IEnumerable<Menu>> gate = new BLLServiceGateway<IEnumerable<Menu>>();
     int Typeid = 2;//Take away
     int CategoryId = 2;//Sushi
     var menus = gate.GetItems("api/Menu/").Where(item => item.MenuTypeId == Typeid).Where(item => item.food.CategaryId == CategoryId);
     return View(menus);
 }
 public ActionResult Edit(Food food)
 {
     BLLServiceGateway<IEnumerable<Category>> Categate = new BLLServiceGateway<IEnumerable<Category>>();
     var cats = Categate.GetItems("api/Category/");
     BLLServiceGateway<Food> gate = new BLLServiceGateway<Food>();
     gate.PutItems("api/Food/" + food.Id, food);
     ViewBag.CategaryId = new SelectList(cats, "Id", "Name");
     return RedirectToAction("Index");
 }
 public ActionResult Edit(int id)
 {
     BLLServiceGateway<Food> gate = new BLLServiceGateway<Food>();
     Food food = gate.GetItems("api/Food/" + id + "");
     BLLServiceGateway<IEnumerable<Category>> Categate = new BLLServiceGateway<IEnumerable<Category>>();
     var cats = Categate.GetItems("api/Category/");
     ViewBag.CategaryId = new SelectList(cats, "Id", "Name");
     return View("Edit", food);
 }
        public ActionResult CreateChineseTake()
        {
            BLLServiceGateway<IEnumerable<Food>> Foodgate = new BLLServiceGateway<IEnumerable<Food>>();
            var food = Foodgate.GetItems("api/Food/").Where(item => item.CategaryId == 1);
            //  ViewBag.TypeId = new SelectList(type, "Id", "Name");
            ViewBag.FoodId = new SelectList(food, "Id", "Name");

            return View("CreateChineseTake");
        }
示例#13
0
 public ActionResult SushiBuffet()
 {
     BLLServiceGateway<IEnumerable<Menu>> gate = new BLLServiceGateway<IEnumerable<Menu>>();
     int Typeid = 1;
     int CategoryId = 2;
     //"api/Menu?Typeid=" + Typeid + "&CategoryId=" + CategoryId + ""
     var menus = gate.GetItems("api/Menu/").Where(item => item.MenuTypeId == Typeid).Where(item => item.food.CategaryId == CategoryId);
     return View(menus);
 }
        public ActionResult CreateChineseBuffet(Menu m)
        {
            m.MenuTypeId = 1;

            BLLServiceGateway<Menu> gate = new BLLServiceGateway<Menu>();

            gate.PostItems("api/Menu/", m);

            return RedirectToAction("AdminChineseBuffet");
        }
        public ActionResult Create(Food food)
        {
            BLLServiceGateway<IEnumerable<Category>> Categate = new BLLServiceGateway<IEnumerable<Category>>();
            var cats = Categate.GetItems("api/Category/");
            BLLServiceGateway<Food> gate = new BLLServiceGateway<Food>();
            ViewBag.CategaryId = new SelectList(cats, "id", "Name", food.CategaryId);

                gate.PostItems("api/Food/", food);
                return RedirectToAction("Index");

              // return View(food);
        }
 public ActionResult Edit(HomePic hc)
 {
     BLLServiceGateway<HomePic> gate = new BLLServiceGateway<HomePic>();
     gate.PutItems("api/HomePic/" + hc.Id, hc);
     return RedirectToAction("Index");
 }
 public ActionResult DeleteSushiTake(int id)
 {
     BLLServiceGateway<Menu> gate = new BLLServiceGateway<Menu>();
     gate.DeleteItems("api/Menu/" + id + "");
     return RedirectToAction("AdminSushiTake");
 }
 public ActionResult DeleteChineseBuffet(int id)
 {
     BLLServiceGateway<Menu> gate = new BLLServiceGateway<Menu>();
     gate.DeleteItems("api/Menu/" + id + "");
     return RedirectToAction("AdminChineseBuffet");
 }
        public ActionResult CreateSushiTake(Menu m)
        {
            m.MenuTypeId = 2;

            BLLServiceGateway<Menu> gate = new BLLServiceGateway<Menu>();

            gate.PostItems("api/Menu/", m);

            return RedirectToAction("AdminSushiTake");
        }
 public ActionResult Create(HomePic hc)
 {
     BLLServiceGateway<HomePic> gate = new BLLServiceGateway<HomePic>();
     gate.PostItems("api/HomePic/", hc);
     return RedirectToAction("Index");
 }