protected override async Task OnInitializedAsync() { House.LandlordId = 1; House.Address1 = ""; Landlords = await LandlordServices.GetLandlords(); House.DateFrom = DateTime.Now; House.DateTo = DateTime.Now.AddYears(1); // House.LandlordId = 0; }
protected override async Task OnInitializedAsync() { try { IsLoading = true; ManagePagination = new ManagePagination <LandlordDto>(); Landlords = await LandlordServices.GetLandlords(); ManagePagination.DataSource = Landlords; ManagePagination.SearchSource = Landlords; ManagePagination.PageCount = (int)Math.Ceiling((int)ManagePagination.SearchSource.Length / (decimal)ManagePagination.ItemPerPage); ManagePagination.Paginate(0); IsLoading = false; } catch (Exception ex) { Console.WriteLine(ex); IsLoading = false; throw; } }
protected async Task HandleVilideSubmit() { await LandlordServices.SaveLandlord(Landlord); NavigationManager.NavigateTo("/landlordlist"); }
protected override async Task OnInitializedAsync() { Landlord = await LandlordServices.GetLandlordById(Id); }
protected async Task HandleInvalidSubmit() { await LandlordServices.AddLandlord(Landlord); NavigationManager.NavigateTo("/landlordlist"); }
protected async Task HandleVilidDelete() { await LandlordServices.DelateLandlord(Id); NavigationManager.NavigateTo("/landlordlist"); }