public ActionResult Modify(VehicleViewModel model) { if (ModelState.IsValid) { var dbModel = Mapper.Map <VehicleViewModel, VehicleModel>(model); if (model.Id > 0) // Edit { _vehicleBusiness.Edit(dbModel); return(RedirectToAction("Edit", "Vehicle", new { area = "AdminPanel", id = dbModel.Id, isSuccessModified = true })); } else // Add { var vehicleId = _vehicleBusiness.Add(dbModel); return(RedirectToAction("Index", "VehicleImage", new { area = "AdminPanel", vehicleId = vehicleId })); } } return(View("Modify", model)); }