Пример #1
0
 /// <summary>
 /// 存款界面
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSubmitCK_Click(object sender, RoutedEventArgs e)
 {
     using (var context = new BankInfoManagementEntities())
     {
         var q = from t in context.CreditCardInfo
                 where t.CNo == textBoxCNo.Text
                 where t.CPassword == textBoxCPwd.Password
                 select t;
         if (q.ToList().Count == 0)
         {
             MessageBox.Show("用户名或密码错误!!请重新输入!", "警告", MessageBoxButton.OK, MessageBoxImage.Warning);
             textBoxCNo.Text      = "";
             textBoxCPwd.Password = "";
         }
         else
         {
             db     Db           = new db();
             string Procedure_CK = "exec DepositOperation'" + textBoxCNo.Text + "','" + textBoxCPwd.Password + "','" + textBoxCName.Text + "','" + Convert.ToDecimal(textBoxCMoney.Text) + "','" + comboBoxCKType.Text.ToString() + "','" + Convert.ToInt32(textBoxCTime.Text) + "'";
             if (Db.SQlCommand(Procedure_CK) > 0)
             {
                 MessageBox.Show("存款成功");
             }
             else
             {
                 MessageBox.Show("存款失败");
             }
         }
     }
 }
Пример #2
0
        /// <summary>
        /// 转账记录查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCheckZZRecord_Click(object sender, RoutedEventArgs e)
        {
            using (var context = new BankInfoManagementEntities())
            {
                var q = from t in context.CreditCardInfo
                        where t.CNo == textBoxZZLogNo.Text
                        where t.CPassword == pwdBoxZZLog.Password
                        select t;
                if (q.ToList().Count() != 0)
                {
                    MessageBox.Show("登陆成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);

                    var q1 = from t in context.TransferInfo
                             where t.TDate == datePickerZZ.SelectedDate
                             where t.OutNo == textBoxZZLogNo.Text
                             select new
                    {
                        转出账号 = t.OutNo,
                        客户姓名 = t.OutName,
                        转入账户 = t.InNo,

                        金额 = t.TransMoney,
                        日期 = t.TDate
                    };
                    if (q1.ToList().Count == 0)
                    {
                        MessageBox.Show("无存款记录", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                    else
                    {
                        dataGridZZ.ItemsSource = q1.ToList();
                    }
                }
            }
        }
Пример #3
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());
                }
            }
        }
Пример #4
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);
         }
     }
 }
Пример #5
0
 private void DatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
 {
     using (var context = new BankInfoManagementEntities())
     {
         var q = from t in context.OperationLog
                 where t.CDate == datePicker1.SelectedDate
                 select new
         {
             账号   = t.CNo,
             客户姓名 = t.CName,
             操作类型 = t.CStyle,
             日期   = t.CDate,
             金额   = t.CMoney,
             存款时长 = t.CTimeLen,
             利率   = t.CRate
         };
         dataGrid1.ItemsSource = q.ToList();
         var q1 = (from t in context.OperationLog
                   where t.CStyle.Contains("存")
                   select t).Sum(x => x.CMoney);
         textBoxInTotal.Text = q1.ToString() + "¥";
         var q2 = (from t in context.OperationLog
                   where t.CStyle.Contains("取")
                   select t).Sum(x => - x.CMoney);
         textBoxOutTotal.Text = q2.ToString() + "¥";
     }
 }
