public ActionResult AddVehicle(VehicleinfoViewModel ty) { lk.Add(ty); List <VehicleinfoViewModel> f = lk.GetAll(); Session["VehicleInfoAll"] = f; return(RedirectToAction("VehicleInfoViewAll")); }
public ActionResult NewVehicleInfo(VehicleinfoViewModel sa) { lk.Update(sa); List <VehicleinfoViewModel> f = lk.GetAll(); Session["VehicleInfoAll"] = f; if (Session["VHSearch"] == null) { return(RedirectToAction("VehicleInfoViewAll")); } return(RedirectToAction("VehicleSearch")); }
public ActionResult EditVehicleInfo(int id) { VehicleinfoViewModel a = lk.GetEdit(id); ViewData["VehicleInfoAll"] = a; List <BrandViewModel> s = br.GetAll(); Session["brandAll"] = s; List <ModelViewModel> o = md.GetAll(); Session["modelAll"] = o; return(View()); }
public void AddCustomerPolicy() { CheckoutInfo checkout = (CheckoutInfo)Session["checkoutInfo"]; Vehicle_Info vehicleInfo = checkout.Vehicle; Customer_Policy customerPolicy = checkout.CustomerPolicy; VehicleinfoViewModel vehicle = new VehicleinfoViewModel() { address = vehicleInfo.address, brandid = vehicleInfo.brand_id, eginenumber = vehicleInfo.engine_number, framenumber = vehicleInfo.frame_number, modelid = vehicleInfo.model_id, ownername = vehicleInfo.owner_name, ratebycondition = vehicleInfo.rate_by_condition, vehiclecondition = vehicleInfo.vehicle_condition, vehiclenumber = vehicleInfo.vehicle_number, version = vehicleInfo.version }; VehicleinfoDAORequest request1 = new VehicleinfoDAORequest(); request1.Add(vehicle); VehicleinfoViewModel vehicle2 = request1.GetByAllNumber(vehicle.framenumber, vehicle.eginenumber, vehicle.vehiclenumber); CustomerpolicyViewModel cPolicy = new CustomerpolicyViewModel() { active = customerPolicy.active, createdate = customerPolicy.create_date, customeraddprove = customerPolicy.customer_add_prove, customerid = (int)customerPolicy.customer_id, policyenddate = customerPolicy.policy_end_date, policyid = (int)customerPolicy.policy_id, policystartdate = customerPolicy.policy_start_date, TotalPayment = customerPolicy.total_payment, vehicleid = vehicle2.id }; CustomerpolicyDAORequest request2 = new CustomerpolicyDAORequest(); request2.Add(cPolicy); }