public bool UpdateInactive(int supplierId, int?updatedBy) { var ActiveSupplier = FindSupplierById(supplierId); if (ActiveSupplier.IsNull()) { return(false); } this.supplier = new Supplier() { SupplierID = supplierId, SupplierCode = ActiveSupplier.SupplierCode, SupplierName = ActiveSupplier.SupplierName, IsActive = ActiveSupplier.IsActive ? false : true, DateCreated = ActiveSupplier.DateCreated, CreatedBy = ActiveSupplier.CreatedBy, UpdatedBy = updatedBy, DateUpdated = System.DateTime.Now }; if (this._supplier.Update(this.supplier, s => s.SupplierID == supplierId).IsNull()) { return(false); } return(true); }
public bool SaveSupplier(SupplierDto supplierDetails) { this.supplier = supplierDetails.DtoToEntity(); if (this._supplier.Insert(this.supplier).IsNull()) { return(false); } return(true); }
public static IOBalanceEntity.Supplier DtoToEntity(this SupplierDto dto) { IOBalanceEntity.Supplier entity = null; if (!dto.IsNull()) { entity = new IOBalanceEntity.Supplier() { SupplierName = dto.SupplierName, SupplierCode = dto.SupplierCode, IsActive = true, CreatedBy = dto.CreatedBy, DateCreated = System.DateTime.Now, DateUpdated = dto.DateUpdated, UpdatedBy = dto.UpdatedBy }; } return(entity); }
public SupplierService(IIOBalanceRepository <Supplier> supplier) { _supplier = supplier; this.supplier = new IOBalanceEntity.Supplier(); }