Beispiel #1
0
 private void btnVerifyUpdate_Click(object sender, RoutedEventArgs e)
 {
     using (var context = new BankInfoManagementEntities())
     {
         var q = from t in context.CreditCardInfo
                 where t.CNo == textBoxChangeCNo.Text
                 where t.CPassword == textBoxChangeCPwd.Password
                 select new
         {
             账号   = t.CNo,
             客户姓名 = t.CName,
             开户日期 = t.CDate,
             开户地址 = t.COpenAdress,
             手机号  = t.CPhoneNo
         };
         dataGridPersonalInfo.ItemsSource = q.ToList();
         var q1 = from t in context.CreditCardInfo
                  where t.CNo == textBoxChangeCNo.Text
                  select t;
         if (q1.ToList().Count() != 0)
         {
             foreach (var v in q1)
             {
                 v.CPassword = textBoxChangeNewPwd.Password;
             }
             context.SaveChanges();
             MessageBox.Show("修改密码成功!");
         }
         else
         {
             MessageBox.Show("修改密码失败,账户名或密码错误", "警告", MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// 确认开户
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOpenAccount_Click(object sender, RoutedEventArgs e)
        {
            DateTime d = Convert.ToDateTime(datePickerOpen.SelectedDate);

            using (var context = new BankInfoManagementEntities())
            {
                DeposInfo deposinfo = new DeposInfo()
                {
                    CName     = textBoxKCName.Text,
                    CSex      = textBoxOpenSex.Text,
                    CNo       = textBoxKCNo.Text,
                    CPassword = textBoxKCPwd.Password,
                    CID       = textBoxOpenID.Text,
                    CDate     = d,
                    CAdress   = textOpenAddress.Text,
                    CPhoneNum = textBoxPhoneNo.Text
                };
                try
                {
                    context.DeposInfo.Add(deposinfo);
                    context.SaveChanges();
                    MessageBox.Show("开户成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("开户失败" + ex.ToString());
                }
            }
        }
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         context.SaveChanges();
         MessageBox.Show("保存成功。");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "保存失败");
     }
 }
Beispiel #4
0
 private void btnVerifyChange_Click(object sender, RoutedEventArgs e)
 {
     using (var context = new BankInfoManagementEntities())
     {
         var q = from t in context.EmploeeInfo
                 where t.YNo == textBoxChangeYNo.Text
                 where t.YPassword == pwdBoxOldYPwd.Password
                 select t;
         if (q.ToList().Count() != 0)
         {
             foreach (var v in q)
             {
                 v.YPassword = pwdBoxNewYPwd.Password;
             }
             context.SaveChanges();
             MessageBox.Show("修改密码成功!");
         }
         else
         {
             MessageBox.Show("修改密码失败,账户名或密码错误", "警告", MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
 }