예제 #1
0
        public void SetGridTemplate()
        {
            if (UseForeignCurrency)
            {
                ReportSettingList = ReportSettingList.Where(x => x.ItemId != "ReportUnitPrice").ToList();
            }

            if (FromCustomerLedger && !UseSection)
            {
                ReportSettingList = ReportSettingList.Where(x => x.DisplayOrder != DisplaySectionCode).ToList();
            }

            grid.RowCount = ReportSettingList.Count;

            for (var i = 0; i < ReportSettingList.Count; i++)
            {
                var reportSetting = new ReportSetting();
                reportSetting = ReportSettingList[i];

                var settingList = new List <Setting>();
                settingList = reportSetting.SettingList;

                var textCellName = (GcTextBoxCell)grid.Rows[i].Cells[0];
                textCellName.Value = reportSetting.Caption;

                if (reportSetting.IsText != 1)
                {
                    var comboCellValue = (ComboBoxCell)grid.Rows[i].Cells[1];
                    comboCellValue.Items.Clear();

                    comboCellValue.DataSource     = settingList;
                    comboCellValue.ValueMember    = "ItemKey";
                    comboCellValue.DisplayMember  = "ItemValue";
                    comboCellValue.Value          = reportSetting.ItemKey;
                    grid.Rows[i].Cells[2].Visible = false;
                }
                else
                {
                    var textCellValue = (GcTextBoxCell)grid.Rows[i].Cells[2];

                    if (reportSetting.Caption == ReportDueCommentName)
                    {
                        textCellValue.Value = !string.IsNullOrEmpty(reportSetting.ItemKey)
                            ? reportSetting.ItemKey : ReportDueCommentValue;
                    }
                    else
                    {
                        textCellValue.Value = reportSetting.ItemKey;
                    }

                    grid.Rows[i].Cells[1].Visible = false;
                }
            }
        }
예제 #2
0
        private async Task InitializeLoadDataAsync()
        {
            var tasks = new List <Task> {
                LoadCompanyAsync(),
                LoadApplicationControlAsync(),
                LoadControlColorAsync()
            };
            await Task.WhenAll(tasks);

            var result = await LoadListAsync();

            ReportSettingList.AddRange(result);

            var itemIds = ReportSettingList
                          .GroupBy(r => r.ItemId).Select(g => g.Key)
                          .ToArray();

            SettingList = await LoadSettingListAsync(itemIds);
        }
예제 #3
0
        public void Save()
        {
            if (!ShowConfirmDialog(MsgQstConfirmSave))
            {
                DispStatusMessage(MsgInfProcessCanceled);
                return;
            }

            if (ReportSettingList.Count <= 0 || !ValidateInput())
            {
                return;
            }

            try
            {
                ReportSettingsResult result = null;
                var reportSetting           = ReportSettingList.ToArray();
                ProgressDialog.Start(ParentForm, Task.Run(async() =>
                {
                    result = await ServiceProxyFactory.DoAsync(async(ReportSettingMasterClient client)
                                                               => await client.SaveAsync(SessionKey, reportSetting));
                }), false, SessionKey);

                if (result.ProcessResult.Result)
                {
                    DispStatusMessage(MsgInfSaveSuccess);
                    Modified     = false;
                    SettingSaved = true;
                }
                else
                {
                    ShowWarningDialog(MsgErrSaveError);
                }
            }
            catch (Exception ex)
            {
                Debug.Fail(ex.ToString());
                NLogHandler.WriteErrorLog(this, ex, SessionKey);
            }
        }
예제 #4
0
        public bool ValidateInput()
        {
            SetReportSettingInfo();

            var totalByDayNone = ReportSettingList.Exists(
                x => x.Caption == "請求データ集計" &&
                x.ItemKey == "2" &&
                x.ItemValue == "しない");

            var totalOnly = ReportSettingList.Exists(
                x => x.Caption == "伝票集計方法" &&
                x.ItemKey == "0" &&
                x.ItemValue == "合計");

            if (FromCustomerLedger && totalByDayNone && totalOnly)
            {
                ShowWarningDialog(MsgWngNotAllowedSheetSummaryWhenBillingSummary);
                return(false);
            }

            var doPageBreak = ReportSettingList.Exists(
                x => x.Caption == "請求部門ごと改ページ" &&
                x.ItemKey == "1" &&
                x.ItemValue == "する");

            var hideDepartment = ReportSettingList.Exists(
                x => x.Caption == "請求部門ごと表示" &&
                x.ItemKey == "0" &&
                x.ItemValue == "しない");

            if (FromCollectionSchedule && doPageBreak && hideDepartment)
            {
                ShowWarningDialog(MsgWngNotAllowedDeptPageBreakeWhenNotDisplay);
                return(false);
            }

            return(true);
        }