Ejemplo n.º 1
0
        public static internalDTO.Sale MapFromBLL(externalDTO.Sale sale)
        {
            var res = sale == null ? null : new internalDTO.Sale
            {
                Id                      = sale.Id,
                Description             = sale.Description,
                AppUserId               = sale.AppUserId,
                AppUser                 = AppUserMapper.MapFromBLL(sale.AppUser),
                SaleInitialCreationTime = sale.SaleInitialCreationTime
            };

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

            return(res);
        }
Ejemplo n.º 3
0
        public static DAL.App.DTO.AppUserInPosition MapFromBLL(BLL.App.DTO.AppUserInPosition appUserInPosition)
        {
            var res = appUserInPosition == null ? null : new DAL.App.DTO.AppUserInPosition
            {
                Id                = appUserInPosition.Id,
                AppUserId         = appUserInPosition.AppUserId,
                AppUser           = AppUserMapper.MapFromBLL(appUserInPosition.AppUser),
                AppUserPositionId = appUserInPosition.AppUserPositionId,
                AppUserPosition   = AppUserPositionMapper.MapFromBLL(appUserInPosition.AppUserPosition),
                From              = appUserInPosition.From,
                Until             = appUserInPosition.Until
            };

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

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

            return(res);
        }
Ejemplo n.º 6
0
        public static DAL.App.DTO.AppUserOnObject MapFromBLL(BLL.App.DTO.AppUserOnObject appUserOnObject)
        {
            var res = appUserOnObject == null ? null : new DAL.App.DTO.AppUserOnObject
            {
                Id           = appUserOnObject.Id,
                AppUserId    = appUserOnObject.AppUserId,
                AppUser      = AppUserMapper.MapFromBLL(appUserOnObject.AppUser),
                WorkObjectId = appUserOnObject.WorkObjectId,
                WorkObject   = WorkObjectMapper.MapFromBLL(appUserOnObject.WorkObject),
                From         = appUserOnObject.From,
                Until        = appUserOnObject.Until
            };

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

            return(res);
        }
Ejemplo n.º 8
0
        public static DAL.App.DTO.Comment MapFromBLL(BLL.App.DTO.Comment comment)
        {
            var res = comment == null ? null : new DAL.App.DTO.Comment
            {
                Id           = comment.Id,
                Timestamp    = comment.Timestamp,
                CommentValue = comment.CommentValue,
                FoodItem     = FoodItemMapper.MapFromBLL(comment.FoodItem),
                FoodItemId   = comment.FoodItemId,
                AppUserId    = comment.AppUserId,
                AppUser      = AppUserMapper.MapFromBLL(comment.AppUser)
            };


            return(res);
        }
Ejemplo n.º 9
0
        public static DAL.App.DTO.Invoice MapFromBLL(BLL.App.DTO.Invoice invoice)
        {
            var res = invoice == null ? null : new DAL.App.DTO.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.MapFromBLL(invoice.AppUser),
            };

            return(res);
        }
Ejemplo n.º 10
0
        public static internalDTO.UserTask MapFromBLL(externalDTO.UserTask userTask)
        {
            var res = userTask == null ? null : new internalDTO.UserTask
            {
                Id          = userTask.Id,
                Start       = userTask.Start,
                End         = userTask.End,
                TaskId      = userTask.TaskId,
                TaskGiverId = userTask.TaskGiverId,
                TaskerId    = userTask.TaskerId,
                TaskerTask  = TaskerTaskMapper.MapFromBLL(userTask.TaskerTask),
                TaskGiver   = AppUserMapper.MapFromBLL(userTask.TaskGiver),
                Tasker      = AppUserMapper.MapFromBLL(userTask.Tasker)
            };

            return(res);
        }
Ejemplo n.º 11
0
        public static externalDTO.Sale MapFromDAL(internalDTO.Sale sale)
        {
            var res = sale == null ? null : new externalDTO.Sale
            {
                Id                      = sale.Id,
                Description             = sale.Description,
                AppUserId               = sale.AppUserId,
                AppUser                 = AppUserMapper.MapFromDAL(sale.AppUser),
                SaleInitialCreationTime = sale.SaleInitialCreationTime,
            };

            if (sale?.ProductsSold != null)
            {
                res.ProductsSold         = sale.ProductsSold.Select(e => ProductSoldMapper.MapFromDAL(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);
        }