public ActionResult RequestedMember()
        {
            RequestedMemberModel requested = new RequestedMemberModel();
            var result = response.GetAll(1);

            var result2 = postProjectDao.GetByID(1);

            requested.ProjectName = result2.Data.ProjectName;
            requested.Description = result2.Data.Description;
            foreach (var user in result)
            {
                var result3 = userDao.GetById(user.WUserId);
                requested.UserInfo.Add(result3.Data);
            }
            return(View(requested));
        }
        public ActionResult RequestedMember(int id)
        {
            RequestedMemberModel requested = new RequestedMemberModel();
            //postid
            var result = _responseservice.GetAll(id + "");

            var result2 = _postservice.GetByID(id);
            var select  = _selectedWorkerService.GetAll().Data.Where(d => d.PostId == id).ToList();


            requested.ProjectName = result2.Data.ProjectName;
            requested.Description = result2.Data.Description;
            requested.PostId      = result2.Data.PostId;
            var m = result.Data.Where(p => p.Flag == 0).ToList();

            if (select.Count < result2.Data.Members)
            {
                foreach (var user in m)
                {
                    var result3 = _userservice.GetByID(user.WUserId);
                    requested.UserInfo.Add(result3.Data);
                }
            }

            List <ProfileWorker> totList = new List <ProfileWorker>();

            foreach (var v in requested.UserInfo)
            {
                var proWorkVM = new ProfileWorker();
                var obj       = proWorkVM.creation(v, new WorkerInfo(),
                                                   _ratingWorkerService.GetAll().Data.Where(d => d.UserId == v.UserId).ToList(),
                                                   new List <PostAProject>());
                totList.Add(obj);
            }

            totList = totList.OrderByDescending(d => d.tot).ToList();
            var uInfo = new List <UserInfo>();

            foreach (var v in totList)
            {
                uInfo.Add(_userservice.GetByID(v.UserId).Data);
            }

            requested.UserInfo = uInfo;
            requested.totalAvg = totList;
            return(View(requested));
        }
示例#3
0
        private RequestedMemberModel getall(int id)
        {
            RequestedMemberModel requested = new RequestedMemberModel();
            var result = response.GetAll(id);

            var result2 = postProjectDao.GetByID(id);

            requested.ProjectName = result2.Data.ProjectName;
            requested.Description = result2.Data.Description;
            requested.PostId      = result2.Data.PostId;
            foreach (var user in result)
            {
                var result3 = userDao.GetById(user.WUserId);
                requested.UserInfo.Add(result3.Data);
            }
            return(requested);
        }
示例#4
0
        public ActionResult RequestedMember(int id)
        {
            RequestedMemberModel requested = getall(id);

            return(View(requested));
        }