public async Task <object> Add(Supplier supplier) { bool isValid = await _supplierService.AddSupplier(supplier); _notification.SetNotificationMessage(isValid, Title, supplier.UID); return(_notification); }
public IHttpActionResult Add([FromBody] SupplierView supplier) { var supplierDTO = mapper.Map <SupplierView, SupplierDTO>(supplier); suppliersService.AddSupplier(supplierDTO); suppliersService.SaveChanges(); return(Ok()); }
public ItemResult <object> CreateSupplier(SupplierRequest supplierRequest) { var result = ItemResult <object> .SuccessResult; try { result.data = _suppliersService.AddSupplier(SupplierRequest2Entity(supplierRequest)); return(result); } catch (Exception ex) { throw ex; } }
public HttpResponseMessage AddSupplier([FromBody] SupplierDto supplier) { _service.AddSupplier(supplier); _service.ApplyChanges(); return(Request.CreateResponse(HttpStatusCode.OK, $"Suppliers added {supplier.Name}")); }
/// <summary> /// Додає постачальника /// </summary> /// <param name="supplierDto">Екземпляр постачальника</param> public void AddSupplier(SuppliersDtoModel supplierDto) => suppliersService.AddSupplier(supplierDto);