async void OnClick(object sender, EventArgs ea) { var itemsr = string.Empty; var client = RestService.HttpClient; var response = await client.GetAsync(RestService.ipupdate + "GetItemNote.php"); JsonItemNote ObjItemList = new JsonItemNote(); if (response.IsSuccessStatusCode) { string NoteInfoList = response.Content.ReadAsStringAsync().Result; ObjItemList = JsonConvert.DeserializeObject <JsonItemNote>(NoteInfoList); // listviewNotes.ItemsSource = ObjItemList.NoteInfo; foreach (JsonItemnoteClass t in ObjItemList.NoteInfo) { // FlagNu = t.Name; itemsr = t.Name; } //var FlagNuf = new List<JsonItemnoteClass>(); } List <JsonItemnoteClass> items = new List <JsonItemnoteClass>(ObjItemList.NoteInfo); if (multiPage == null) { multiPage = new SelectMultipleBasePage <JsonItemnoteClass>(items) { Title = "CHECK EXTRA ADD-ONS" } } ; await Navigation.PushAsync(multiPage); }
//protected override void OnAppearing() //{ // // int X = 10; // base.OnAppearing(); // //cartAdd.ScaleTo(2, 1500, Easing.CubicInOut); // //cartAdd.ScaleTo(1, 500, Easing.Linear); // // this.Animate("", (s) => Layout(new Rectangle(X, (s -1) * Height, Width, Height)), 0, 600, Easing.SpringIn, null, null); // // this.Animate("", s => Layout(new Rectangle(((-1 + s) * Width), Y, Width, Height)), 16, 250, Easing.Linear, null, null); // if (multiPage != null) // { // results.Text = ""; // var answers = multiPage.GetSelection(); // foreach (var a in answers) // { // results.Text += a.Name + ","; // } // } // else // { // results.Text = "NO EXTRA COMMENTS"; // } //} private void OnAddonsSelected(object sender, JsonItemNote e) { _popup.AddonsSelected -= OnAddonsSelected; var message = "User select:"; foreach (var item in e.NoteInfo) { if (item.IsSelected) { message += $" {item.Name}"; } } results.Text = message + ""; // DisplayAlert("Result", message, "Ok"); }
//private List<JsonItemnoteClass> _items; //public List<JsonItemnoteClass> Items //{ // get { return _items; } // set // { // _items = value; // OnPropertyChanged(); // } //} //public bool IsOn //{ // get // { // return isOnda; // } // set // { // isOnda = value; // // Do any other stuff you want here // } //} //void Handle_Toggled(object sender, ToggledEventArgs e) //{ // // var data = (sender as ListView).BindingContext as JsonItemnoteClass; // // Create a new toggle switch and add a Toggled event handler. // // Add the toggle switch to a parent container in the visual tree. // DisplayAlert("togelled", Convert.ToString(result), "ok"); //} //void SelectAll() //{ // foreach (var wi in WrappedItems) // { // wi.IsSelected = true; // } //} //void SelectNone() //{ // foreach (var wi in WrappedItems) // { // wi.IsSelected = false; // } //} public async void GetJSONnote() { //var TicketNu = 0; //var FlagNu = string.Empty; //bool result = false; var client = RestService.HttpClient; var response = await client.GetAsync(RestService.ipupdate + "GetItemNote.php"); // string NoteInfoList = response.Content.ReadAsStringAsync().Result; //JsonItemNote ObjItemList = new JsonItemNote(); //if (contactsJson != "") JsonItemNote ObjItemList = new JsonItemNote(); if (response.IsSuccessStatusCode) { // JsonItemNote ObjItemList = new JsonItemNote(); string NoteInfoList = response.Content.ReadAsStringAsync().Result; ObjItemList = JsonConvert.DeserializeObject <JsonItemNote>(NoteInfoList); listviewNotes.ItemsSource = ObjItemList.NoteInfo; foreach (JsonItemnoteClass t in ObjItemList.NoteInfo) { TicketNu = t.ID; FlagNu = t.Name; // result = t.isOn; if (result == true) { await DisplayAlert("ticket", Convert.ToString(result), "OK"); await DisplayAlert("ticket", FlagNu, "OK"); await DisplayAlert("ticket", Convert.ToString(TicketNu), "OK"); } } } //if(TicketNu==2) //{ // await DisplayAlert("ticket", Convert.ToString(result), "OK"); // await DisplayAlert("ticket", FlagNu, "OK"); // await DisplayAlert("ticket", Convert.ToString(TicketNu), "OK"); //} //await DisplayAlert("ticket", Convert.ToString(result), "OK"); //await DisplayAlert("ticket", FlagNu, "OK"); //await DisplayAlert("ticket", Convert.ToString(TicketNu), "OK"); }
private async Task <JsonItemNote> GetData() { var itemsr = string.Empty; /// var client = RestService.HttpClient; var client = new System.Net.Http.HttpClient(); var response = await client.GetAsync(RestService.ipupdate + "GetItemNote.php"); JsonItemNote ObjItemList = new JsonItemNote(); if (response.IsSuccessStatusCode) { string NoteInfoList = response.Content.ReadAsStringAsync().Result; ObjItemList = JsonConvert.DeserializeObject <JsonItemNote>(NoteInfoList); foreach (JsonItemnoteClass t in ObjItemList.NoteInfo) { // FlagNu = t.Name; itemsr = t.Name; // itemname = t.Name; } } return(ObjItemList); }
private async void GetItemNote() { _note = await GetData(); AddonOne.ItemsSource = _note.NoteInfo; }