public ActionResult AddPackage(Package_Master pm, HttpPostedFileBase postedFile) { if (ModelState.IsValid) { string fileName = System.IO.Path.GetFileName(postedFile.FileName); //Set the Image File Path. string filePath = "~/Uploads/package_img/" + fileName; //Save the Image File in Folder. postedFile.SaveAs(Server.MapPath(filePath)); using (var context = new DestCoveryContext()) { context.Package_mst.Add(pm); context.SaveChanges(); } return(RedirectToAction("PackageDetails", "Admin", new { @packagename = pm.Package_Name })); } else { return(View()); } }
public ActionResult AddPackageImages(Package_Grid_Image pi, HttpPostedFileBase postedFile) { if (Session["AdminID"] == null) { return(RedirectToAction("login", "Admin")); } else { if (ModelState.IsValid) { string fileName = System.IO.Path.GetFileName(postedFile.FileName); //Set the Image File Path. string filePath = "~/Uploads/package_img/" + fileName; //Save the Image File in Folder. postedFile.SaveAs(Server.MapPath(filePath)); using (var context = new DestCoveryContext()) { context.Package_gridimg.Add(pi); context.SaveChanges(); } return(RedirectToAction("PackageDetails", "Admin", new { @packageid = pi.Package_Id, @packagename = TempData["PACKAGENAME"] })); } else { return(View()); } } }
public ActionResult User_Registraion_Form(User_Info dcc, HttpPostedFileBase postedFile) { if (ModelState.IsValid) { string fileName = System.IO.Path.GetFileName(postedFile.FileName); //Set the Image File Path. string filePath = "~/Uploads/user_img/" + fileName; //Save the Image File in Folder. postedFile.SaveAs(Server.MapPath(filePath)); using (var context = new DestCoveryContext()) { context.Users.Add(dcc); context.SaveChanges(); MesageService ms = new MesageService(); string msg = "Welcome Sir/Madam !! Thank you for choosing us. Your Accout is active and you can enjoy your service. DESTCOVERY :)"; ms.TextLocal(dcc.User_Mobile, msg); } ViewBag.LOGINMSG = "Registered Successfully. Please Login"; return(RedirectToAction("login", "Home")); } else { return(View()); } }
public ActionResult AddPackageTour(Package_Tour pt) { if (Session["AdminID"] == null) { return(RedirectToAction("login", "Admin")); } else { if (ModelState.IsValid) { using (var context = new DestCoveryContext()) { context.Package_tor.Add(pt); context.SaveChanges(); return(RedirectToAction("PackageDetails", "Admin", new { @packageid = pt.Package_Id, @packagename = TempData["PACKAGENAME"] })); } } else { return(View()); } } }
public ActionResult User_Registraion_Form(User_Info dcc, HttpPostedFileBase postedFile) { if (ModelState.IsValid) { string fileName = System.IO.Path.GetFileName(postedFile.FileName); //Set the Image File Path. string filePath = "~/Uploads/user_img/" + fileName; //Save the Image File in Folder. postedFile.SaveAs(Server.MapPath(filePath)); using (var context = new DestCoveryContext()) { context.Users.Add(dcc); context.SaveChanges(); } ViewBag.LOGINMSG = "Registered Successfully. Please Login"; return(RedirectToAction("login", "Home")); } else { return(View()); } }
public ActionResult User_Registraion_Form(User_Info dcc, HttpPostedFileBase postedFile) { if (ModelState.IsValid) { string fileName = System.IO.Path.GetFileName(postedFile.FileName); //Set the Image File Path. string filePath = "~/Uploads/" + fileName; //Save the Image File in Folder. postedFile.SaveAs(Server.MapPath(filePath)); using (var context = new DestCoveryContext()) { context.Users.Add(dcc); context.SaveChanges(); } return(View("Thanks", dcc)); } else { return(View()); } }
public ActionResult UpdateAdmin(Admin_Info objadmin) { DestCoveryContext dcc = new DestCoveryContext(); dcc.Admin.Add(objadmin); dcc.SaveChanges(); return(View()); }
public ActionResult Delete(Admin_Info objadmin) { DestCoveryContext dcc = new DestCoveryContext(); var data = dcc.Admin.Find(objadmin.Admin_Id); dcc.Admin.Remove(data); dcc.SaveChanges(); return(View("AdminDetails")); }
public ActionResult BookingCancel(Bookings b, int bookingid) { DestCoveryContext dcc = new DestCoveryContext(); var data = dcc.Booking_pckg.Where(x => x.Booking_Id == bookingid).FirstOrDefault(); if (data != null) { data.Booking_Status = "User Cancelled"; } dcc.SaveChanges(); return(RedirectToAction("Bookings", "Home")); }
public ActionResult Edit(Admin_Info objadmin) { DestCoveryContext dcc = new DestCoveryContext(); var data = dcc.Admin.Find(objadmin.Admin_Id); if (data != null) { data.Admin_Name = objadmin.Admin_Name; data.Admin_Email = objadmin.Admin_Email; data.Admin_Password = objadmin.Admin_Password; data.Admin_Mobile = objadmin.Admin_Mobile; } dcc.SaveChanges(); return(View()); }
public ActionResult AddPackageSpot(Package_Spots ps) { if (ModelState.IsValid) { using (var context = new DestCoveryContext()) { context.Package_spt.Add(ps); context.SaveChanges(); } return(RedirectToAction("AddPackageSpot", "Admin", new { @packagename = ViewBag.PACKAGENAME, @packageid = ViewBag.PACKAGEID })); } else { return(View()); } }
public ActionResult AddPackageSpot(Package_Spots ps) { if (ModelState.IsValid) { using (var context = new DestCoveryContext()) { context.Package_spt.Add(ps); context.SaveChanges(); return(RedirectToAction("PackageDetails", "Admin", new { @packageid = ps.Package_Id, @packagename = TempData["PACKAGENAME"] })); } } else { return(View()); } }
public ActionResult ContactUs(ContactUs cu) { string response = ""; using (var context = new DestCoveryContext()) { context.Contact_Us.Add(cu); context.SaveChanges(); MesageService ms = new MesageService(); string msg = "Welcome Sir/Madam !! Thank you for choosing us.I hope we will give some amazing experience and We will contact you soon. DESTCOVERY :)"; response = ms.TextLocal(cu.person_mobile, msg); } @ViewBag.DISPLAYMSG = "Thank You We will Contact You Soon! "; return(View()); }
public ActionResult change_password(User_Info ui) { if (Session["UserID"] == null) { return(RedirectToAction("login", "Home")); } else { int user__id = Convert.ToInt32(Session["UserID"]); DestCoveryContext dcc = new DestCoveryContext(); var data = dcc.Users.Where(x => x.User_Id == user__id).FirstOrDefault(); if (data != null) { data.User_Password = ui.User_Password; } dcc.SaveChanges(); return(RedirectToAction("user_info", "Home")); } }
public ActionResult BookNow(Bookings dcc) { if (!ModelState.IsValid) { using (var context = new DestCoveryContext()) { context.Booking_pckg.Add(dcc); context.SaveChanges(); } return(RedirectToAction("Bookings", "Home")); } else { return(View()); } }
public ActionResult DeleteSpot(int spotid, int packageid, string packagename) { if (Session["AdminID"] == null) { return(RedirectToAction("login", "Admin")); } else { ViewBag.PACKAGEID = packageid; ViewBag.PACKAGENAME = packagename; using (var dcc = new DestCoveryContext()) { var gridimage = dcc.Package_spt.Where(x => x.Spot_Id == spotid).FirstOrDefault(); dcc.Entry(gridimage).State = System.Data.Entity.EntityState.Deleted; dcc.SaveChanges(); } return(RedirectToAction("PackageDetails", "Admin", new { @packageid = packageid, @packagename = packagename })); } }
public ActionResult UpdatePackageSpot(Package_Spots ps, int packageid, string packagename) { if (Session["AdminID"] == null) { return(RedirectToAction("login", "Admin")); } else { ViewBag.PACKAGEID = packageid; ViewBag.PACKAGENAME = packagename; DestCoveryContext dcc = new DestCoveryContext(); var data = dcc.Package_spt.Find(ps.Spot_Id); if (data != null) { data.Spot_Name = ps.Spot_Name; data.Spot_Description = ps.Spot_Description; } dcc.SaveChanges(); return(RedirectToAction("PackageDetails", "Admin", new { @packageid = packageid, @packagename = packagename })); } }
public ActionResult ConfirmBooking(Bookings b, int bookingid, string user_no) { if (Session["AdminID"] == null) { return(RedirectToAction("login", "Admin")); } else { DestCoveryContext dcc = new DestCoveryContext(); var data = dcc.Booking_pckg.Where(x => x.Booking_Id == bookingid).FirstOrDefault(); if (data != null) { data.Booking_Status = "Confirm"; } dcc.SaveChanges(); MesageService ms = new MesageService(); string msg = "Welcome Sir/Madam !! Thank you for choosing us. I hope we will give some amazing experience throuout this tour. Let us know how it goes. Best wishes for a safe, happy, and healthy journey!! I hope you continue to enjoy our services! DESTCOVERY :) "; ms.TextLocal(user_no, msg); return(RedirectToAction("bookingpending", "Admin")); } }
public ActionResult UpdatePackage(Package_Master pm, int packageid, string packagename) { if (Session["AdminID"] == null) { return(RedirectToAction("login", "Admin")); } else { ViewBag.PACKAGEID = packageid; ViewBag.PACKAGENAME = packagename; DestCoveryContext dcc = new DestCoveryContext(); var data = dcc.Package_mst.Find(pm.Package_Id); if (data != null) { data.Package_Tagline = pm.Package_Tagline; data.Package_Description = pm.Package_Description; data.Package_Price = pm.Package_Price; } dcc.SaveChanges(); return(RedirectToAction("PackageDetails", "Admin", new { @packageid = packageid, @packagename = packagename })); } }
public ActionResult CancelBooking(Bookings b, int bookingid, string user_no) { if (Session["AdminID"] == null) { return(RedirectToAction("login", "Admin")); } else { DestCoveryContext dcc = new DestCoveryContext(); var data = dcc.Booking_pckg.Where(x => x.Booking_Id == bookingid).FirstOrDefault(); if (data != null) { data.Booking_Status = "Admin Cancel"; } dcc.SaveChanges(); MesageService ms = new MesageService(); string msg = "Thank you for choosing us but sorry to inform you unfortunately this Tour / Package is not availble for you. If there’s anything else we can help you with, please let us know. DESTCOVERY :) "; ms.TextLocal(user_no, msg); return(RedirectToAction("bookingpending", "Admin")); } }
public ActionResult AddReview(Package_Review pr) { if (Session["UserID"] == null) { return(RedirectToAction("login", "Home")); } else { if (ModelState.IsValid) { using (var context = new DestCoveryContext()) { context.Package_revws.Add(pr); context.SaveChanges(); } return(RedirectToAction("Bookings", "Home")); } else { return(View()); } } }