Example #1
0
 private void FindButton_Click(object sender, RoutedEventArgs e)
 {
     if (txttim.Text.Trim() != "")
     {
         QLThuebaoDomainContext db = new QLThuebaoDomainContext();
         if (chkInt.IsChecked == true)
         {
             EntityQuery<internet> Query = db.GetInternetsQuery();
             LoadOperation<internet> Load = db.Load(Query.Where(p => p.user_name.Trim().Contains(txttim.Text.Trim())).OrderBy(p => p.ma_huyen), lo =>
             {
                 gridInt.Visibility = Visibility.Visible;
                 gridmy.Visibility = Visibility.Collapsed;
                 gridInt.ItemsSource = lo.Entities;                      
             }, null);
         }
         else
         {
             EntityQuery<mytv> Query = db.GetMytvsQuery();
             LoadOperation<mytv> Load = db.Load(Query.Where(p => p.user_name.Trim().Contains(txttim.Text.Trim())).OrderBy(p=>p.ma_huyen), lo =>
             {
                 gridInt.Visibility = Visibility.Collapsed;
                 gridmy.Visibility = Visibility.Visible;
                 gridmy.ItemsSource = lo.Entities;                        
             }, null);
         }
     }
 }