private async void LoadListData() { if (CrossConnectivity.Current.IsConnected) { ApproveServiceModel approveModel = new ApproveServiceModel(); HttpClientHelper apicall = new HttpClientHelper(string.Format(ApiUrls.Url_GetPendingServiceList), Settings.AccessTokenSettings); var response = await apicall.GetResponse <List <ApproveServiceModel> >(); if (response != null) { if (response.Count > 0) { ServiceComplaintList = new ObservableCollection <ApproveServiceModel>(response); } else { UserDialogs.Instance.HideLoading(); } } } else { UserDialogs.Instance.HideLoading(); await Application.Current.MainPage.DisplayAlert("Network", AppConstant.NETWORK_FAILURE, "OK"); return; } UserDialogs.Instance.HideLoading(); }
public async void GoToApproveComplaintDetailPage(ApproveServiceModel data) { UserDialogs.Instance.ShowLoading("Loading...", MaskType.Black); if (data == null) { return; } Cache.goToBackButtonText = "ApproveComplaintPage"; await Navigation.PushAsync(new ApproveServiceComplaintDetailPage(data)); //UserDialogs.Instance.HideLoading(); }
public ApproveServiceComplaintDetailPageViewModel(INavigation navigation, ApproveServiceModel data, ApplicationActivity pageType) : base(navigation) { _approveServiceData = data; _navigation = navigation; _pageType = pageType; PageHeaderText = "Complaint Detail"; IsMenuVisible = false; IsBackButtonVisible = true; LoadListData(); IsComplaintDateEntryVisible = true; IsComplaintDatePickerVisible = false; UpdateCommand = new DelegateCommand(ExecuteOnUpdate); ComplaintDate = DateTime.Today; }
public ApproveServiceComplaintDetailPage(ApproveServiceModel data, ApplicationActivity pageType) { try { InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); approveServiceDetailPageVM = new ApproveServiceComplaintDetailPageViewModel(Navigation, data, pageType); BindingContext = approveServiceDetailPageVM; } catch (Exception ex) { UserDialogs.Instance.HideLoading(); } }
private async void LoadListData() { if (CrossConnectivity.Current.IsConnected) { ApproveServiceModel approveModel = new ApproveServiceModel(); HttpClientHelper apicall = new HttpClientHelper(string.Format(ApiUrls.Url_GetPendingServiceList), Settings.AccessTokenSettings); var response = await apicall.GetResponse <List <ApproveServiceModel> >(); if (response != null) { if (response.Count > 0) { IsStatusVisible = false; foreach (var item in response) { ApproveServiceModel approveData = new ApproveServiceModel(); approveData.Catagory = item.Catagory; approveData.ComplaintDate = item.ComplaintDate; approveData.complaintId = item.complaintId; approveData.ComplaintSummary = item.ComplaintSummary; approveData.Date_Complaint = item.Date_Complaint; approveData.ProductName = item.ProductName; approveData.status = item.status; approveData.Title = item.Title; ServiceComplaintList.Add(approveData); } ServiceComplaintData = new ReadOnlyObservableCollection <ApproveServiceModel>(ServiceComplaintList); } else { IsStatusVisible = true; UserDialogs.Instance.HideLoading(); } } } else { UserDialogs.Instance.HideLoading(); await Application.Current.MainPage.DisplayAlert("Network", AppConstant.NETWORK_FAILURE, "OK"); return; } UserDialogs.Instance.HideLoading(); }
private async void LoadListData(ApplicationActivity pageType) { if (CrossConnectivity.Current.IsConnected) { bool isCallFirstTime = false; ReqProductModel productType = new ReqProductModel(); ApproveServiceModel approveModel = new ApproveServiceModel(); HttpClientHelper apicall = new HttpClientHelper(ApiUrls.Url_GetApprovedInProgressServiceList, Settings.AccessTokenSettings); productType.productType = pageType; var regjson = JsonConvert.SerializeObject(productType); var response = await apicall.Post <List <ApproveServiceModel> >(regjson); switch (pageType) { case ApplicationActivity.CheckApprovedServiceStatusListPage: ApproveBackgroundColor = Color.FromHex("#981C1C"); InProgressBackgroundColor = Color.FromHex("#000000"); if (response != null) { if (response.Count > 0) { IsStatusVisible = false; ServiceComplaintList = new ObservableCollection <ApproveServiceModel>(response); } else { IsStatusVisible = true; UserDialogs.Instance.HideLoading(); } } break; case ApplicationActivity.CheckInprogressServiceStatusListPage: ApproveBackgroundColor = Color.FromHex("#000000"); InProgressBackgroundColor = Color.FromHex("#981C1C"); if (response != null) { if (response.Count > 0) { IsStatusVisible = false; ServiceComplaintList = new ObservableCollection <ApproveServiceModel>(response); } else { IsStatusVisible = true; UserDialogs.Instance.HideLoading(); } } break; default: break; } } else { UserDialogs.Instance.HideLoading(); await Application.Current.MainPage.DisplayAlert("Network", AppConstant.NETWORK_FAILURE, "OK"); return; } UserDialogs.Instance.HideLoading(); }