//cab user edit cab office information public ActionResult Edit_Profile_information(int id) { if (Session["cabOfficeuser"] != null) { CabOffice model = db.CabOffices.SingleOrDefault(m => m.Id == id); CabOfficeVM cab = new CabOfficeVM(); cab.Id = model.Id; cab.Status = model.Status; cab.CabofficeOwner = model.CabofficeOwner; cab.CabOfficeName = model.CabOfficeName; cab.DispachSystemName = model.DispachSystemName; cab.CabOfficePhoneNo = model.CabOfficePhoneNo; cab.CabOfficeFax = model.CabOfficeFax; cab.CabOfficeEmail = model.CabOfficeEmail; cab.CabOfficeAddress = model.CabOfficeAddress; cab.CabOfficeCity = model.CabOfficeCity; cab.CabOfficePostCode = model.CabOfficePostCode; cab.CabOfficeBusinessStartDate = model.CabOfficeBusinessStartDate; cab.CabOfficeLicenseNumber = model.CabOfficeLicenseNumber; cab.CabOfficeBusiessType = model.CabOfficeBusiessType; cab.AcceptDiractPayment = model.AcceptDiractPayment; cab.LikeAccount = model.LikeAccount; cab.NumberOfSaloon = model.NumberOfSaloon; cab.NumberOfEstate = model.NumberOfEstate; cab.NumberOfMPV = model.NumberOfMPV; cab.NumberOfOtherVehicle = model.NumberOfOtherVehicle; cab.InvAddress = model.InvAddress; cab.InvCity = model.InvCity; cab.InvPostCode = model.InvPostCode; cab.InvPrincipalContact = model.InvPrincipalContact; cab.InvPhone = model.InvPhone; cab.InvFax = model.InvFax; cab.InvEmail = model.InvEmail; cab.UserFirstName = model.UserFirstName; cab.UserLastName = model.UserLastName; cab.UserMobile = model.UserMobile; cab.UserEmail = model.UserEmail; cab.UserPassword = model.UserPassword; cab.confirmPassword = model.UserPassword; cab.RefBusinessName = model.RefBusinessName; cab.RefBusinessAddress = model.RefBusinessAddress; cab.RefBusinessCity = model.RefBusinessCity; cab.RefBusinessPostCode = model.RefBusinessPostCode; cab.RefBusinessPhone = model.RefBusinessPhone; cab.RefBusinessFax = model.RefBusinessFax; cab.RefBusinessEmail = model.RefBusinessEmail; return View(cab); } return RedirectToAction("Login", "Drivers"); }
public ActionResult Loged(string cabEmail, string cabPassword) { if (Session["cabOfficeuser"] == null) { if (!ModelState.IsValid) { return HttpNotFound(); } else { //var p = db.CabOffices.Where(a => a.UserEmail == cabEmail && a.UserPassword == cabPassword).SingleOrDefault(); var p = db.CabOffices.Where(a => a.UserEmail.Equals(cabEmail) && a.UserPassword.Equals(cabPassword)).FirstOrDefault(); if (p != null) { CabOffice cb = db.CabOffices.Where(m => m.Id == p.Id).SingleOrDefault(); if (cb.Status == "Approved") { Session["cabuser"] = p.UserFirstName; Session["cabuserLastName"] = p.UserLastName; Session["cabOfficeuser"] = "******"; Session["cabOfficeId"] = cb.Id; //ID = cb.Id; return RedirectToAction("CabOfficeProfile", "CabOffice", new { id = cb.Id }); } if (cb.Status == "Rejected") { return RedirectToAction("Rejected", "CabOffice"); } else { return RedirectToAction("submit", "CabOffice"); } } else { TempData["DErrormsg"] = "invalid your Email or Password"; return RedirectToAction("Login", "Drivers"); } } } return RedirectToAction("Login", "Drivers"); }
public ActionResult CabOfficeDetail(CabOffice model , string status, string businessType) { if (Session["adminLog"] != null) { if (ModelState.IsValid) { CabOffice cab = new CabOffice(); cab.Id = model.Id; cab.Status = status; cab.CabofficeOwner = model.CabofficeOwner; cab.CabOfficeName = model.CabOfficeName; cab.DispachSystemName = model.DispachSystemName; cab.CabOfficePhoneNo = model.CabOfficePhoneNo; cab.CabOfficeFax = model.CabOfficeFax; cab.CabOfficeEmail = model.CabOfficeEmail; cab.CabOfficeAddress = model.CabOfficeAddress; cab.CabOfficeCity = model.CabOfficeCity; cab.CabOfficePostCode = model.CabOfficePostCode; cab.CabOfficeBusinessStartDate = model.CabOfficeBusinessStartDate; cab.CabOfficeLicenseNumber = model.CabOfficeLicenseNumber; cab.CabOfficeBusiessType = businessType; cab.AcceptDiractPayment = model.AcceptDiractPayment; cab.LikeAccount = model.LikeAccount; cab.NumberOfSaloon = model.NumberOfSaloon; cab.NumberOfEstate = model.NumberOfEstate; cab.NumberOfMPV = model.NumberOfMPV; cab.NumberOfOtherVehicle = model.NumberOfOtherVehicle; cab.InvAddress = model.InvAddress; cab.InvCity = model.InvCity; cab.InvPostCode = model.InvPostCode; cab.InvPrincipalContact = model.InvPrincipalContact; cab.InvPhone = model.InvPhone; cab.InvFax = model.InvFax; cab.InvEmail = model.InvEmail; cab.UserFirstName = model.UserFirstName; cab.UserLastName = model.UserLastName; cab.UserMobile = model.UserMobile; cab.UserEmail = model.UserEmail; cab.UserPassword = model.UserPassword; cab.RefBusinessName = model.RefBusinessName; cab.RefBusinessAddress = model.RefBusinessAddress; cab.RefBusinessCity = model.RefBusinessCity; cab.RefBusinessPostCode = model.RefBusinessPostCode; cab.RefBusinessPhone = model.RefBusinessPhone; cab.RefBusinessFax = model.RefBusinessFax; cab.RefBusinessEmail = model.RefBusinessEmail; db.Entry(cab).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("AllCabOffices", "CabOffice"); } else { return View(); } } return RedirectToAction("login", "Admin"); }
public ActionResult CabOfficeReg(CabOfficeVM model, string businessType) { CabOffice cab = new CabOffice(); if (ModelState.IsValid) { cab.CabOfficeBusiessType = businessType; cab.Status = "Waiting"; cab.Id = model.Id; cab.CabofficeOwner = model.CabofficeOwner; cab.CabOfficeName = model.CabOfficeName; cab.DispachSystemName = model.DispachSystemName; cab.CabOfficePhoneNo = model.CabOfficePhoneNo; cab.CabOfficeFax = model.CabOfficeFax; cab.CabOfficeEmail = model.CabOfficeEmail; cab.CabOfficeAddress = model.CabOfficeAddress; cab.CabOfficeCity = model.CabOfficeCity; cab.CabOfficePostCode = model.CabOfficePostCode; cab.CabOfficeBusinessStartDate = model.CabOfficeBusinessStartDate; cab.CabOfficeLicenseNumber = model.CabOfficeLicenseNumber; cab.CabOfficeBusiessType = businessType; cab.AcceptDiractPayment = model.AcceptDiractPayment; cab.LikeAccount = model.LikeAccount; cab.NumberOfSaloon = model.NumberOfSaloon; cab.NumberOfEstate = model.NumberOfEstate; cab.NumberOfMPV = model.NumberOfMPV; cab.NumberOfOtherVehicle = model.NumberOfOtherVehicle; cab.InvAddress = model.InvAddress; cab.InvCity = model.InvCity; cab.InvPostCode = model.InvPostCode; cab.InvPrincipalContact = model.InvPrincipalContact; cab.InvPhone = model.InvPhone; cab.InvFax = model.InvFax; cab.InvEmail = model.InvEmail; cab.UserFirstName = model.UserFirstName; cab.UserLastName = model.UserLastName; cab.UserMobile = model.UserMobile; cab.UserEmail = model.UserEmail; cab.UserPassword = model.UserPassword; cab.RefBusinessName = model.RefBusinessName; cab.RefBusinessAddress = model.RefBusinessAddress; cab.RefBusinessCity = model.RefBusinessCity; cab.RefBusinessPostCode = model.RefBusinessPostCode; cab.RefBusinessPhone = model.RefBusinessPhone; cab.RefBusinessFax = model.RefBusinessFax; cab.RefBusinessEmail = model.RefBusinessEmail; db.CabOffices.Add(cab); db.SaveChanges(); return RedirectToAction("submit", "CabOffice"); } return View(model); }