Пример #6
0
        private void btnSubmitQK_Click(object sender, RoutedEventArgs e)
        {
            decimal y = 0, t1 = 0;

            using (var context = new BankInfoManagementEntities())
            {
                var q = from t in context.CreditCardInfo
                        where t.CNo == textBoxQNo.Text
                        where t.CPassword == textBoxQPwd.Password
                        select t;
                if (q.ToList().Count == 0)
                {
                    MessageBox.Show("用户名或密码错误!!请重新输入!", "警告", MessageBoxButton.OK, MessageBoxImage.Warning);
                    textBoxCNo.Text      = "";
                    textBoxCPwd.Password = "";
                }
                else
                {
                    db            Db   = new db();
                    SqlConnection conn = db.Camcon();
                    conn.Open();

                    string        str1 = "select CBalance from CreditCardInfo where CNo='" + textBoxQNo.Text + "'";
                    SqlCommand    comm = new SqlCommand(str1, conn);
                    SqlDataReader sdr  = comm.ExecuteReader();
                    sdr.Read();
                    y = Convert.ToDecimal(sdr["CBalance"].ToString());
                    sdr.Close();
                    t1 = y - Convert.ToDecimal(textBoxQMoney.Text);
                    if (t1 > 0)
                    {
                        textBoxQType.Text = "取款";
                        string Procedure_QK = "exec DepositOperation'" + textBoxQNo.Text + "','" + textBoxQPwd.Password + "','" + textBoxQName.Text + "','" + Convert.ToDecimal(textBoxQMoney.Text) + "','" + textBoxQType.Text + "','" + "0" + "'";
                        MessageBox.Show("\r\t卡上总余额" + y + "人民币\r\t可操作余额" + t1 + "人民币");
                        if (Db.SQlCommand(Procedure_QK) > 0)
                        {
                            MessageBox.Show("取款成功");
                        }
                        else
                        {
                            MessageBox.Show("取款失败");
                        }
                    }
                    else
                    {
                        MessageBox.Show("\r\t卡上总余额" + y + "人民币\r\t可操作余额" + y + "人民币" + "余额不足", "警告", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }
            }
        }
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            AdminManageWindow amw = new AdminManageWindow();

            if (comoBoxUserType.SelectedIndex == 0)
            {
                using (var context = new BankInfoManagementEntities())
                {
                    var q = from t in context.EmploeeInfo
                            where t.YNo == textBoxUserName.Text
                            where t.YPassword == pwdBoxUserPassword.Password
                            where t.YPosition == 1
                            select t;
                    if (q.ToList().Count() != 0)
                    {
                        MessageBox.Show("登陆成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                        this.Close();
                        amw.Show();
                    }
                    else
                    {
                        MessageBox.Show("登陆失败,账户名或密码错误", "警告", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }
            }
            else
            {
                AssistantWindow aw = new AssistantWindow();
                using (var context = new BankInfoManagementEntities())
                {
                    var q = from t in context.EmploeeInfo
                            where t.YNo == textBoxUserName.Text
                            where t.YPassword == pwdBoxUserPassword.Password
                            where t.YPosition == 0
                            select t;
                    if (q.ToList().Count() != 0)
                    {
                        MessageBox.Show("登陆成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                        this.Close();
                        aw.Show();
                    }
                    else
                    {
                        MessageBox.Show("登陆失败,账户名或密码错误", "警告", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }
            }
        }
Пример #8
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);
         }
     }
 }
 private void btnCheckInterest_Click(object sender, RoutedEventArgs e)
 {
     using (var context = new BankInfoManagementEntities())
     {
         var q = from t in context.CreditCardInfo
                 where t.CNo == textBoxCheckCNo.Text
                 where t.CPassword == textBoxCheckPwd.Password
                 select t;
         if (q.ToList().Count() != 0)
         {
             MessageBox.Show("登录成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
             if (radioBtnLCZQ.IsChecked == true)
             {
                 var q1 = from t in context.OperationLog
                          where t.CDate == datePicker2.SelectedDate
                          where t.CNo == textBoxCheckCNo.Text
                          where t.CStyle.Contains("零存整取")
                          select new
                 {
                     账号   = t.CNo,
                     客户姓名 = t.CName,
                     操作类型 = t.CStyle,
                     日期   = t.CDate,
                     金额   = t.CMoney,
                     存款时长 = t.CTimeLen,
                     利率   = t.CRate,
                     利息   = t.Interest
                 };
                 if (q1.ToList().Count == 0)
                 {
                     MessageBox.Show("无存款记录", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                 }
                 else
                 {
                     dataGrid2.ItemsSource = q1.ToList();
                 }
             }
             else if (radioBtnDQCK.IsChecked == true)
             {
                 var q2 = from t in context.OperationLog
                          where t.CDate == datePicker2.SelectedDate
                          where t.CNo == textBoxCheckCNo.Text
                          where t.CStyle.Contains("定存")
                          select new
                 {
                     账号   = t.CNo,
                     客户姓名 = t.CName,
                     操作类型 = t.CStyle,
                     日期   = t.CDate,
                     金额   = t.CMoney,
                     利率   = t.CRate,
                     利息   = t.Interest
                 };
                 if (q2.ToList().Count == 0)
                 {
                     MessageBox.Show("无记录", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                 }
                 else
                 {
                     dataGrid2.ItemsSource = q2.ToList();
                 }
             }
         }
         else
         {
             MessageBox.Show("登录失败,账户名或密码错误", "警告", MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
 }