public int AddSupplier(SupplierDTO dto) { int id = 0; try { log.Debug(SupplierDTO.FormatSupplierDTO(dto)); R_Supplier t = SupplierDTO.ConvertDTOtoEntity(dto); // add id = Repository.AddSupplier(t); dto.SupplierId = id; log.Debug("result: 'success', id: " + id); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } return(id); }
public void DeleteSupplier(SupplierDTO dto) { try { log.Debug(SupplierDTO.FormatSupplierDTO(dto)); R_Supplier t = SupplierDTO.ConvertDTOtoEntity(dto); // delete Repository.DeleteSupplier(t); dto.IsDeleted = t.IsDeleted; log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }
public void UpdateSupplier(SupplierDTO dto) { try { //Requires.NotNull(t); //Requires.PropertyNotNegative(t, "SupplierId"); log.Debug(SupplierDTO.FormatSupplierDTO(dto)); R_Supplier t = SupplierDTO.ConvertDTOtoEntity(dto); // update Repository.UpdateSupplier(t); log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }