public static externalDTO.AppUserInPosition MapFromDomain(internalDTO.AppUserInPosition appUserInPosition) { var res = appUserInPosition == null ? null : new externalDTO.AppUserInPosition { Id = appUserInPosition.Id, AppUserId = appUserInPosition.AppUserId, AppUser = AppUserMapper.MapFromDomain(appUserInPosition.AppUser), AppUserPositionId = appUserInPosition.AppUserPositionId, AppUserPosition = AppUserPositionMapper.MapFromDomain(appUserInPosition.AppUserPosition), From = appUserInPosition.From, Until = appUserInPosition.Until }; return(res); }
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); }
public static DAL.App.DTO.UserOnAddress MapFromDomain(Domain.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.MapFromDomain(userOnAddress.Address), AppUser = AppUserMapper.MapFromDomain(userOnAddress.AppUser) }; return(res); }
public static DAL.App.DTO.UserSkill MapFromDomain(Domain.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.MapFromDomain(userSkill.Skill), AppUser = AppUserMapper.MapFromDomain(userSkill.AppUser) }; return(res); }
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); }
public static DAL.App.DTO.Identification MapFromDomain(Domain.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.MapFromDomain(identification.AppUser) }; return(res); }
public static DAL.App.DTO.UserTask MapFromDomain(Domain.UserTask userTask) { var res = userTask == null ? null : new DAL.App.DTO.UserTask { Id = userTask.Id, Start = userTask.Start, End = userTask.End, TaskId = userTask.TaskId, TaskGiverId = userTask.TaskGiverId, TaskerId = userTask.TaskerId, TaskerTask = TaskerTaskMapper.MapFromDomain(userTask.TaskerTask), TaskGiver = AppUserMapper.MapFromDomain(userTask.TaskGiver), Tasker = AppUserMapper.MapFromDomain(userTask.Tasker) }; return(res); }
public static DAL.App.DTO.Invoice MapFromDomain(Domain.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.MapFromDomain(invoice.AppUser), }; return(res); }
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); }