Exemplo n.º 1
0
        public ActionResult CarInsurancePurchase(string id)
        {
            if (Session["userId"] == null)
            {
                return(RedirectToAction("Login", "Account"));
            }
            VehicleInsurancePurchaseViewModel vipvm = new VehicleInsurancePurchaseViewModel();

            vipvm.InsuranceId = id;
            return(View(vipvm));
        }
Exemplo n.º 2
0
 public ActionResult CarInsurancePurchase(VehicleInsurancePurchaseViewModel vipvm)
 {
     if (ModelState.IsValid)
     {
         int vehicleId = ORM.DbMethods.CreateCarInsurance(vipvm);
         return(RedirectToAction("AddInsuredDrivers", "Insurance", new { id = vipvm.InsuranceId, vehicle_id = vehicleId }));
     }
     else
     {
         return(View(vipvm));
     }
 }