Exemplo n.º 1
0
        public static Domain.Sale MapFromDAL(DAL.App.DTO.DomainLikeDTO.Sale sale)
        {
            var res = sale == null ? null : new Domain.Sale
            {
                Id                      = sale.Id,
                Description             = new MultiLangString(sale.Description),
                AppUserId               = sale.AppUserId,
                AppUser                 = AppUserMapper.MapFromDAL(sale.AppUser),
                SaleInitialCreationTime = sale.SaleInitialCreationTime,
            };

            return(res);
        }
Exemplo n.º 2
0
        public static internalDTO.AppUserInPosition MapFromDAL(externalDTO.AppUserInPosition appUserInPosition)
        {
            var res = appUserInPosition == null ? null : new internalDTO.AppUserInPosition
            {
                Id                = appUserInPosition.Id,
                AppUserId         = appUserInPosition.AppUserId,
                AppUser           = AppUserMapper.MapFromDAL(appUserInPosition.AppUser),
                AppUserPositionId = appUserInPosition.AppUserPositionId,
                AppUserPosition   = AppUserPositionMapper.MapFromDAL(appUserInPosition.AppUserPosition),
                From              = appUserInPosition.From,
                Until             = appUserInPosition.Until
            };

            return(res);
        }
Exemplo n.º 3
0
        public static DAL.App.DTO.Comment MapFromDomain(Domain.Comment comment)
        {
            var res = comment == null ? null : new DAL.App.DTO.Comment
            {
                Id           = comment.Id,
                Timestamp    = comment.Timestamp,
                CommentValue = comment.CommentValue,
                FoodItemId   = comment.FoodItemId,
                AppUserId    = comment.AppUserId,
                AppUser      = AppUserMapper.MapFromDomain(comment.AppUser)
            };


            return(res);
        }
Exemplo n.º 4
0
        public static Domain.UserOnAddress MapFromDAL(DAL.App.DTO.UserOnAddress userOnAddress)
        {
            var res = userOnAddress == null ? null : new Domain.UserOnAddress
            {
                Id        = userOnAddress.Id,
                Start     = userOnAddress.Start,
                End       = userOnAddress.End,
                AddressId = userOnAddress.AddressId,
                AppUserId = userOnAddress.AppUserId,
                Address   = AddressMapper.MapFromDAL(userOnAddress.Address),
                AppUser   = AppUserMapper.MapFromDAL(userOnAddress.AppUser)
            };


            return(res);
        }
Exemplo n.º 5
0
        public static Domain.UserSkill MapFromDAL(DAL.App.DTO.UserSkill userSkill)
        {
            var res = userSkill == null ? null : new Domain.UserSkill
            {
                Id        = userSkill.Id,
                Start     = userSkill.Start,
                End       = userSkill.End,
                SkillId   = userSkill.SkillId,
                AppUserId = userSkill.AppUserId,
                Skill     = SkillMapper.MapFromDAL(userSkill.Skill),
                AppUser   = AppUserMapper.MapFromDAL(userSkill.AppUser)
            };


            return(res);
        }
Exemplo n.º 6
0
        public static Domain.Review MapFromDAL(DAL.App.DTO.Review review)
        {
            var res = review == null ? null : new Domain.Review
            {
                Id               = review.Id,
                Rating           = review.Rating,
                ReviewComment    = new Domain.MultiLangString(review.ReviewComment),
                ReviewGiverId    = review.ReviewGiverId,
                ReviewReceiverId = review.ReviewReceiverId,
                ReviewGiver      = AppUserMapper.MapFromDAL(review.ReviewGiver),
                ReviewReceiver   = AppUserMapper.MapFromDAL(review.ReviewReceiver)
            };


            return(res);
        }
Exemplo n.º 7
0
        public static DAL.App.DTO.Review MapFromDomain(Domain.Review review)
        {
            var res = review == null ? null : new DAL.App.DTO.Review
            {
                Id               = review.Id,
                Rating           = review.Rating,
                ReviewComment    = review.ReviewComment.Translate(),
                ReviewGiverId    = review.ReviewGiverId,
                ReviewReceiverId = review.ReviewReceiverId,
                ReviewGiver      = AppUserMapper.MapFromDomain(review.ReviewGiver),
                ReviewReceiver   = AppUserMapper.MapFromDomain(review.ReviewReceiver)
            };


            return(res);
        }
Exemplo n.º 8
0
        public static Domain.Identification MapFromDAL(DAL.App.DTO.Identification identification)
        {
            var res = identification == null ? null : new Domain.Identification
            {
                Id        = identification.Id,
                DocNumber = identification.DocNumber,
                Start     = identification.Start,
                End       = identification.End,
                Comment   = identification.Comment,
                AppUserId = identification.AppUserId,
                AppUser   = AppUserMapper.MapFromDAL(identification.AppUser)
            };


            return(res);
        }
Exemplo n.º 9
0
        public static Domain.UserTask MapFromDAL(DAL.App.DTO.UserTask userTask)
        {
            var res = userTask == null ? null : new Domain.UserTask
            {
                Id          = userTask.Id,
                Start       = userTask.Start,
                End         = userTask.End,
                TaskId      = userTask.TaskId,
                TaskGiverId = userTask.TaskGiverId,
                TaskerId    = userTask.TaskerId,
                TaskerTask  = TaskerTaskMapper.MapFromDAL(userTask.TaskerTask),
                TaskGiver   = AppUserMapper.MapFromDAL(userTask.TaskGiver),
                Tasker      = AppUserMapper.MapFromDAL(userTask.Tasker)
            };


            return(res);
        }
Exemplo n.º 10
0
        public static Domain.Invoice MapFromDAL(DAL.App.DTO.Invoice invoice)
        {
            var res = invoice == null ? null : new Domain.Invoice
            {
                Id              = invoice.Id,
                InvoiceNumber   = invoice.InvoiceNumber,
                Date            = invoice.Date,
                TotalWithVAT    = invoice.TotalWithVAT,
                TotalWithoutVAT = invoice.TotalWithoutVAT,
                VAT             = invoice.VAT,
                Comment         = invoice.Comment,
                AppUserId       = invoice.AppUserId,
                AppUser         = AppUserMapper.MapFromDAL(invoice.AppUser),
            };


            return(res);
        }
Exemplo n.º 11
0
        public static DAL.App.DTO.DomainLikeDTO.Sale MapFromDomain(Domain.Sale sale)
        {
            var res = sale == null ? null : new DAL.App.DTO.DomainLikeDTO.Sale
            {
                Id                      = sale.Id,
                Description             = sale.Description.Translate(),
                AppUserId               = sale.AppUserId,
                AppUser                 = AppUserMapper.MapFromDomain(sale.AppUser),
                SaleInitialCreationTime = sale.SaleInitialCreationTime,
            };

            if (sale?.ProductsSold != null)
            {
                res.ProductsSold         = sale.ProductsSold.Select(e => ProductSoldMapper.MapFromDomain(e)).ToList();
                res.AllTotalSaleAmount   = sale.ProductsSold.Sum(e => e.Quantity * e.Product.SellPrice);
                res.TodayTotalSaleAmount = sale.ProductsSold.Where(e => DateTime.Today < e.ProductSoldTime && e.ProductSoldTime < DateTime.Today.AddDays(1).AddTicks(-1))
                                           .Sum(e => e.Quantity * e.Product.SellPrice);
            }

            return(res);
        }