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)); }
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)); }
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)); }
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)); }
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)); }
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); }