Esempio n. 1
0
        public virtual void AssignFrom(PartakerInvEntity entity)
        {
            if (entity == null) throw new ArgumentNullException(nameof(entity));

            this.Id = entity.Id;
            this.PartakerKind = entity.PartakerKind;
            this.CreatedAt = entity.CreatedAt;
        }
Esempio n. 2
0
        public override void AssignFrom(PartakerInvEntity entity)
        { 
            if (entity == null) throw new ArgumentNullException(nameof(entity));
            var inviterIdsToArray = Array.ConvertAll(entity.InviterStaffIds.Split(','),Guid.Parse);
            var staffManager = (IStaffManager) HttpUtil.HttpContext.RequestServices.GetService(typeof (IStaffManager));
            var inviterNames= staffManager.FetchStaffsByIds(inviterIdsToArray)
                .Select(p => p.Name);

            base.AssignFrom(entity); 
            this.Task = entity.Task.ToViewModel();
            this.Staff = entity.Staff.ToViewModel(); 
            this.InviterNames = string.Join(",", inviterNames);
            this.Message = entity.Message; 
            this.ReviewStatus = entity.ReviewStatus;
            this.ReviewAt = entity.ReviewAt;
            this.ReviewKind = entity.Task.Partakers.FirstOrDefault(p => p.Staff == entity.Staff)?.Kind;

        }