private void BTNSearch_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(this.TBMainSearch.Text)) { JMessBox jb = new JMessBox("请输入内容"); jb.Show(); } else { string destination = "/DrugResultPage.xaml"; if (isByKeywords) { Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("name", "drug"); dic.Add("keyword", this.TBMainSearch.Text); PhoneApplicationService.Current.State["dic"] = dic; destination += string.Format("?type={0}", "Drug"); } else { Dictionary<string, string> dic = new Dictionary<string, string>(); dic.Add("number", "国药准字Z" + this.TBMainSearch.Text); PhoneApplicationService.Current.State["dic"] = dic; destination += string.Format("?type={0}", "DrugNumber"); } NavigationService.Navigate(new Uri(destination, UriKind.Relative)); } }
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e) { e.Cancel = true; JMessBox jb = new JMessBox("再按一次离开"); jb.Completed += (b) => { if (b) { //退出代码 Application.Current.Terminate(); } }; jb.Show(); }
private void BTNSearch_Click(object sender, RoutedEventArgs e) { if (this.TBMainSearch.Text == "如:“发热”,“小儿”" || string.IsNullOrEmpty(this.TBMainSearch.Text)) { JMessBox jb = new JMessBox("请输入内容"); jb.Show(); } else { string destination = "/GeneralResultPage.xaml"; destination += string.Format("?keyword={0}&type={1}", this.TBMainSearch.Text, "Symptom"); NavigationService.Navigate(new Uri(destination, UriKind.Relative)); } }