public SalesmanSupplierDTO Map(SalesmanSupplier salesmanSupplier) { if (salesmanSupplier == null) return null; return Mapper.Map<SalesmanSupplier, SalesmanSupplierDTO>(salesmanSupplier); }
protected Guid CreateSalemanSupplier(Guid salemanwarehouseid, Guid supplierId) { //CostCentre costcenterDistibutor = _costCentreRepository.GetById(distributorid); CostCentre costcenterDistibutorSaleman = _costCentreRepository.GetById(salemanwarehouseid); Supplier supplier = _supplierRepository.GetById(supplierId); SalesmanSupplier ss = new SalesmanSupplier(Guid.NewGuid()) { DistributorSalesmanRef = new CostCentreRef { Id = costcenterDistibutorSaleman.Id }, Supplier = supplier }; ss._SetStatus(EntityStatus.Active); Guid id = _salesmanSupplierRepository.Save(ss); return id; }