public ActionResult Rate([Bind(Include = "BookingId,EventId,CustomerId,EventDate,BookingDate,Status,NumberOfPeople,Remarks,Rating")] Booking booking) { if (ModelState.IsValid) { db.Entry(booking).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(booking)); }
public ActionResult Edit([Bind(Include = "Id,Name,Address,Email,Phone,Latitude,Longitude")] Location location) { if (ModelState.IsValid) { db.Entry(location).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(location)); }
public ActionResult Edit([Bind(Include = "Id,Name,Description,Optional_Services,BasePrice")] Event @event, HttpPostedFileBase postedFile) { var myUniqueFileName = string.Format(@"{0}", Guid.NewGuid()); @event.ImagePath = myUniqueFileName; if (ModelState.IsValid) { string serverPath = Server.MapPath("~/Uploads/"); string fileExtension = Path.GetExtension(postedFile.FileName); string filePath = @event.ImagePath + fileExtension; @event.ImagePath = filePath; postedFile.SaveAs(serverPath + @event.ImagePath); db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(@event)); }