async Task SearchAsync() { //if (! await SPC.Services.UI.ConfirmService.ConfirmAsync("Search for company?")) //{ // SPC.Services.UI.AlertService.Alert("Search cancelled"); // return; //} if (!string.IsNullOrWhiteSpace(TaxId)) { IsSearching = true; // StateHasChanged(); var _regCompanies = new SPC.Cloud.Members.RegCompanies(); _regCompanies.SetParameters(new Dictionary <string, string>() { { "RowKey", TaxId.Trim() } }); var ret = await _regCompanies.GetBOListAsync(); if (ret != null && ret.Count > 0) { IsSearching = false; //found company. it is registered with SPC SPCRegCompany = ret[0] as RegCompanies.RegCompany; } else { //unregistered companies var _companies = new SPC.eInvoice.Companies(); _companies.SetParameters(new Dictionary <string, string>() { { "PartitionKey", "TTCT" }, { "RowKey", TaxId.Trim() } }); ret = await _companies.GetBOListAsync(); if (ret != null && ret.Count > 0) { IsSearching = false; //found company. it is registered with SPC SPCRegCompany = ret[0] as RegCompanies.RegCompany; } else { SPCRegCompany = null; } } IsSearching = false; } }
private async Task LookupCompanyNameAsync() { if (!string.IsNullOrEmpty(TaxId)) { var query = new SPC.eInvoice.Companies(); query.SetParameters(new Dictionary <string, string>() { { "MST", TaxId } }); var searchonecompany = await query.GetBOListAsync(); if (searchonecompany.Count > 0) { var onecom = searchonecompany[0] as SPC.Cloud.Members.RegCompanies.RegCompany; CompanyName = onecom.CompanyName; } } }
private async Task SearchCompanyInfoAsync() { // StateHasChanged(); var _regCompanies = new SPC.Cloud.Members.RegCompanies(); _regCompanies.SetParameters(new Dictionary <string, string>() { { "RowKey", TaxId.Trim() } }); var ret = await _regCompanies.GetBOListAsync(); if (ret != null && ret.Count > 0) { //found company. it is registered with SPC SPCRegCompany = ret[0] as RegCompanies.RegCompany; } else { //unregistered companies var _companies = new SPC.eInvoice.Companies(); _companies.SetParameters(new Dictionary <string, string>() { { "PartitionKey", "TTCT" }, { "RowKey", TaxId.Trim() } }); ret = await _companies.GetBOListAsync(); if (ret != null && ret.Count > 0) { //found company. it is registered with SPC SPCRegCompany = ret[0] as RegCompanies.RegCompany; } else { SPCRegCompany = null; } } }