Пример #1
0
        public ActionResult menuOrder(int id)
        {
            var CaterOrder = new CaterOrderViewModel();

            CaterOrder.Menu_Id = id;
            return(View(CaterOrder));
        }
Пример #2
0
        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));
        }