private void PC1503_Load(object sender, EventArgs e) { try { InitializeFunctionKeys(); AddHandlers(); SetScreenName(); var tasks = new List <Task>(); if (ApplicationControl == null) { tasks.Add(LoadApplicationControlAsync()); } tasks.Add(LoadControlColorAsync()); if (Company == null) { tasks.Add(LoadCompanyAsync()); } var taskGetSetting = GetPdfOutputSetting(); tasks.Add(taskGetSetting); ProgressDialog.Start(ParentForm, Task.WhenAll(tasks.ToArray()), false, SessionKey); SetOdfOutputSetting(taskGetSetting.Result); rdoAllInOne.Focus(); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void btnTemplatePatternSearch_Click(object sender, EventArgs e) { try { var templateSetting = this.ShowReminderTemplateSettingSearchDialog(); if (templateSetting != null) { TemplateId = templateSetting.Id; txtTemplatePatternNo.Text = templateSetting.Code; txtTemplatePatternName.Text = templateSetting.Name; txtTitle.Text = templateSetting.Title; txtGreeting.Text = templateSetting.Greeting; txtMainText.Text = templateSetting.MainText; txtSubText.Text = templateSetting.SubText; txtConclusion.Text = templateSetting.Conclusion; BaseContext.SetFunction03Enabled(true); txtTemplatePatternNo.Enabled = false; btnTemplatePatternSearch.Enabled = false; TemplateChangeFlg = false; } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void txtLevelPatternNo_Validated(object sender, EventArgs e) { string code = txtLevelPatternNo.Text; if (string.IsNullOrWhiteSpace(code)) { return; } ClearStatusMessage(); try { Task <ReminderTemplateSetting> task = GetTemplateSettingByCodeAsync(code); ProgressDialog.Start(ParentForm, task, false, SessionKey); ReminderTemplateSetting templateSetting = task.Result; if (templateSetting == null) { ShowWarningDialog(MsgWngNotRegistPatternNo, txtLevelPatternNo.Text); txtLevelPatternNo.Focus(); return; } lblLevelPatternName.Text = templateSetting.Name; TemplateId = templateSetting.Id; } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void txtCurrencyCode_Validated(object sender, EventArgs e) { ClearStatusMessage(); try { if (!string.IsNullOrWhiteSpace(txtCurrencyCode.Text)) { var task = ServiceProxyFactory.LifeTime(async factory => { var currency = await GetCurrencyInfo(); if (currency == null) { ShowWarningDialog(MsgWngMasterNotExist, "通貨", txtCurrencyCode.Text); txtCurrencyCode.Focus(); txtCurrencyCode.Clear(); } }); ProgressDialog.Start(ParentForm, task, false, SessionKey); } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void SaveData() { try { if (!ValidateChildren()) { return; } if (CheckData() && ValidateInputValue()) { if (!ShowConfirmDialog(MsgQstConfirmSave)) { DispStatusMessage(MsgInfProcessCanceled); return; } SaveGeneralSetting(); } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void Search() { try { ClearStatusMessage(); if (!ValidateForSearch()) { return; } var task = SearchReminderListAsync(); ProgressDialog.Start(ParentForm, task, false, SessionKey); if (!task.Result) { ShowWarningDialog(MsgErrSomethingError, "照会"); return; } } catch (Exception ex) { ShowWarningDialog(MsgErrSomethingError, "照会"); Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private async Task <bool> CreateReport() { try { SectionReport report; if (IsCustomerUnit) { var rimindeReport = new ReminderListByCustomerReport(); rimindeReport.SetBasicPageSetting(Login.CompanyCode, Login.CompanyName); report = rimindeReport; } else { var rimindeReport = new ReminderListByReminderReport(); rimindeReport.SetBasicPageSetting(Login.CompanyCode, Login.CompanyName); rimindeReport.lblDueDate.Text = ReminderCommonSetting.CalculateBaseDate == 0 ? "当初予定日" : "入金予定日"; report = rimindeReport; } report.DataSource = grid.DataSource; report.Run(); ShowDialogPreview(ParentForm, report, await GetServerPath()); return(true); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); return(false); } }
private void btnAdd_Click(object sender, EventArgs e) { try { this.ButtonClicked(btnAdd); ClearStatusMessage(); if (!CheckRangeData()) { return; } if (string.IsNullOrWhiteSpace(txtSectionFrom.Text) && string.IsNullOrWhiteSpace(txtSectionTo.Text)) { ShowWarningDialog(MsgWngInputRequired, "入金部門コード"); txtSectionFrom.Focus(); return; } Task <int> task = AddSectionAsync(); ProgressDialog.Start(ParentForm, task, false, SessionKey); grdLoginUserModify.DataSource = new BindingSource(ModifySection, null); ClearFromTo(); Modified = true; } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void Exit() { ClearStatusMessage(); if (Modified && IsConfirmRequired) { var result = ShowConfirmDialogYesNoCancel(MsgQstConfirmHasUpdateData, "終了"); if (result == DialogResult.Cancel) { return; } if (result == DialogResult.Yes) { try { if (!CheckRangeData()) { return; } SaveSectionWithLoginUser(); if (!CloseFlg) { return; } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } } } BaseForm.Close(); }
private void Save() { try { if (!ShowConfirmDialog(MsgQstConfirmSave)) { DispStatusMessage(MsgInfProcessCanceled); return; } var source = (grdEBFileFormatSetting.DataSource as BindingSource).DataSource as List <EBFileSetting>; var ids = GetIdForSave(); var saveTask = SaveAsync(ids); ProgressDialog.Start(ParentForm, saveTask, false, SessionKey); if (!saveTask.Result) { DispStatusMessage(MsgErrSaveError); return; } ProgressDialog.Start(ParentForm, LoadGridDataAsync(), false, SessionKey); DispStatusMessage(MsgInfSaveSuccess); } catch (Exception ex) { NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void btnDeleteAll_Click(object sender, EventArgs e) { try { this.ButtonClicked(btnDeleteAll); ClearStatusMessage(); if (!ModifySection.Any()) { ShowWarningDialog(MsgWngNoData, "削除"); return; } bool result = ShowConfirmDialog(MsgQstConfirmDeleteAll); if (result) { ModifySection.Clear(); grdLoginUserModify.DataSource = new BindingSource(ModifySection, null); Task <List <SectionWithLoginUser> > getTask = GetByLoginUser(); ProgressDialog.Start(ParentForm, getTask, false, SessionKey); OriginSection = getTask.Result; grdLoginUserOrigin.DataSource = new BindingSource(OriginSection, null); Modified = true; } ClearFromTo(); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void btnCustomerSearch_Click(object sender, EventArgs e) { try { var customer = this.ShowCustomerMinSearchDialog(); if (customer != null) { txtCustomerCode.Text = customer.Code; lblCustomerName.Text = customer.Name; CustomerId = customer.Id; var destinations = new List <Destination>(); ProgressDialog.Start(ParentForm, Task.Run(async() => { destinations = await GetDestinationListAsync(CustomerId); }), false, SessionKey); grdDestination.DataSource = new BindingSource(destinations, null); txtCustomerCode.Enabled = false; btnCustomerSearch.Enabled = false; txtDestinationCode.Enabled = true; txtDestinationCode.Focus(); ClearStatusMessage(); } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void PB2201_Load(object sender, EventArgs e) { try { SetScreenName(); var loadTask = new List <Task>(); if (ApplicationControl == null) { loadTask.Add(LoadApplicationControlAsync()); } if (Company == null) { loadTask.Add(LoadCompanyAsync()); } loadTask.Add(LoadControlColorAsync()); ProgressDialog.Start(ParentForm, Task.WhenAll(loadTask), false, SessionKey); SetFormat(); InitializeGrid(); SetHonorificCombo(); Clear(); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private async Task <bool> SaveDestination() { var destination = PrepareDestinationData(); var result = false; try { var webResult = await SaveDestinationAsync(destination); if (webResult.ProcessResult.Result) { var destinations = await GetDestinationListAsync(CustomerId); grdDestination.DataSource = new BindingSource(destinations, null); ClearInputFields(); result = true; } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } return(result); }
private void OutputReport() { ClearStatusMessage(); var pathTask = Util.GetGeneralSettingServerPathAsync(Login); var createTask = CreateReportAsync(); var tasks = new List <Task> { pathTask, createTask }; ProgressDialog.Start(ParentForm, Task.WhenAll(tasks), false, SessionKey); if (pathTask.Exception != null) { NLogHandler.WriteErrorLog(this, pathTask.Exception, SessionKey); ShowWarningDialog(MsgErrCreateReportError); return; } if (createTask.Exception != null) { NLogHandler.WriteErrorLog(this, createTask.Exception, SessionKey); ShowWarningDialog(MsgErrCreateReportError); return; } var path = pathTask.Result; var report = createTask.Result; if (report == null) { ShowWarningDialog(MsgErrCreateReportError); return; } ShowDialogPreview(ParentForm, report); }
private void PF0601_Load(object sender, EventArgs e) { try { SetScreenName(); var loadTask = new List <Task>(); if (ApplicationControl == null) { loadTask.Add(LoadApplicationControlAsync()); } loadTask.Add(LoadControlColorAsync()); if (Company == null) { loadTask.Add(Task.Run(async() => { await LoadCompanyAsync(); await LoadReportSettingAsync(); })); } ProgressDialog.Start(ParentForm, Task.WhenAll(loadTask), false, SessionKey); SetDataFormat(); ClearCollectionSchedule(); if (UseForeignCurrency) { dlblPriceUnit.Visible = false; lblAmountUnit.Visible = false; } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void Read() { try { grdImportItems.EndEdit(); ClearStatusMessage(); if (!CheckValidate()) { return; } if (!ShowConfirmDialog(MsgQstConfirmReading)) { DispStatusMessage(MsgInfProcessCanceled); return; } ReadFiles(); } catch (Exception ex) { Debug.Fail(ex.Message); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void Search() { try { ClearStatusMessage(); if (!ValidateSearch()) { return; } var loadTask = new List <Task>(); loadTask.Add(SearchCalendarGrid()); ProgressDialog.Start(ParentForm, Task.WhenAll(loadTask), false, SessionKey); datFromHoliday.Enabled = false; datToHoliday.Enabled = false; datAddDate.Enabled = true; btnAddDate.Enabled = true; datAddDate.Select(); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void Print() { try { ClearStatusMessage(); if (grid.RowCount == 0) { DispStatusMessage(MsgWngSelectionRequired, "印刷するデータ"); return; } var task = CreateReport(); ProgressDialog.Start(ParentForm, task, false, SessionKey); if (!task.Result) { ShowWarningDialog(MsgErrSomethingError, "照会"); return; } } catch (Exception ex) { ShowWarningDialog(MsgErrSomethingError, "照会"); Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void Import() { ClearStatusMessage(); try { ImportSetting importSetting = null; var task = Util.GetMasterImportSettingAsync(Login, ImportFileType.HolidayCalendar); ProgressDialog.Start(ParentForm, task, false, SessionKey); importSetting = task.Result; var definition = new HolidayCalendarFileDefinition(new DataExpression(ApplicationControl)); var importer = definition.CreateImporter(m => m.Holiday); importer.UserId = Login.UserId; importer.UserCode = Login.UserCode; importer.CompanyId = CompanyId; importer.CompanyCode = Login.CompanyCode; importer.LoadAsync = async() => await GetHolidayCalendarAsync(); importer.RegisterAsync = async unitOfWork => await RegisterForImportAsync(unitOfWork); DoImport(importer, importSetting, Clear); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); ShowWarningDialog(MsgErrImportErrorWithoutLog); } }
private void PI0201_Load(object sender, EventArgs e) { try { SetScreenName(); var loadTask = new List <Task>(); if (ApplicationControl == null) { loadTask.Add(LoadApplicationControlAsync()); } loadTask.Add(LoadControlColorAsync()); if (Company == null) { loadTask.Add(LoadCompanyAsync()); } loadTask.Add(LoadStatusComboAsync()); loadTask.Add(LoadReminderCommonSetting()); ProgressDialog.Start(ParentForm, Task.WhenAll(loadTask), false, SessionKey); SuspendLayout(); tbcReminder.SelectedIndex = 0; ResumeLayout(); SetInitialSetting(); ClearControls(); grid.Text = ""; } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void Delete() { ZeroLeftPaddingWithoutValidated(); var isValid = ValidateForDelete(); if (!isValid) { return; } if (!ShowConfirmDialog(MsgQstConfirmDelete)) { DispStatusMessage(MsgInfProcessCanceled); return; } try { Task <bool> deleteTask = DeleteStaffInfo(); ProgressDialog.Start(ParentForm, deleteTask, false, SessionKey); if (deleteTask.Result) { Clear(); DispStatusMessage(MsgInfDeleteSuccess); } else { ShowWarningDialog(MsgErrDeleteError); } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private bool LoadPcaCompanyInfo() { var companyInfo = string.Empty; var task = Task.Run(async() => { var selected = await client.SelectDataAreaAsync(SelectAreaForm.SelectByGUI); if (!selected) { return; } var comp = await client.GetCompAsync(); companyInfo = comp.GetCompanyInfo(); }); ProgressDialog.Start(ParentForm, task, false, SessionKey); if (task.Exception != null) { NLogHandler.WriteErrorLog(this, task.Exception, SessionKey); return(false); } if (string.IsNullOrEmpty(companyInfo)) { return(false); } if (client.TokenRefreshed) { SetToken(); } SetResponseMessage(companyInfo); return(true); }
//CellDoubleClickEvent private void grdStaff_CellDoubleClick(object sender, CellEventArgs e) { if (e.Scope != CellScope.Row || e.RowIndex < 0) { return; } if (Modified && !ShowConfirmDialog(MsgQstConfirmUpdateData)) { return; } try { ClearStatusMessage(); txtStaffCode.Text = grdStaff.Rows[e.RowIndex].Cells[1].DisplayText; Task <bool> task = DisplayFocusOutDatas_Binding(); ProgressDialog.Start(ParentForm, task, false, SessionKey); if (task.Result) { ClearStatusMessage(); txtStaffName.Focus(); } else { DispStatusMessage(MsgInfNewData, "営業担当者コード"); txtStaffName.Focus(); } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void cmbReminderLevel_SelectedIndexChanged(object sender, EventArgs e) { if (cmbReminderLevel.SelectedItem == null) { return; } try { Task <ReminderLevelSettingResult> task = GetLevelSettingByLevelAsync(int.Parse(cmbReminderLevel.SelectedItem.Text)); ProgressDialog.Start(ParentForm, task, false, SessionKey); if (task.Result.ProcessResult.Result) { LevelSetting = task.Result.ReminderLevelSetting; TemplateId = LevelSetting.ReminderTemplateId; txtLevelPatternNo.Text = LevelSetting.ReminderTemplateCode; lblLevelPatternName.Text = LevelSetting.ReminderTemplateName; nmbArrearDays.Value = Convert.ToInt32(LevelSetting.ArrearDays); BaseContext.SetFunction03Enabled(true); LevelChangeFlg = false; } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void txt_StaffCode_Validated(object sender, EventArgs e) { try { if (!string.IsNullOrEmpty(txtStaffCode.Text)) { Task <bool> task = DisplayFocusOutDatas_Binding(); ProgressDialog.Start(ParentForm, task, false, SessionKey); if (task.Result) { ClearStatusMessage(); } else { DispStatusMessage(MsgInfNewData, "営業担当者コード"); txtStaffName.Focus(); } } else { ClearStatusMessage(); Modified = false; } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void Save() { try { ClearStatusMessage(); switch (tbcReminderSetting.SelectedIndex) { case (int)SettingTabIndex.CommonSetting: SaveReminderCommonSettings(); break; case (int)SettingTabIndex.TemplateSetting: SaveReminderTemplateSettings(); break; case (int)SettingTabIndex.LevelSetting: SaveReminderLevelSettings(); break; case (int)SettingTabIndex.SummarySetting: if (!IsExistReminderData) { SaveReminderSummarySettings(); } break; } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void txt_DepartmentCode_Validated(object sender, EventArgs e) { try { if (!string.IsNullOrEmpty(txtDepartmentCode.Text)) { Task <bool> task = DisplayFocusOutData_DepartmentName(); ProgressDialog.Start(ParentForm, task, false, SessionKey); if (task.Result) { ClearStatusMessage(); } else { ShowWarningDialog(MsgWngMasterNotExist, "請求部門", txtDepartmentCode.Text); txtDepartmentCode.Clear(); lblDepartmentName.Clear(); txtDepartmentCode.Focus(); } } else { txtDepartmentCode.Clear(); lblDepartmentName.Clear(); ClearStatusMessage(); } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void txtCode_Validated(object sender, EventArgs e) { try { if (!string.IsNullOrEmpty(txtCode.Text)) { Task <AccountTitle> task = RetrieveData(); ProgressDialog.Start(ParentForm, task, false, SessionKey); if (task.Result == null) { DispStatusMessage(MsgInfSaveNewData, "科目"); } else { ClearStatusMessage(); } } else { ClearStatusMessage(); } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void Save() { try { ClearStatusMessage(); if (!ValidateForSave()) { return; } if (!ShowConfirmDialog(MsgQstConfirmSave)) { DispStatusMessage(MsgInfProcessCanceled); return; } var task = SavePdfOutputSetting(GetInputedValues()); var result = ProgressDialog.Start(ParentForm, task, false, SessionKey); SetOdfOutputSetting(task.Result); DispStatusMessage(MsgInfSaveSuccess); } catch (Exception ex) { ShowWarningDialog(MsgErrSaveError); Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }