private void chonhuyen(object sender, SelectionChangedEventArgs e) { try { ObjHuyen chonhuyen = ((sender as Telerik.Windows.Controls.RadListPicker).SelectedItem as ObjHuyen); huyenid_select = chonhuyen.huyenid; huyen_select = chonhuyen.huyen; var picker = sender as Telerik.Windows.Controls.RadListPicker; //MessageBox.Show("chon:" + lbi.gethuyen()); string site = urllichmatdienhuyen + huyenid_select + "&tinhid=" + tinhid_select + "&sc=" + strsecure + strsecure; webBrowser1.Navigate(new Uri(site, UriKind.Absolute)); //Console.WriteLine(site); System.Diagnostics.Debug.WriteLine("Time {0}", DateTime.Now + site); } catch (Exception ee1) { } if (i >= 1) { IsolatedStorageSettings.ApplicationSettings.Clear(); IsolatedStorageSettings.ApplicationSettings.Add("huyenid", huyenid_select); IsolatedStorageSettings.ApplicationSettings.Add("tinhid", tinhid_select); IsolatedStorageSettings.ApplicationSettings.Add("huyen", huyen_select); IsolatedStorageSettings.ApplicationSettings.Add("tinh", tinh_select); IsolatedStorageSettings.ApplicationSettings.Save(); System.Diagnostics.Debug.WriteLine("Time {0}", DateTime.Now + tinhid_select + "-" + huyenid_select); } }
void get_dmhuyen_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { try { List <ObjHuyen> huyenList = new List <ObjHuyen>(); ObjHuyen chonhuyen = new ObjHuyen(); chonhuyen.huyen = huyen_select; chonhuyen.huyenid = huyenid_select; huyenList.Add(chonhuyen); var jsonString = e.Result; ObjHuyen toan = new ObjHuyen(); toan.huyen = "Toan tinh"; toan.huyenid = "toantinh"; var deserialized = JsonConvert.DeserializeObject <List <ObjHuyen> >(jsonString); huyenList.Add(toan); foreach (ObjHuyen item in deserialized) { huyenList.Add(item); } this.listPickerHuyen.ItemsSource = huyenList; i++; string site = urllichmatdienhuyen + huyenid_select + "&tinhid=" + tinhid_select + "&sc=" + strsecure + strsecure; webBrowser1.Navigate(new Uri(site, UriKind.Absolute)); //System.Diagnostics.Debug.WriteLine("Time {0}", DateTime.Now + site); } catch (Exception e1) { loi_exit(); } }