public IActionResult EditShipper(int id) { var model = new EditShipperVieModel() { EditModel = this.adminServices.EditShipper(id) }; if (model == null) { this.TempData["_Message"] = "Edit shipper is not find"; return(RedirectToAction(nameof(DetailsShipper), new { id })); } return(View(model)); }
public IActionResult EditShipper(int id, EditShipperVieModel model) { if (model == null) { this.ViewBag.Error = "The edit model is null !!!"; return(View(id)); } var editModel = this.adminServices.SaveEditShipper(id, model.EditModel); if (editModel) { this.TempData["_Message"] = "Shipper is edit successful!!!"; return(RedirectToAction(nameof(DetailsShipper), new { id })); } this.ViewBag.Error = "Shipper is not edit !!!"; return(View(model)); }