Пример #1
0
        public static internalDTO.ProductService MapFromDAL(externalDTO.ProductService productService)
        {
            var res = productService == null ? null : new internalDTO.ProductService()
            {
                Id                 = productService.Id,
                Description        = new internalDTO.MultiLangString(productService.Description),
                WorkObjectId       = productService.WorkObjectId,
                WorkObject         = WorkObjectMapper.MapFromDAL(productService.WorkObject),
                ProductForClientId = productService.ProductForClientId,
                ProductForClient   = ProductForClientMapper.MapFromDAL(productService.ProductForClient)
            };

            return(res);
        }
Пример #2
0
        public static externalDTO.ProductService MapFromDomain(internalDTO.ProductService productService)
        {
            var res = productService == null ? null : new externalDTO.ProductService()
            {
                Id                 = productService.Id,
                Description        = productService.Description.Translate(),
                WorkObjectId       = productService.WorkObjectId,
                WorkObject         = WorkObjectMapper.MapFromDomain(productService.WorkObject),
                ProductForClientId = productService.ProductForClientId,
                ProductForClient   = ProductForClientMapper.MapFromDomain(productService.ProductForClient)
            };

            return(res);
        }
Пример #3
0
        public static internalDTO.AppUserOnObject MapFromDAL(externalDTO.AppUserOnObject appUserOnObject)
        {
            var res = appUserOnObject == null ? null : new internalDTO.AppUserOnObject
            {
                Id           = appUserOnObject.Id,
                AppUserId    = appUserOnObject.AppUserId,
                AppUser      = DAL.App.EF.Mappers.AppUserMapper.MapFromDAL(appUserOnObject.AppUser),
                WorkObjectId = appUserOnObject.WorkObjectId,
                WorkObject   = WorkObjectMapper.MapFromDAL(appUserOnObject.WorkObject),
                From         = appUserOnObject.From,
                Until        = appUserOnObject.Until
            };

            return(res);
        }
Пример #4
0
        public static internalDTO.Bill MapFromDAL(externalDTO.Bill bill)
        {
            var res = bill == null ? null : new internalDTO.Bill
            {
                Id              = bill.Id,
                ClientId        = bill.ClientId,
                Client          = ClientMapper.MapFromDAL(bill.Client),
                WorkObjectId    = bill.WorkObjectId,
                WorkObject      = WorkObjectMapper.MapFromDAL(bill.WorkObject),
                ArrivalFee      = bill.ArrivalFee,
                SumWithOutTaxes = bill.SumWithoutTaxes,
                TaxPercent      = bill.TaxPercent,
                FinalSum        = bill.FinalSum,
                DateTime        = bill.DateTime,
                InvoiceNr       = bill.InvoiceNr,
                Comment         = new internalDTO.MultiLangString(bill.Comment),
//                BillLines = bill.BillLines.Select(e => BillLineMapper.MapFromDAL(e)).ToList(),
//                Payments = bill.Payments.Select(e => PaymentMapper.MapFromDAL(e)).ToList(),
            };

            return(res);
        }