Beispiel #1
0
        public async Task <byte[]> GetAsync(int companyId, CancellationToken token = default(CancellationToken))
        {
            var report = new CustomerGroupSectionReport();

            return((await report.BuildAsync("債権代表者マスター" + DateTime.Today.ToString("yyyyMMdd"),
                                            companyQueryProcessor.GetAsync(new CompanySearch {
                Id = companyId
            }, token),
                                            customerGroupByIdQueryProcessor.GetAsync(new CustomerGroupSearch {
                CompanyId = companyId,
            }, token)))?.Convert());
        }
Beispiel #2
0
        public void Print()
        {
            try
            {
                ClearStatusMessage();
                var customerGroupReport = new CustomerGroupSectionReport();
                var serverPath          = string.Empty;
                var messageId           = string.Empty;
                ProgressDialog.Start(ParentForm, Task.Run(async() =>
                {
                    serverPath = await GetServerPath();
                    List <CustomerGroup> result = await GetPrintDataAsync();
                    if (!result.Any())
                    {
                        messageId = MsgWngPrintDataNotExist;
                        return;
                    }
                    customerGroupReport.SetBasicPageSetting(Login.CompanyCode, Login.CompanyName);
                    customerGroupReport.Name       = "債権代表者マスター" + DateTime.Today.ToString("yyyyMMdd");
                    customerGroupReport.DataSource = result;
                    customerGroupReport.Run(true);
                }), false, SessionKey);

                if (!string.IsNullOrEmpty(messageId))
                {
                    ShowWarningDialog(messageId);
                    return;
                }

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