async public void Submit() { Views.Busy.SetBusy(true, "Loading Entries"); var sett = Services.SettingsServices.SettingsService.Instance.OrganisationId; var journals = await AccountingServices.ListJournals(sett, fromDate.Date, toDate.Date); Views.Busy.SetBusy(false); if (journals.result) { Journals = journals.data as List <Accounts>; try { for (int i = 0; i < Journals.Count; i++) { Journals[i].debitedto = Ledgers.Where(x => x.id.Equals(Journals[i].debit)).FirstOrDefault().title; Journals[i].creditedto = Ledgers.Where(x => x.id.Equals(Journals[i].credit)).FirstOrDefault().title; } } catch (Exception e) { } RaisePropertyChanged("Journals"); } }
public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> suspensionState) { if (suspensionState.Any()) { } await Task.CompletedTask; Views.Busy.SetBusy(true, "Loading ledger list"); var sett = Services.SettingsServices.SettingsService.Instance.OrganisationId; var temp = await AccountingServices.ListLedgers(sett); Views.Busy.SetBusy(false); if (temp.result) { Ledgers = temp.data as List <Ledgers>; } Views.Busy.SetBusy(true, "Loading Entries"); var journals = await AccountingServices.ListJournals(sett, DateTime.Now.Date, DateTime.Now.Date); Views.Busy.SetBusy(false); if (journals.result) { Journals = journals.data as List <Accounts>; for (int i = 0; i < Journals.Count; i++) { Journals[i].debitedto = Ledgers.Where(x => x.id.Equals(Journals[i].debit)).FirstOrDefault().title; Journals[i].creditedto = Ledgers.Where(x => x.id.Equals(Journals[i].credit)).FirstOrDefault().title; } //foreach (var x in Journals) //{ // x.debit = Ledgers.Where(z => z.id.Equals(x.id)).First().title; // x.credit = Ledgers.Where(z => z.id.Equals(x.id)).First().title; //} RaisePropertyChanged("Journals"); } }