コード例 #1
0
        public IHttpActionResult GetById(string Id)
        {
            Guid _Id;

            if (!Guid.TryParse(Id, out _Id))
            {
                return(Ok());
            }
            var entity = ClosureWOCheckList.Get(_Id);

            if (entity != null)
            {
                ProjectCommentCondition condition = new ProjectCommentCondition();
                condition.RefTableId   = entity.Id;
                condition.RefTableName = ClosureWOCheckList.TableName;
                condition.UserAccount  = ClientCookie.UserCode;
                condition.Status       = ProjectCommentStatus.Save;
                var commentList = ProjectComment.SearchList(condition);
                if (commentList != null && commentList.Count > 0)
                {
                    entity.Comments = commentList[0].Content;
                }
                var closureEntity = ClosureInfo.GetByProjectId(entity.ProjectId);
                entity.USCode      = closureEntity.USCode;
                entity.UserAccount = ClientCookie.UserCode;
            }
            return(Ok(entity));
        }
コード例 #2
0
        public IHttpActionResult GetConsInfo(string projectId, string entityId = "")
        {
            var entity = ReimageConsInfo.GetConsInfo(projectId, entityId);

            if (entity != null)
            {
                var condition = new ProjectCommentCondition();
                condition.SourceCode  = FlowCode.Reimage;
                condition.UserAccount = ClientCookie.UserCode;

                condition.RefTableId   = entity.Id;
                condition.RefTableName = "ReimageConsInfo";

                var comments = ProjectComment.SearchList(condition);
                if (comments != null && comments.Count > 0)
                {
                    entity.ProjectComments = comments;

                    var saveComment =
                        comments.OrderByDescending(e => e.CreateTime)
                        .FirstOrDefault(e => e.Status == ProjectCommentStatus.Save);
                    if (saveComment != null)
                    {
                        entity.Comments = saveComment.Content;
                    }
                }
            }

            return(Ok(entity));
        }
コード例 #3
0
        public IHttpActionResult GetByProjectId(string projectId)
        {
            var entity = ClosureConsInvtChecking.FirstOrDefault(e => e.ProjectId == projectId && e.IsHistory == false);

            if (entity != null)
            {
                var closureInfo = ClosureInfo.GetByProjectId(projectId);
                entity.USCode = closureInfo.USCode;
                ProjectCommentCondition condition = new ProjectCommentCondition();
                condition.RefTableId   = entity.Id;
                condition.RefTableName = ClosureWOCheckList.TableName;
                condition.UserAccount  = ClientCookie.UserCode;
                condition.Status       = ProjectCommentStatus.Save;
                var commentList = ProjectComment.SearchList(condition);
                if (commentList != null && commentList.Count > 0)
                {
                    entity.Comments = commentList[0].Content;
                }

                if (string.IsNullOrEmpty(entity.PMSupervisor))
                {
                    var puser = ProjectUsers.FirstOrDefault(i => i.ProjectId == entity.ProjectId && i.RoleCode == ProjectUserRoleCode.CM);
                    if (puser != null)
                    {
                        entity.PMSupervisor = puser.UserAccount;
                    }
                }
            }

            return(Ok(entity));
        }
コード例 #4
0
        public IHttpActionResult GetClosureCommers(string userAccount, string refTableName, Guid refTableId)
        {
            ProjectCommentCondition condition = new ProjectCommentCondition();

            condition.SourceCode  = FlowCode.Closure;
            condition.UserAccount = userAccount;
            condition.RefTableId  = refTableId;
            ProjectComment.SearchList(condition);
            var list = _db.ProjectComment.Where(e => e.RefTableName == refTableName && e.RefTableId == refTableId &&
                                                string.IsNullOrEmpty(e.Content) && e.SourceCode == "Closure").OrderByDescending(e => e.CreateTime);

            return(Ok(list));
        }
コード例 #5
0
        public IHttpActionResult GetByProjectId(string projectId)
        {
            var entity = ClosureWOCheckList.Get(projectId);

            if (entity != null)
            {
                ProjectCommentCondition condition = new ProjectCommentCondition();
                condition.RefTableId   = entity.Id;
                condition.RefTableName = ClosureWOCheckList.TableName;
                condition.UserAccount  = ClientCookie.UserCode;
                condition.Status       = ProjectCommentStatus.Save;
                var commentList = ProjectComment.SearchList(condition);
                if (commentList != null && commentList.Count > 0)
                {
                    entity.Comments = commentList[0].Content;
                }
                var closureEntity = ClosureInfo.GetByProjectId(entity.ProjectId);
                entity.USCode      = closureEntity.USCode;
                entity.UserAccount = ClientCookie.UserCode;

                if (string.IsNullOrEmpty(entity.PMSupervisorAccount))
                {
                    var puser = ProjectUsers.FirstOrDefault(i => i.ProjectId == entity.ProjectId && i.RoleCode == ProjectUserRoleCode.CM);
                    if (puser != null)
                    {
                        entity.PMSupervisorAccount = puser.UserAccount;
                    }
                }
                // entity.Comments = GetCommers(entity);
                //string pmAccount = closureEntity.PMAccount;
                //entity.PMSupervisorAccount = userPositionHandler.GetReportToAccounts(pmAccount);
                //string[] accounts = {UserPositionHandler.IT,UserPositionHandler.MCCL_Construction_Mgr};



                //var positionlist = userPositionHandler.SearchUserPosition(closureEntity.USCode,accounts);
                //string mcclApprover = userPositionHandler.GetAccounts(positionlist);
                //entity.MCCLApproverAccount = mcclApprover;
            }
            return(Ok(entity));
        }
コード例 #6
0
        public ClosureLegalReview GetByProjectId(string projectId, string userAccount)
        {
            ClosureLegalReview entity = ClosureLegalReview.Get(projectId);

            if (entity != null)
            {
                ProjectCommentCondition condition = new ProjectCommentCondition();
                condition.SourceCode   = FlowCode.Closure;
                condition.UserAccount  = userAccount;
                condition.RefTableId   = entity.Id;
                condition.RefTableName = ClosureLegalReview.TableName;
                condition.Status       = ProjectCommentStatus.Save;

                var comments = ProjectComment.SearchList(condition);
                if (comments != null && comments.Count > 0)
                {
                    entity.Comments = comments[0].Content;
                }
            }


            return(entity);
        }