public CompanyResponse Map(Company address) { if (address == null) { return(null); } ; CompanyResponse response = new CompanyResponse { Id = address.Id, Name = address.Name, Addition = address.Addition, Addition2 = address.Addition2, Street = address.Street, PostCode = address.PostCode, City = address.City, Email = address.Email, Phone = address.Phone, Fax = address.Fax, VatId = address.VatId, TimeZone = address.TimeZone, ParentId = (System.Guid)address.ParentId, Parent = _addressMapper.Map(address.Parent), CountryId = address.CountryId, Country = _countryMapper.Map(address.Country), LogoId = (System.Guid)address.LogoId, Logo = _fagBinaryMapper.Map(address.Logo), CompanyTypeId = address.CompanyTypeId, CompanyType = _companyTypeMapper.Map(address.CompanyType) }; return(response); }
public async Task <RespContainer <FAGBinaryResponse> > Handle(AddFAGBinaryCommand request, CancellationToken cancellationToken) { Models.FAGBinary fagBinary = _fagBinaryMapper.Map(request.Data); Models.FAGBinary result = _fagBinaryRespository.Add(fagBinary); int modifiedRecords = await _fagBinaryRespository.UnitOfWork.SaveChangesAsync(); _logger.LogInformation(Events.Add, Messages.NumberOfRecordAffected_modifiedRecords, modifiedRecords); _logger.LogInformation(Events.Add, Messages.ChangesApplied_id, result?.Id); return(RespContainer.Ok(_fagBinaryMapper.Map(result), "FAGBinary Created")); }
public ArticleResponse Map(Article article) { if (article == null) { return(null); } ; ArticleResponse response = new ArticleResponse { Id = article.Id, Name = article.Name, MaterialType = article.MaterialType, IsArchived = article.IsArchived, IsDiscontinued = article.IsDiscontinued, IsBatch = article.IsBatch, IsMultistock = article.IsMultistock, IsProvisionEnabled = article.IsProvisionEnabled, IsDiscountEnabled = article.IsDiscountEnabled, IsDisposition = article.IsDisposition, IsCasting = article.IsCasting, ScaleUnitQty = article.ScaleUnitQty, ScaleUnitType = article.ScaleUnitType, UnitStock = article.UnitStock, UnitStockIn = article.UnitStockIn, UnitStockOut = article.UnitStockOut, DimArea = article.DimArea, DimLength = article.DimLength, Dim2 = article.Dim2, Dim3 = article.Dim3, Dim4 = article.Dim4, SpecificWeight = article.SpecificWeight, ItemNumber = article.ItemNumber, DrawingNumber = article.DrawingNumber, DinNorm1 = article.DinNorm1, DinNorm2 = article.DinNorm2, ArticleGroupId = article.ArticleGroupId, ArticleGroup = _articleGroupMapper.Map(article.ArticleGroup), ArticleTypeId = article.ArticleTypeId, ArticleType = _articleTypeMapper.Map(article.ArticleType), ArticleInventories = article.ArticleInventories.Select(x => _articleInventoryMapper.Map(x)).ToList(), ArticleRanges = article.ArticleRanges.Select(x => _articleRangeMapper.Map(x)).ToList(), Pictures = article.Pictures.Select(x => _fagBinaryMapper.Map(x)).ToList() }; return(response); }
public async Task <FAGBinaryResponse> AddFAGBinaryAsync(AddFAGBinaryRequest request) { FAGBinary fagBinary = _fagBinaryMapper.Map(request); FAGBinary result = _fagBinaryRespository.Add(fagBinary); int modifiedRecords = await _fagBinaryRespository.UnitOfWork.SaveChangesAsync(); _logger.LogInformation(Events.Add, Messages.NumberOfRecordAffected_modifiedRecords, modifiedRecords); _logger.LogInformation(Events.Add, Messages.ChangesApplied_id, result?.Id); return(_fagBinaryMapper.Map(result)); }
public PersonResponse Map(Person person) { if (person == null) { return(null); } ; PersonResponse response = new PersonResponse { Id = person.Id, LastName = person.LastName, FirstName = person.FirstName, Sex = person.Sex, Department = person.Department, PhoneOffice = person.PhoneOffice, PhonePrivate = person.PhonePrivate, Email = person.Email, PictureId = (Guid)person.PictureId, Picture = _fagBinaryMapper.Map(person.Picture) }; return(response); }