public ActionResult DeleteConfirmed(int id) { UserCatering userCatering = db.UserCaterings.Find(id); db.UserCaterings.Remove(userCatering); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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)); }
// 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)); }
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)); }
// 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)); }
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")); }