public bool Save(SupplierDetailsDto newDetails) { this.supplier = newDetails.DtoToEntity(); if (this._supplier.Insert(this.supplier).IsNull()) { return(false); } return(true); }
public static ChainSawEntity.Supplier DtoToEntity(this SupplierDetailsDto dto) { ChainSawEntity.Supplier entity = null; if (!dto.IsNull()) { entity = new ChainSawEntity.Supplier { SupplierID = dto.SupplierId, SupplierCode = dto.SupplierCode, SupplierName = dto.SupplierName, DateCreated = dto.DateCreated, CreatedBy = dto.CreatedBy }; } return(entity); }
public SupplierService(IIOBalanceRepository <Supplier> supplier) { this._supplier = supplier; this.supplier = new ChainSawDBEntity.Supplier(); }