Exemple #1
0
 /// <summary>
 /// Dispose Database Object
 /// </summary>
 /// <param name="disposing"></param>
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
Exemple #2
0
        //查询当前账号的所有记录信息
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            BankEntities1 context = new BankEntities1();
            var           query   = from t in context.MoneyInfo
                                    where t.accountNo == txtID.Text
                                    select t;

            if (query.Count() > 0)
            {
                datagrid1.ItemsSource = query.ToList();
            }
            else
            {
                MessageBox.Show("此账号不存在");
                this.txtID.Clear();
            }
            context.Dispose();
        }
Exemple #3
0
 void Page_Unloaded(object sender, RoutedEventArgs e)
 {
     context.Dispose();
 }
Exemple #4
0
 void DayQuery_Unloaded(object sender, RoutedEventArgs e)
 {
     context.Dispose();
 }