private async Task <int> SearchReminderOutputedAsync(ReminderOutputedSearch search) { var result = new ReminderOutputedResult(); decimal totalAmount = 0m; int count = 0; await ServiceProxyFactory.DoAsync <ReminderServiceClient>(async client => { result = await client.GetOutputedItemsAsync(SessionKey, SearchCondition); grdReminder.DataSource = new BindingSource(result.ReminderOutputed, null); if (result.ProcessResult.Result) { count = result.ReminderOutputed.Count; } if (count > 0) { totalAmount = result.ReminderOutputed.Sum(x => x.RemainAmount); tbcReminder.SelectedTab = tabReminderResult; BaseContext.SetFunction03Enabled(true); BaseContext.SetFunction08Enabled(true); BaseContext.SetFunction09Enabled(true); } else { tbcReminder.SelectedTab = tabReminderSearch; grdReminder.DataSource = null; BaseContext.SetFunction03Enabled(false); BaseContext.SetFunction08Enabled(false); BaseContext.SetFunction09Enabled(false); } }); return(count); }
private async Task <AccountTransferDetailsResult> SaveLogAsync(IEnumerable <AccountTransferDetail> details) => await ServiceProxyFactory.DoAsync(async (AccountTransferServiceClient client) => { AccountTransferDetailsResult result = null; result = await client.SaveAsync(SessionKey, details.ToArray(), DoAggregate); return(result); });
/// <summary>承認処理</summary> private void ApprovalMatching(MatchingHeader[] headers) { var success = true; var updateValid = true; var task = ServiceProxyFactory.DoAsync(async(MatchingServiceClient client) => { var result = await client.ApproveAsync(SessionKey, headers); success = result?.ProcessResult.Result ?? false; updateValid = !(result.ProcessResult.ErrorCode == Rac.VOne.Common.ErrorCode.OtherUserAlreadyUpdated); if (success) { await SearchMatchedData(); } }); ProgressDialog.Start(ParentForm, task, false, SessionKey); if (!updateValid) { ShowWarningDialog(MsgWngAlreadyUpdated); return; } if (!success) { ShowWarningDialog(MsgErrApprovalError); return; } DispStatusMessage(MsgInfApprovalSuccess); }
private async Task <CountResult> DeleteStatusAsync(int Id) => await ServiceProxyFactory.DoAsync(async (StatusMasterClient client) => { CountResult result = null; result = await client.DeleteAsync(SessionKey, Id); return(result); });
private async Task <ExistResult> ExistReminderHistoryAsync(int Id) => await ServiceProxyFactory.DoAsync(async (StatusMasterClient client) => { ExistResult result = null; result = await client.ExistReminderHistoryAsync(SessionKey, Id); return(result); });
private async Task <List <Status> > GetStatusListAsync() => await ServiceProxyFactory.DoAsync(async (StatusMasterClient client) => { StatusesResult results = null; results = await client.GetStatusesByStatusTypeAsync(SessionKey, CompanyId, StatusType); return(results.Statuses); });
private async Task <StatusResult> SaveStatusAsync(Status status) => await ServiceProxyFactory.DoAsync(async (StatusMasterClient client) => { StatusResult result = null; result = await client.SaveAsync(SessionKey, status); return(result); });
private async Task <Status> GetStatusAsync(string code) => await ServiceProxyFactory.DoAsync(async (StatusMasterClient client) => { StatusResult result = null; result = await client.GetStatusByCodeAsync(SessionKey, CompanyId, StatusType, code); return(result.Status); });
private async Task LoadImporterSettingAsync(string code) => await ServiceProxyFactory.DoAsync <ImporterSettingServiceClient>(async client => { var result = await client.GetHeaderByCodeAsync(SessionKey, CompanyId, (int)Rac.VOne.Common.Constants.FreeImporterFormatType.Receipt, code); if (result?.ImporterSetting != null) { ImporterSetting = result.ImporterSetting; txtFilePath.Text = result.ImporterSetting.InitialDirectory; lblName.Text = result.ImporterSetting.Name; txtFilePath.Enabled = !LimitAccessFolder; txtFilePath.ReadOnly = LimitAccessFolder; txtCode.Enabled = false; btnCode.Enabled = false; if (!LimitAccessFolder) { ActiveControl = txtFilePath; txtFilePath.Focus(); } ClearStatusMessage(); btnPath.Enabled = true; BaseContext.SetFunction05Enabled(false); Modified = false; } else { ShowWarningDialog(MsgWngNotRegistPatternNo, txtCode.Text); txtCode.Clear(); lblName.Clear(); txtFilePath.Clear(); Modified = true; BaseContext.SetFunction05Enabled(true); } });
private async Task <List <LogData> > LoadGrid() { List <LogData> logs = null; DateTime? dateTo = null; string loginCode = null; if (datLoggedAtTo.Value.HasValue) { dateTo = datLoggedAtTo.Value.Value.AddDays(1).AddMilliseconds(-1); } if (txtLoginUserCode.Text != "") { loginCode = txtLoginUserCode.Text; } await ServiceProxyFactory.DoAsync <LogDataServiceClient>(async client => { var logData = await client.GetItemsAsync(SessionKey, CompanyId, datLoggedAtFrom.Value, dateTo, loginCode); if (logData.ProcessResult.Result && logData.LogData.Any()) { logs = logData.LogData; } }); return(logs ?? new List <LogData>()); }
private void Initialize() { GetImporterSettingAsync = (settingId) => Util.GetImporterSettingAsync(Login, (int)Constants.FreeImporterFormatType.Billing, settingId); GetImporterSettingDetailAsync = (settingId) => Util.GetImporterSettingDetailByIdAsync(Login, settingId); GetCurrencyAsync = (companyId) => Util.GetCurrenciesAsync(Login, null); GetJuridicalParsonalitiesAsync = (companyId) => Util.GetLegalPersonaritiesAsync(Login); GetGeneralSettingValueAsync = async(companyId, code) => (await Util.GetGeneralSettingAsync(Login, code))?.Value; GetTaxClassAsync = () => Util.GetTaxClassAsync(Login); GetBillingDivisionContractByCustomerIdsAsync = (ids) => Util.GetBillingDivisionContractByCustomerIdsAsync(Login, ids.ToArray()); GetHolidayCalendarsAsync = companyId => Util.GetHolidayCalendarsAsync(Login); LoadColumnNameSettingsInnerAsync = tableName => ServiceProxyFactory.DoAsync(async(ColumnNameSettingMasterClient client) => { var result = await client.GetItemsAsync(SessionKey, CompanyId); if (result.ProcessResult.Result) { return(result.ColumnNames.Where(x => x.TableName == tableName).ToArray()); } return(new ColumnNameSetting[] { }); }); BillingImportDuplicationCheckAsync = async(companyId, items, details) => await ServiceProxyFactory.DoAsync(async (BillingServiceClient client) => (await client.BillingImportDuplicationCheckAsync(SessionKey, companyId, items, details)).RowNumbers); ImportInnerAsync = (companyId, loginUserId, settingId, items) => ServiceProxyFactory.DoAsync((BillingServiceClient client) => client.ImportAsync(SessionKey, companyId, loginUserId, settingId, items)); GetCustomerByCodesAsync = (companyId, codes) => Util.GetCustomerByCodesAsync(Login, codes); GetDepartmentByCodesAsync = (companyId, codes) => Util.GetDepartmentByCodesAsync(Login, codes); GetAccountTitleByCodesAsync = (companyId, codes) => Util.GetAccountTitleByCodesAsync(Login, codes); GetStaffByCodesAsync = (companyId, codes) => Util.GetStaffByCodesAsync(Login, codes); GetCategoriesByCodesAsync = (companyId, categoryType, codes) => Util.GetCategoriesByCodesAsync(Login, categoryType, codes); GetIsEnableToEditNoteAsync = (companyId) => Util.IsControlInputNoteAsync(Login); }
private async Task <bool> DeleteAccountTitleAsync() { var success = false; IEnumerable <IMasterData> accountTitles = null; await ServiceProxyFactory.DoAsync(async (AccountTitleMasterClient client) => { if (DeletePostProcessor != null) { var result = await client.GetAsync(SessionKey, new int[] { AccountTitleId }); if (result.ProcessResult.Result) { accountTitles = result.AccountTitles; } } var deleteResult = await client.DeleteAsync(SessionKey, AccountTitleId); success = (deleteResult?.ProcessResult.Result ?? false) && deleteResult?.Count > 0; }); var syncResult = true; if (DeletePostProcessor != null && success) { syncResult = DeletePostProcessor.Invoke(accountTitles); } success &= syncResult; if (success) { await LoadGrid(); } return(success); }
private async Task <List <Category> > LoadCategoryFlagComboAsync() => await ServiceProxyFactory.DoAsync(async (CategoryMasterClient client) => { CategorySearch categorySearch = new CategorySearch(); categorySearch.CompanyId = CompanyId; categorySearch.CategoryType = 4; var result = await client.GetItemsAsync(SessionKey, categorySearch); if (result != null || result.ProcessResult.Result) { var CategoryList = result.Categories; for (int i = 0; i < CategoryList.Count; i++) { cmbCategoryFlag.Items.Add(new ListItem(CategoryList[i].CodeAndName, CategoryList[i].Id)); } cmbCategoryFlag.SelectedIndex = 0; return(result.Categories); } else { return(null); } });
/// <summary>Delete ImportFileLog Data</summary> private void DeleteImportFileLog() { var importFileLogIds = grdHistory.Rows .Select(x => x.DataBoundItem as ImportFileLog) .Where(x => x.DoDelete) .Select(x => x.Id).ToArray(); ImportFileLogsResult result = null; var task = ServiceProxyFactory.DoAsync(async(ImportFileLogServiceClient client) => { result = await client.DeleteItemsAsync(SessionKey, importFileLogIds.ToArray()); if (result.ProcessResult.Result) { DispStatusMessage(MsgInfDeleteSuccess); await LoadHistoryAsync(); BaseContext.SetFunction04Enabled(false); } else { ShowWarningDialog(MsgErrDeleteError); } }); ProgressDialog.Start(ParentForm, Task.WhenAll(task), false, SessionKey); }
private async Task <bool> ValidateDeleteAccountTitleIdAsync() { var categoryResult = await ServiceProxyFactory.DoAsync(async (CategoryMasterClient client) => await client.ExistAccountTitleAsync(SessionKey, AccountTitleId)); if (categoryResult.Exist) { DoActionOnUI(() => ShowWarningDialog(MsgWngDeleteConstraint, "区分マスター", lblCode.Text)); return(false); } var discountResult = await ServiceProxyFactory.DoAsync(async (CustomerDiscountMasterClient client) => await client.ExistAccountTitleAsync(SessionKey, AccountTitleId)); if (discountResult.Exist) { DoActionOnUI(() => ShowWarningDialog(MsgWngDeleteConstraint, "歩引きマスター", lblCode.Text)); return(false); } var billingResult = await ServiceProxyFactory.DoAsync(async (BillingServiceClient client) => await client.ExistAccountTitleAsync(SessionKey, AccountTitleId)); if (billingResult.Exist) { DoActionOnUI(() => ShowWarningDialog(MsgWngDeleteConstraint, "請求データ", lblCode.Text)); return(false); } return(true); }
private async Task LoadWebApiSettingsAsync() { try { ClearControlValues(); var result = await ServiceProxyFactory.DoAsync(async (WebApiSettingMasterClient client) => await client.GetByIdAsync(SessionKey, CompanyId, WebApiType.PcaDX)); if (!(result?.ProcessResult.Result ?? false) || result.WebApiSetting == null) { BaseContext.SetFunction04Enabled(false); return; } BaseContext.SetFunction04Enabled(true); Setting = result.WebApiSetting; txtClientId.Text = Setting.ClientId; txtClientSecret.Text = Setting.ClientSecret; txtBaseUri.Text = Setting.BaseUri; txtApiVersion.Text = Setting.ApiVersion; SetToken(); } finally { Modified = false; } }
private void SaveControlColor() { if (!ShowConfirmDialog(MsgQstConfirmSave)) { DispStatusMessage(MsgInfProcessCanceled); return; } try { ControlColorData = SetControlColorForSave(); ControlColorResult result = null; var task = ServiceProxyFactory.DoAsync <ControlColorMasterClient>(async client => result = await client.SaveAsync(SessionKey, ControlColorData)); ProgressDialog.Start(ParentForm, task, false, SessionKey); var success = result?.ProcessResult.Result ?? false; if (success) { ColorSetting.FromDb = new ColorSetting(ControlColorData); DispStatusMessage(MsgInfSaveSuccess); btnGridRow.Focus(); } else { ShowWarningDialog(MsgErrSaveError); } } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private void SaveBillingMemo() { var task = ServiceProxyFactory.DoAsync(async(BillingServiceClient client) => await client.SaveMemoAsync(SessionKey, Id, Memo)); ProgressDialog.Start(ParentForm, task, false, SessionKey); }
private void DeleteReceiptMemo() { var task = ServiceProxyFactory.DoAsync(async(ReceiptServiceClient client) => await client.DeleteMemoAsync(SessionKey, Id)); ProgressDialog.Start(ParentForm, task, false, SessionKey); }
private void Delete() { if (!ShowConfirmDialog(MsgQstConfirmDelete)) { DispStatusMessage(MsgInfProcessCanceled); return; } try { var task = ServiceProxyFactory.DoAsync <LogDataServiceClient>(async client => { var deleteResult = await client.DeleteAllAsync(SessionKey, CompanyId); if (deleteResult.Count == 1) { Clear(); DispStatusMessage(MsgInfDeleteSuccess); } }); ProgressDialog.Start(ParentForm, task, false, SessionKey); GetLogCount(); } catch (Exception ex) { Debug.Fail(ex.ToString()); NLogHandler.WriteErrorLog(this, ex, SessionKey); } }
private async Task LoadEBFileSettingsAsync() => await ServiceProxyFactory.DoAsync(async (EBFileSettingMasterClient client) => { var result = await client.GetItemsAsync(SessionKey, CompanyId); EBFileSettings = (result.ProcessResult.Result) ? result.EBFileSettings : new List <EBFileSetting>(); });
private void Initialize() { GetImporterSettingAsync = settingId => Util.GetImporterSettingAsync(Login, (int)Rac.VOne.Common.Constants.FreeImporterFormatType.Receipt, settingId); GetImporterSettingDetailByIdAsync = settingId => Util.GetImporterSettingDetailByIdAsync(Login, settingId); GetGeneralSettingValueAsync = async(companyId, code) => (await Util.GetGeneralSettingAsync(Login, code))?.Value; ReceiptImportDuplicationCheckAsync = async(companyId, items, details) => await ServiceProxyFactory.DoAsync(async (ReceiptServiceClient client) => (await client.ReceiptImportDuplicationCheckAsync(SessionKey, CompanyId, items, details)).RowNumbers); SaveInnerAsync = items => ServiceProxyFactory.DoAsync((ReceiptServiceClient client) => client.SaveAsync(SessionKey, items, null, 0)); GetCurrenciesAsync = (companyId, codes) => Util.GetCurrenciesAsync(Login, codes); GetCategoriesByCodesAsync = (companyId, categoryType, codes) => Util.GetCategoriesByCodesAsync(Login, categoryType, codes); GetSectionByCodesAsync = (companyId, codes) => Util.GetSectionByCodesAsync(Login, codes); GetCustomerByCodesAsync = (companyId, codes) => Util.GetCustomerByCodesAsync(Login, codes); GetLegalPersonaritiesAsync = companyId => Util.GetLegalPersonaritiesAsync(Login); GetCollationSettingAsync = companyId => Util.GetCollationSettingAsync(Login); LoadColumnNameSettingsInnerAsync = tableName => ServiceProxyFactory.DoAsync(async(ColumnNameSettingMasterClient client) => { var result = await client.GetItemsAsync(SessionKey, CompanyId); if (result.ProcessResult.Result) { return(result.ColumnNames.Where(x => x.TableName == tableName).ToArray()); } return(new ColumnNameSetting[] { }); }); }
private async Task ShowAllDataAsync() { if (txtPatternNumber.Text != "") { var patternNo = txtPatternNumber.Text; txtPatternNumber.Text = patternNo.PadLeft(2, '0'); txtPatternNumber.Enabled = false; ImporterSettingResult result = null; await ServiceProxyFactory.DoAsync <ImporterSettingServiceClient>(async client => result = await client.GetHeaderByCodeAsync(SessionKey, CompanyId, FormatId, txtPatternNumber.Text)); if (result.ImporterSetting != null) { txtPatternName.Text = result.ImporterSetting.Name; txtInitialDirectory.Text = result.ImporterSetting.InitialDirectory; nmbStartLineCount.Text = result.ImporterSetting.StartLineCount.ToString(); updateAt = result.ImporterSetting.UpdateAt; ImporterSettingId = result.ImporterSetting.Id; btnPatternNoSearch.Enabled = false; if (result.ImporterSetting.PostAction == 0) { rdoNoAction.Checked = true; } else if (result.ImporterSetting.PostAction == 1) { rdoDelete.Checked = true; } else if (result.ImporterSetting.PostAction == 2) { rdoAddDate.Checked = true; } if (result.ImporterSetting.IgnoreLastLine == 1) { cbxIgnoreLastLine.Checked = true; } else if (result.ImporterSetting.IgnoreLastLine == 0) { cbxIgnoreLastLine.Checked = false; } await SetDataGridViewAsync(); BaseContext.SetFunction03Enabled(true); Modified = false; ClearStatusMessage(); } else { BaseContext.SetFunction08Enabled(true); await SetDataGridViewAsync(); btnPatternNoSearch.Enabled = false; ClearStatusMessage(); DispStatusMessage(MsgInfNewData, "パターンNo."); Modified = true; } this.ActiveControl = txtPatternName; txtPatternName.Focus(); } }
private async Task LoadWebApiSettingAsync() => await ServiceProxyFactory.DoAsync(async (WebApiSettingMasterClient client) => { var result = await client.GetByIdAsync(SessionKey, CompanyId, WebApiType.PcaDX); if (result.ProcessResult.Result) { this.client.WebApiSetting = result.WebApiSetting; } });
private async Task <bool> CancelOutputAtAsync(List <DateTime> outputAt) { var option = GetJournalizingOption(outputAt); var result = await ServiceProxyFactory.DoAsync(async (MatchingServiceClient client) => await client.CancelMatchingJournalizingAsync(SessionKey, option)); return(result?.ProcessResult.Result ?? false); }
private async Task <bool> UpdateOutpuAtAsync() { var option = GetJournalizingOption(); var result = await ServiceProxyFactory.DoAsync(async (MatchingServiceClient client) => await client.UpdateOutputAtAsync(SessionKey, option)); return(result?.ProcessResult.Result ?? false); }
private async Task LoadDepartmentsAsync() => await ServiceProxyFactory.DoAsync(async (DepartmentMasterService.DepartmentMasterClient client) => { var result = await client.GetItemsAsync(SessionKey, CompanyId); if (result.ProcessResult.Result) { Departments = result.Departments; } });
private async Task <WebApiSetting> GetWebApiSettingAsync() => await ServiceProxyFactory.DoAsync(async (WebApiSettingMasterClient client) => { var result = await client.GetByIdAsync(SessionKey, CompanyId, WebApiType.HatarakuDb); if (result.ProcessResult.Result) { return(result.WebApiSetting); } return(null); });
private async Task <IEnumerable <MFBilling> > GetMFBillings(IEnumerable <long> ids) => await ServiceProxyFactory.DoAsync(async (MFBillingService.MFBillingServiceClient client) => { var result = await client.GetByBillingIdsAsync(Login.SessionKey, ids.ToArray(), IsMatched); if (result.ProcessResult.Result) { return(result.MFBillings); } return(Enumerable.Empty <MFBilling>()); });
private async Task <List <ImportFileLog> > GetImportFileLogsAsync() => await ServiceProxyFactory.DoAsync(async (ImportFileLogServiceClient client) => { var result = await client.GetHistoryAsync(SessionKey, CompanyId); if (result.ProcessResult.Result) { return(result.ImportFileLogs); } return(new List <ImportFileLog>()); });