private VATClassDTO Map(tblVATClass tbl)
 {
     var dto = new VATClassDTO
                   {
                       MasterId = tbl.id,
                       DateCreated = tbl.IM_DateCreated,
                       DateLastUpdated = tbl.IM_DateLastUpdated,
                       StatusId = tbl.IM_Status,
                       Name = tbl.Name,
                       VatClass = tbl.Class,
                       VatClassItems = new List<VatClassItemDTO>()
                   };
     foreach (var item in tbl.tblVATClassItem.Where(n => n.IM_Status== (int)EntityStatus.Active))
     {
         var dtoitem = new VatClassItemDTO
                           {
                               MasterId = item.id,
                               DateCreated = item.IM_DateCreated,
                               DateLastUpdated = item.IM_DateLastUpdated,
                               StatusId = item.IM_Status,
                               Rate = item.Rate,
                               EffectiveDate = item.EffectiveDate,
                               VatClassMasterId = item.VATClassID,
                           };
         dto.VatClassItems.Add(dtoitem);
     }
     return dto;
 }
Esempio n. 2
0
 public VATClass.VATClassItem Map(VatClassItemDTO dto, Guid id)
 {
     if (dto == null) return null;
     var vatClassItem = Mapper.Map<VatClassItemDTO, VATClass.VATClassItem>(dto);
     return vatClassItem;
 }