public ActionResult AddToExisting(AddToExistingContactViewModel svm) { Agent Agent = new Agent(); Agent.PersonID = svm.PersonId; _AgentService.Create(Agent); try { _unitOfWork.Save(); } catch (Exception ex) { string message = _exception.HandleException(ex); ModelState.AddModelError("", message); return(PartialView("_Create", svm)); } return(Json(new { success = true })); }
public ActionResult AddToExisting(AddToExistingContactViewModel svm) { Supplier Supplier = new Supplier(); Supplier.PersonID = svm.PersonId; Supplier.SalesTaxGroupPartyId = null; _SupplierService.Create(Supplier); try { _unitOfWork.Save(); } catch (Exception ex) { string message = _exception.HandleException(ex); ModelState.AddModelError("", message); return(PartialView("_Create", svm)); } return(Json(new { success = true })); }