public ActionResult Edit([Bind(Include = "Id,Text1,Text2,Image")] HomeSlide homeSlide, HttpPostedFileBase Image, string fileadi) { if (ModelState.IsValid) { if (Image != null) { if (Extension.CheckImg(Image, Extension.MAxfileSize)) { try { homeSlide.Image = Extension.SaveImg(Image, "~/Public2/images/home"); } catch { return(View(homeSlide)); } } else { return(View(homeSlide)); } } else { homeSlide.Image = fileadi; } db.Entry(homeSlide).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(homeSlide)); }
public ActionResult Edit([Bind(Include = "ID,Text1,Text2,Text3,Text4")] Slide slide, HttpPostedFileBase SlideImg, string fileadi) { if (ModelState.IsValid) { if (SlideImg != null) { if (Extension.CheckImg(SlideImg, Extension.MAxfileSize)) { try { slide.SlideImg = Extension.SaveImg(SlideImg, "~/Public/images/slider"); } catch { return(View(slide)); } } else { return(View(slide)); } } else { slide.SlideImg = fileadi; } db.Entry(slide).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(slide)); }
public ActionResult Edit([Bind(Include = "Id,Images,Car")] Transfer transfer, HttpPostedFileBase Images, string fileadi) { if (ModelState.IsValid) { if (Images != null) { if (Extension.CheckImg(Images, Extension.MAxfileSize)) { try { transfer.Images = Extension.SaveImg(Images, "~/Public2/images/service"); } catch { return(View(transfer)); } } else { return(View(transfer)); } } else { transfer.Images = fileadi; } db.Entry(transfer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(transfer)); }
public ActionResult Edit([Bind(Include = "Id,Image,Fullname,Job,Email,SocialID")] OurTeam ourTeam, HttpPostedFileBase Image, string fileadi) { if (ModelState.IsValid) { if (Image != null) { if (Extension.CheckImg(Image, Extension.MAxfileSize)) { try { ourTeam.Image = Extension.SaveImg(Image, "~/Public2/images/team"); } catch { return(View(ourTeam)); } } else { return(View(ourTeam)); } } else { ourTeam.Image = fileadi; } db.Entry(ourTeam).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SocialID = new SelectList(db.Socials, "Id", "Link1", ourTeam.SocialID); return(View(ourTeam)); }
public ActionResult Edit([Bind(Include = "Id,Header,TextH,TextP")] AboutU aboutU, HttpPostedFileBase Image, string fileadi) { if (ModelState.IsValid) { if (Image != null) { if (Extension.CheckImg(Image, Extension.MAxfileSize)) { try { aboutU.Image = Extension.SaveImg(Image, "~/Public2/images/about"); } catch { return(View(aboutU)); } } else { return(View(aboutU)); } } else { aboutU.Image = fileadi; } db.Entry(aboutU).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aboutU)); }
public ActionResult Edit([Bind(Include = "ID,SortBy")] TourSort tourSort) { if (ModelState.IsValid) { db.Entry(tourSort).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tourSort)); }
public ActionResult Edit([Bind(Include = "ID,Hotel1")] Hotel hotel) { if (ModelState.IsValid) { db.Entry(hotel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hotel)); }
public ActionResult Edit([Bind(Include = "ID,Location,Duration,Min_Age,Max_People,Landing,Check_In,Check_Out")] Additional_Info additional_Info) { if (ModelState.IsValid) { db.Entry(additional_Info).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(additional_Info)); }
public ActionResult Edit([Bind(Include = "ID,Location,Phone,Email,Address,Office")] Contact contact) { if (ModelState.IsValid) { db.Entry(contact).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contact)); }
public ActionResult Edit([Bind(Include = "Id,Names,ServiceID")] Service service) { if (ModelState.IsValid) { db.Entry(service).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ServiceID = new SelectList(db.ServicesHeaders, "Id", "Image", service.ServiceID); return(View(service)); }
public ActionResult Edit([Bind(Include = "ID,TourName,TourDay,HotelStar,Price,Image,Description,Additional_Info_ID,Map_Tour,TourSortID")] TourPacket tourPacket) { if (ModelState.IsValid) { db.Entry(tourPacket).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Additional_Info_ID = new SelectList(db.Additional_Info, "ID", "Location", tourPacket.Additional_Info_ID); ViewBag.TourSortID = new SelectList(db.TourSorts, "ID", "SortBy", tourPacket.TourSortID); return(View(tourPacket)); }