public IActionResult AddVehicleMake(VehicleMakeJsonModel model) { bool isAdded = false; if (!string.IsNullOrEmpty(model.Name)) { model.Name = model.Name.Trim(); isAdded = _vehicleService.AddMake(model); } string error = isAdded ? Messages.INFO_ENTITY_ADDED : Messages.ERROR_ENTITY_EXISTS; return(Json(new ResponseJsonModel(isAdded, error: error))); }
public ActionResult Create(VehicleMakeVM obj) { if (ModelState.IsValid) { string str = repository.AddMake(obj); if (str == "Ok") { return(RedirectToAction("Index")); } return(View()); // open error page } else { return(View()); } }
public ActionResult Create(VehicleMake vehicleMake) { vehicleMake.MakeId = _vehicleService.AddMake(vehicleMake); return(View()); }