private async Task GetListAsync() { JObject result = await _IAllDataServices.GetFranchiseStock(); if (result != null) { string type = result["Type"].ToString(); if (type == "1") { ArticleMaster_Class_Data_List = JsonConvert.DeserializeObject <ObservableCollection <ArticleMaster_Class> >(result["Result"].ToString()); } else { await App.Current.MainPage.DisplayAlert("Error!", (string)result["Result"]["ResponseMessage"], "Ok"); } } }
public async Task GetListAsync() { try { var Wait = UserDialogs.Instance.Loading("Wait..", Cancel(), "Cancel", true, MaskType.Black); Wait.Show(); JObject result = await _IAllDataServices.GetFranchiseStock(); if (result != null) { string type = result["Type"].ToString(); if (type == "1") { Main_List = JsonConvert.DeserializeObject <ObservableCollection <ArticleMaster_Class> >(result["Result"].ToString()); if (Main_List.Count == 0) { await App.Current.MainPage.DisplayAlert("Oops!", "Stock Not Available", "Ok"); Main_List_Visible = false; // _Show_Hide_Msg = true; } else { Main_List_Visible = true; // _Show_Hide_Msg = false; } } else { await App.Current.MainPage.DisplayAlert("Error!", (string)result["ResponseMessage"], "Ok"); } } Wait.Dispose(); } catch (Exception ee) { await App.Current.MainPage.DisplayAlert("Error!", ee.Message, "Ok"); } }