Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            UserCatering userCatering = db.UserCaterings.Find(id);

            db.UserCaterings.Remove(userCatering);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "Id,ExternalLoginConfirmationViewModel,Email,CateringID,Booking2ID,CateringCost,CateringNumberGuest")] UserCatering userCatering)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userCatering).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     // ViewBag.Booking2ID = new SelectList(db.Booking2, "Booking2ID", "OccasionType", userCatering.Booking2ID);
     ViewBag.CateringID = new SelectList(db.Caters, "CateringID", "CateringPackage", userCatering.CateringID);
     return(View(userCatering));
 }
Esempio n. 3
0
 public ActionResult Edit([Bind(Include = "UserCateringID,Email,CateringID,BookingID,CateringCost")] UserCatering userCatering)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userCatering).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BookingID  = new SelectList(db.Bookings, "BookingID", "OccasionType", userCatering.BookingID);
     ViewBag.CateringID = new SelectList(db.Caterings, "CateringID", "CateringPackage", userCatering.CateringID);
     return(View(userCatering));
 }
Esempio n. 4
0
        // GET: UserCaterings/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserCatering userCatering = db.UserCaterings.Find(id);

            if (userCatering == null)
            {
                return(HttpNotFound());
            }
            return(View(userCatering));
        }
Esempio n. 5
0
        public ActionResult Create([Bind(Include = "UserCateringId,BookingStatusId,CateringID,")] UserCatering userCatering)
        {
            if (ModelState.IsValid)
            {
                // userCatering.CateringNumberGuest = userCatering.GetNumbOfGuests();
                // userCatering.CateringCost = userCatering.GetCateringPrice();
                db.UserCaterings.Add(userCatering);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            // ViewBag.Booking2ID = new SelectList(db.Booking2, "Booking2ID", "OccasionType", userCatering.Booking2ID);
            ViewBag.CateringID = new SelectList(db.Caters, "CateringID", "CateringPackage", userCatering.CateringID);
            return(View(userCatering));
        }
Esempio n. 6
0
        // GET: UserCaterings/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserCatering userCatering = db.UserCaterings.Find(id);

            if (userCatering == null)
            {
                return(HttpNotFound());
            }
            //ViewBag.Booking2ID = new SelectList(db.Booking2, "Booking2ID", "OccasionType", userCatering.Booking2ID);
            ViewBag.CateringID = new SelectList(db.Caters, "CateringID", "CateringPackage", userCatering.CateringID);
            return(View(userCatering));
        }
Esempio n. 7
0
 public ActionResult CreateCater(int id, UserCatering userCater, BookingStatus booking, Payments payments)
 {
     if (booking.StageCheck(3, User.Identity.Name))
     {
         TempData["Status"] = "You have already Completed this stage for your active booking.";
         return(RedirectToAction("Catering"));
     }
     // var userDecor = new UserCatering { CateringID = id, BookingStatusId = 1 };//change 1
     userCater.CateringID      = id;
     userCater.BookingStatusId = booking.getBookingStatusId(User.Identity.Name);
     booking.editStage(User.Identity.Name, 3);
     if (payments.PaymentCheck(User.Identity.Name))
     {
         payments.AddPayment(booking.getBookingStatusId(User.Identity.Name));
     }
     db.UserCaterings.Add(userCater);
     db.SaveChanges();
     return(RedirectToAction("Payment"));
 }