// GET: AdminFood
        public ActionResult Index()
        {
            BLLServiceGateway<IEnumerable<Food>> gate = new BLLServiceGateway<IEnumerable<Food>>();
            var food = gate.GetItems("api/Food/");

            return View(food);
        }
示例#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);
 }
 //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);
 }
 //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);
 }
        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");
        }
 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);
 }
示例#11
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 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);
        }