Ejemplo n.º 1
0
 public void Save(SupplierViewModel supplierViewModel)
  {
      Supplier supplier = new Supplier(supplierViewModel.Id)
      {
       Name=supplierViewModel.Name,
        Description=supplierViewModel.Description,
         Code=supplierViewModel.Code
      };
      _supplierRepository.Save(supplier);
  }
Ejemplo n.º 2
0
 public ActionResult CreateSupplier(SupplierViewModel supplierVM)
 {
     try
     {
         supplierVM.Id = Guid.NewGuid();
         _supplierViewModelBuilder.Save(supplierVM);
         TempData["msg"] = "Supplier Successfully Created";
         _auditLogViewModelBuilder.AddAuditLog(this.User.Identity.Name, "Create", "Add Supplier", DateTime.Now);
         
         return RedirectToAction("ListSuppliers");
     }
     catch (DomainValidationException dve)
     {
         ValidationSummary.DomainValidationErrors(dve, ModelState);
         return View();
     }
     catch (Exception ex)
     {
         ViewBag.msg = ex.Message;
         return View();
     }
 }