public Driver_MaintenanceRequestPage() { InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); _objHeaderModel = new HeaderModel(); _baseUrl = Settings.Url + Domain.Driver_MaintananceListApiConstant; _apiServices = new RestApi(); _objDriver_MaintananceListResponse = new Driver_MaintananceListResponse(); GetMaintananceList(); }
public async void GetMaintananceList() { try { _objHeaderModel.TokenCode = Settings.TokenCode; _objDriver_MaintananceListRequest = new Driver_MaintananceListRequest { CompanyId = Settings.CompanyId.ToString(), EmployeeId = Settings.UserId, Limit = "50", OffSet = "0", SearchKey = string.Empty }; await Navigation.PushPopupAsync(new LoadingPopPage()); _objDriver_MaintananceListResponse = await _apiServices.MaintananceLoadAsync(new Get_API_Url().Driver_MaintananceListApi(_baseUrl), true, _objHeaderModel, _objDriver_MaintananceListRequest); if (_objDriver_MaintananceListResponse.Response.StatusCode == 200) { if (_objDriver_MaintananceListResponse.Response.MaintenanceRequestList.Count > 0) { listMaintanance.ItemsSource = _objDriver_MaintananceListResponse.Response.MaintenanceRequestList; } else { DependencyService.Get <IToast>().Show("No Data To Display!"); } await Navigation.PopAllPopupAsync(); } else { await Navigation.PopAllPopupAsync(); DependencyService.Get <IToast>().Show("Some Error Occured!"); } } catch (Exception ex) { var msg = ex.Message; await Navigation.PopAllPopupAsync(); } }