Advertisement
FANMixco

C#

Mar 1st, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. private async void btnSFilter_Click(object sender, RoutedEventArgs e)
  2.         {
  3.             if (txtSDate1.Date > txtSDate2.Date)
  4.             {
  5.                 var messageDialog = new MessageDialog("Invalid period of time, please try again later.");
  6.                 await messageDialog.ShowAsync();
  7.                 return;
  8.             }
  9.  
  10.             BloodResultsDAO brdao = new BloodResultsDAO();
  11.             List<BloodResults> result = await brdao.GetData(DateTime.Parse(txtSDate1.Date.ToString()), DateTime.Parse(txtSDate2.Date.ToString()), true);
  12.             ObservableCollection<Data> dresult = new ObservableCollection<Data>();
  13.  
  14.             foreach (BloodResults br in result)
  15.             {
  16.                 DateTime date = DateTime.Parse(br.registered);
  17.                 string dateR = date.Month.ToString() + "/" + date.Day.ToString();
  18.                 dresult.Add(new Data() { Category = dateR, Value = br.result, Info = "Result of " + dateR + ", " + br.result });
  19.             }
  20.            
  21.             telChart.Series[0].ItemsSource = dresult;
  22.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement