public ActionResult Save(EditSupplierAddressViewModel model, string command) { if (command.ToLower() == "save") { var modelError = SupplierService.InsertOrUpdateSupplierAddress(model.SupplierAddress, model.LGS); if (modelError.IsError) { prepareEditModel(model, model.SupplierAddress.Id, model.SupplierAddress.SupplierId.Value); model.SetErrorOnField(ErrorIcon.Error, modelError.Message, "SupplierAddress_" + modelError.FieldName); return(View("Edit", model)); } else { return(RedirectToAction("SupplierAddresses", new { id = model.ParentId })); } } else { return(RedirectToAction("SupplierAddresses", new { id = model.ParentId })); } }