public async Task GetFilesAsync()
            {
                PlanFiles.Clear();
                PlanFileSearchResult SearchResult = await DataPlanFileRepository.ReadFiles(SearchCondition);

                if (SearchResult == null)
                {
                    return;
                }

                SearchCondition.RecordCount = SearchResult.SearchCondition.RecordCount;

                if (SearchResult.RecordList != null && SearchResult.RecordList.Count > 0)
                {
                    SearchResult.RecordList.ToList().ForEach(e =>
                    {
                        PlanFiles.Add(e);
                    });
                }
                if (SearchCondition.PageCount > 1)
                {
                    CanVisible = "Visible";
                }
                else
                {
                    CanVisible = "Collapsed";
                }
            }
예제 #2
0
            public async Task Init_PlanInfoVMAsync(Lib.PlanEntity P_Entity)
            {
                CurPlan = P_Entity;
                if (PlanFiles.Count < 1)
                {
                    //如果该计划的附件文件没有读取则读取之。
                    PlanFileSearch mSearchFile = new PlanFileSearch()
                    {
                        PlanId = P_Entity.Id, UserId = AppSet.LoginUser.Id
                    };
                    PlanFileSearchResult planFileSearchResult = await DataPlanFileRepository.ReadFiles(mSearchFile);

                    if (planFileSearchResult != null && planFileSearchResult.RecordList != null)
                    {
                        planFileSearchResult.RecordList.ToList().ForEach(e =>
                        {
                            e.UpIntProgress = 100;

                            PlanFiles.Add(e);
                        });
                    }
                }
                if (CurPlan.CreateUserId != null)
                {
                    CurPlanCreateUserName = AppSet.SysUsers.Where(e => CurPlan.CreateUserId.Equals(e.Id, System.StringComparison.Ordinal)).Select(x => x.Name).FirstOrDefault()?.Trim();
                }
                if (CurPlan.ResponsiblePerson != null)
                {
                    CurPlanResponsibleName = AppSet.SysUsers.Where(e => CurPlan.ResponsiblePerson.Equals(e.Id, System.StringComparison.Ordinal)).Select(x => x.Name).FirstOrDefault()?.Trim();
                }
                if (CurPlan.ReadGrant != null)
                {
                    CurPlanHasGrantNames = string.Join(",", AppSet.SysUsers.Where(e => CurPlan.ReadGrant.Contains(e.Id, System.StringComparison.Ordinal)).Select(x => x.Name)?.ToArray());
                }
                if (CurPlan.Helpers != null)
                {
                    CurPlanHelperNames = string.Join(",", AppSet.SysUsers.Where(e => CurPlan.Helpers.Contains(e.Id, System.StringComparison.Ordinal)).Select(x => x.Name)?.ToArray());
                }
            }