public bool SaveDetails(SupplierDto newDetails)
        {
            this.supplier = newDetails.DtoToEntity();

            if (this._supplier.Insert(this.supplier).IsNull())
            {
                return(false);
            }

            return(true);
        }
示例#2
0
        public static IOBalanceDBV2Entity.Supplier DtoToEntity(this SupplierDto dto)
        {
            IOBalanceDBV2Entity.Supplier entity = null;

            if (!dto.IsNull())
            {
                entity = new IOBalanceDBV2Entity.Supplier
                {
                    SupplierID   = dto.SupplierId,
                    SupplierCode = dto.SupplierCode,
                    SupplierName = dto.SupplierName,
                    CreatedBy    = dto.CreatedBy,
                    DateCreated  = dto.DateCreated,
                    DateUpdated  = dto.DateUpdated,
                    UpdatedBy    = dto.UpdatedBy
                };
            }

            return(entity);
        }
 public SupplierService(IIOBalanceV2Repository <Supplier> supplier)
 {
     this._supplier = supplier;
     this.supplier  = new IOBalanceDBV2Entity.Supplier();
 }