public ActionResult menuOrder(int id) { var CaterOrder = new CaterOrderViewModel(); CaterOrder.Menu_Id = id; return(View(CaterOrder)); }
public ActionResult CaterOrder(CaterOrderViewModel model) { if (ModelState.IsValid) { CaterOrder Caterorder = new CaterOrder { Name = model.Name, ContactNo = model.ContactNo, Email = model.Email, Guests = model.Guests, EventDate = model.EventDate, Menu_Id = model.Menu_Id, Status = "1" }; db.CaterOrders.Add(Caterorder); db.SaveChanges(); return(RedirectToAction("Cater", "Home")); } return(View(model)); }