public async Task <byte[]> GetAsync(int companyId, CancellationToken token = default(CancellationToken))
        {
            var report = new SectionWithLoginUserReport();

            return((await report.BuildAsync("入金部門・担当者対応マスター一覧" + DateTime.Now.ToString("yyyyMMdd"),
                                            companyQueryProcessor.GetAsync(new CompanySearch {
                Id = companyId
            }, token),
                                            sectionWithLoginUserQueryProcessor.GetAsync(new SectionWithLoginUserSearch {
                CompanyId = companyId,
            }, token)))?.Convert());
        }
Esempio n. 2
0
        private void Print()
        {
            try
            {
                ClearStatusMessage();
                List <SectionWithLoginUser> list = null;
                string serverPath = null;
                SectionWithLoginUserReport sectionWithLoginUserReport = null;
                ProgressDialog.Start(ParentForm, Task.Run(async() =>
                {
                    list = await SectionWithLoginUserData();
                    if (!list.Any())
                    {
                        return;
                    }

                    serverPath = await GetServerPath();

                    sectionWithLoginUserReport = new SectionWithLoginUserReport();
                    sectionWithLoginUserReport.SetBasicPageSetting(Login.CompanyCode, Login.CompanyName);
                    sectionWithLoginUserReport.Name = "入金部門・担当者対応マスター一覧" + DateTime.Now.ToString("yyyyMMdd");
                    sectionWithLoginUserReport.SetData(list);
                    sectionWithLoginUserReport.Run(true);
                }), false, SessionKey);

                if (!list.Any())
                {
                    ShowWarningDialog(MsgWngPrintDataNotExist);
                    return;
                }

                ShowDialogPreview(ParentForm, sectionWithLoginUserReport, serverPath);
            }
            catch (Exception ex)
            {
                Debug.Fail(ex.ToString());
                NLogHandler.WriteErrorLog(this, ex, SessionKey);
                ShowWarningDialog(MsgErrCreateReportError);
            }
        }