protected async void OnAccountGroupChange(ChangeEventArgs AccountGroupChange) { int val; //******************Data Fetching through lambda-expression //AcMastersNew = (IEnumerable<AcMaster>) await AcMasterService.GetMaxAccountNo(AccountGroupChange.Value.ToString()); //******************Data Fetching through store-procedure AcMastersNew = await AcMasterService.GetMaxAcNo_sp(AccountGroupChange.Value.ToString()); if (AcMastersNew.Count() > 0) { foreach (var acno in AcMastersNew) { Int32.TryParse(acno.Acno, out val); maxaccountno = (val + 1).ToString(); StateHasChanged(); } } else { Int32.TryParse(AccountGroupChange.Value.ToString(), out val); maxaccountno = (val + 1).ToString(); StateHasChanged(); } //AcMaster = (await AcMasterService.LedgerOfAccounts(Lcd)).ToList(); }
protected async void Group_Change(string value) { int val; Int32.TryParse(L_ID, out int LID); BSheetGID = value; //******************Data Fetching through lambda-expression //AcMastersNew = (IEnumerable<AcMaster>) await AcMasterService.GetMaxAccountNo(AccountGroupChange.Value.ToString()); //******************Data Fetching through store-procedure AcMastersNew = await AcMasterService.GetMaxAcNo_sp(value); if (AcMastersNew.Count() > 0) { foreach (var acm in AcMastersNew) { Int32.TryParse(acm.Acno, out val); Maxaccountno = (val + 1).ToString(); AcMasters = new AcMaster { LedgerID = LID, LedgerCode = L_Code, Acno = Maxaccountno, DrCr = "D", CountryID = 1, StateID = 1, Ason = DateTime.Now, AuthorisedDate = DateTime.Now, Compcode = "001", Dob = DateTime.Now, CreatedDate = DateTime.Now, CreatedBy = CreatedUser }; StateHasChanged(); } } else { Int32.TryParse(value, out val); Maxaccountno = (val + 1).ToString(); //Int32.TryParse(L_ID, out LID); AcMasters = new AcMaster { LedgerID = LID, LedgerCode = L_Code, Acno = Maxaccountno, DrCr = "D", CountryID = 1, StateID = 1, Ason = DateTime.Now, AuthorisedDate = DateTime.Now, Compcode = "001", Dob = DateTime.Now, CreatedDate = DateTime.Now, CreatedBy = CreatedUser }; StateHasChanged(); } }