public async Task <IActionResult> InvStorageadd(InvStorageModel model) { if (ModelState.IsValid) { var invstorageObj = _mapper.Map <ShipTo>(model); invstorageObj.ClientId = (int)_workContext.CurrentCustomer.ClientId; var result = await _productMangement.InsertShipTo(invstorageObj); if (result) { SuccessNotification("The new storage location data has been saved successfully."); return(RedirectToAction("InvStorageadd")); } else { ModelState.AddModelError("", "Something went wrong while saving record"); } } return(View(model)); }
public async Task <IActionResult> InvStorageEdit(InvStorageModel model) { if (ModelState.IsValid) { var invstorageObj = _mapper.Map <ShipTo>(model); invstorageObj.ClientId = (int)_workContext.CurrentCustomer.ClientId; var result = await _productMangement.UpdateShipTo(invstorageObj); if (result) { SuccessNotification("The storage location data has been updated successfully."); return(RedirectToAction("InvStorageEdit", "ProductManagement", new { Area = "Administration", Sid = model.Sid })); } else { ModelState.AddModelError("", "Something went wrong while saving record"); } } return(View(model)); }