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(); } }
protected async void confirmAction_Click(bool actionConfirm) { if (actionConfirm) { await AcMasterService.UpdateAcMaster(AcMaster); NavigationManager.NavigateTo("/findaccount"); } }
protected async override Task OnInitializedAsync() { var authenticationState = await authenticationStateTask; if (!authenticationState.User.Identity.IsAuthenticated) { NavigationManager.NavigateTo("/identity/account/login"); } Ledgers = (await LedgerService.GetLedgers()).ToList(); AccountGroupMasters = (await AccountGroupMasterService.GetAccountGroupMasters()).ToList(); Lcd = Lcd ?? "GL"; AcMasters = (await AcMasterService.LedgerOfAccounts(Lcd)).ToList(); }
protected async void ConfirmAction_Click(bool actionConfirm) { if (actionConfirm) { //string lgrVal = "3,GL"; //LedgerChange(lgrVal); var result = await AcMasterService.AddAcMaster(AcMasters); if (result != null) { NavigationManager.NavigateTo("/findaccount"); } } }
protected async override Task OnInitializedAsync() { //PopupMessage = "Data Update Successfully"; AcMaster = await AcMasterService.GetAcMaster(int.Parse(Id)); LedgerCode = AcMaster.LedgerCode; //CountryID = AcMaster.CountryID.ToString(); //TypeMasts = (await TypeMastService.GetTypeMasts()).ToList(); //BSheetGroups = (await BSheetGroupService.GetBSheetGroups()).ToList(); //Countries = (await CountryService.GetCountries()).ToList(); //States = (await StateService.GetStatesForCountry(int.Parse(CountryID))).ToList(); //CostCenters = (await CostCenterService.GetCostCenters()).ToList(); }
protected async override Task OnInitializedAsync() { Ledgers = (await LedgerService.GetLedgers()).ToList(); AcMaster = await AcMasterService.GetAcMaster(int.Parse(Id)); AcMaster = new AcMaster { AcMasterID = AcMaster.AcMasterID, LedgerID = AcMaster.LedgerID, LedgerCode = AcMaster.LedgerCode, Acno = AcMaster.Acno, Acname = AcMaster.Acname, CreatedBy = AcMaster.CreatedBy, CreatedDate = AcMaster.CreatedDate, AuthorisedBy = AcMaster.AuthorisedBy == null ? "LoginUser" : AcMaster.AuthorisedBy, AuthorisedAc = AcMaster.AuthorisedAc == false ? false : AcMaster.AuthorisedAc, AuthorisedDate = AcMaster.AuthorisedDate == null ? DateTime.Now :AcMaster.AuthorisedDate }; }
protected async void Ledger_Change(string val) { FetchLedgerID = val; string[] sublCodestr = val.Split(","); LedgerID = sublCodestr[0]; LedgerCode = sublCodestr[1]; SubLedger = await SubLedgerService.GetSubLedgersInLedger(LedgerCode); AcMaster = await AcMasterService.LedgerOfAccounts(LedgerCode); CostCenter = await CostCenterService.GetCostCenters(); if (FromTableRowSelect == true) { FromTableRowSelect = false; } else { FetchAccountCode = "0"; } StateHasChanged(); }
protected void confirmAction_Click(bool actionConfirmed) { if (actionConfirmed) { var patchObject = new List <HttpPatchRecord>(); patchObject.Add(new HttpPatchRecord { Op = "replace", Path = "/authorisedBy", Value = AcMaster.AuthorisedBy }); patchObject.Add(new HttpPatchRecord { Op = "replace", Path = "/authorisedAc", Value = AcMaster.AuthorisedAc.ToString() }); patchObject.Add(new HttpPatchRecord { Op = "replace", Path = "/authorisedDate", Value = AcMaster.AuthorisedDate.ToString() }); var json = System.Text.Json.JsonSerializer.Serialize(patchObject); var myHttpContent = new StringContent(json, Encoding.UTF8, "application/json"); //,{ "op":"replace","path":"/authorisedAc","value": true},{ "op":"replace","path":"/authorisedDate","value": "2020-10-12"}]'; AcMasterService.UpdatePatchAcMaster(AcMaster.AcMasterID, myHttpContent); NavigationManager.NavigateTo("/findaccount"); } }
protected async void Delete_Click(int id) { await AcMasterService.DeleteAcMaster(id); MessageConfirmation.show(); }
protected async Task LoadAccountList(string Lcd) { AcMaster = (await AcMasterService.LedgerOfAccounts(Lcd)).ToList(); StateHasChanged(); }