Esempio n. 1
0
        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 }));
        }
Esempio n. 2
0
        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 }));
        }