public ActionResult Edit(Booking book, RestourantOrder restourant) { var room = _context.Rooms.Find(book.RoomId); room.Status = false; ViewBag.Rooms = _context.Rooms.OrderBy(r => r.Number).ToList(); ViewBag.Customers = _context.Customers.OrderBy(c => c.Fullname).ToList(); ViewBag.Food = _context.Foods.OrderBy(f => f.Name).ToList(); ViewBag.Users = _context.Users.OrderBy(u => u.FullName).ToList(); return(View(book)); }
public ActionResult Delete(int id) { RestourantOrder rstp = _context.RestourantOrders.Find(id); if (rstp == null) { return(HttpNotFound()); } _context.RestourantOrders.Remove(rstp); _context.SaveChanges(); return(RedirectToAction("index")); }
public ActionResult Edit(int Id) { RestourantOrder res = _context.RestourantOrders.Find(Id); if (res == null) { return(HttpNotFound()); } ViewBag.Room = _context.Rooms.OrderByDescending(r => r.Number).ToList(); ViewBag.Food = _context.Foods.OrderByDescending(r => r.Name).ToList(); return(View(res)); }
public ActionResult Create(RestourantOrder res) { if (ModelState.IsValid) { var food = _context.Foods.Find(res.FoodId); res.FoodTotalPrice = food.Price * res.FoodCount; ViewBag.Menu = _context.Foods.OrderByDescending(r => r.Name).ToList(); res.IsDelete = true; _context.RestourantOrders.Add(res); _context.SaveChanges(); return(RedirectToAction("index")); } return(View(res)); }
public ActionResult Edit(RestourantOrder res) { if (ModelState.IsValid) { var food = _context.Foods.Find(res.FoodId); res.FoodTotalPrice = food.Price * res.FoodCount; _context.Entry(res).State = System.Data.Entity.EntityState.Modified; res.IsDelete = true; _context.SaveChanges(); return(RedirectToAction("index")); } ViewBag.Room = _context.Rooms.OrderByDescending(s => s.Number).ToList(); ViewBag.Menu = _context.Foods.OrderByDescending(s => s.Name).ToList(); return(View(res)); }