示例#1
0
        //取款
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            var fre = from x in dbEntity.AccountInfo
                      where x.accountNo == txtAccount.Text
                      select x;


            foreach (var i in fre)
            {
                if (i.freeze == "y")
                {
                    MessageBox.Show("此账户已被冻结", "提示");
                    this.txtAccount.Clear();
                    this.txtPassword.Clear();
                    this.txtmount.Clear();
                }
                else
                {
                    Custom custom = DataOperation.GetCustom(this.txtAccount.Text);
                    if (custom.AccountInfo.accountPass != this.txtPassword.Password)
                    {
                        MessageBox.Show("密码不正确");
                        return;
                    }
                    custom.Withdraw(double.Parse(this.txtmount.Text));
                    OperateRecord     page = new OperateRecord();
                    NavigationService ns   = NavigationService.GetNavigationService(this);
                    ns.Navigate(page);
                }
            }
        }
示例#2
0
        //取消取款
        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            OperateRecord     page = new OperateRecord();
            NavigationService ns   = NavigationService.GetNavigationService(this);

            ns.Navigate(page);
        }
示例#3
0
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            Custom custom = DataOperation.GetCustom(this.txtAccount.Text);

            if (custom == null)
            {
                MessageBox.Show("帐号不存在!");
                return;
            }

            if (custom.CheckLost())
            {
                MessageBox.Show("账户已挂失不能使用!");
                return;
            }

            if (custom.AccountInfo.accountPass != this.txtPassword.Password)
            {
                MessageBox.Show("密码不正确");
                return;
            }

            if (this.CheckAlreadyLoan(this.txtAccount.Text))
            {
                MessageBox.Show("您已经贷款,每个客户只能贷一次!");
                return;
            }

            double loanAmount;

            if (!double.TryParse(this.txtmount.Text.Trim(), out loanAmount))
            {
                MessageBox.Show("输入的金额格式不正确");
                return;
            }

            if (loanAmount > this.CheckLoadMax(this.txtAccount.Text.Trim()))
            {
                MessageBox.Show("贷款金额超出信用额度(历史交易额总和的10倍)");
                return;
            }

            int loanYear;

            if (!int.TryParse(this.txtYear.Text.Trim(), out loanYear))
            {
                MessageBox.Show("输入的贷款年限格式不正确");
                return;
            }

            double rate = this.GetLoadRateOfYear(loanYear);

            CalcAndShowTotalInterest(loanAmount, rate, loanYear);
            custom.Diposit("贷款", loanAmount);
            OperateRecord     page = new OperateRecord();
            NavigationService ns   = NavigationService.GetNavigationService(this);

            ns.Navigate(page);
        }
示例#4
0
        //取消开户
        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            this.txtAccountName.Clear();
            this.txtIDCard.Clear();
            this.txtAccountName.Clear();
            this.txtPass.Clear();
            this.txtMoney.Clear();
            OperateRecord     page = new OperateRecord();
            NavigationService ns   = NavigationService.GetNavigationService(this);

            ns.Navigate(page);
        }
示例#5
0
        // 转账
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            if (txtAccount.Text == "" || selfId.Text == "" || othersId.Text == "" || txtPassword.Password == "" || txtmount.Text == "")
            {
                MessageBox.Show("红色*标注的为必填内容");
            }
            else
            {
                var fre = from x in dbEntity.AccountInfo
                          where x.accountNo == txtAccount.Text
                          select x;

                foreach (var i in fre)
                {
                    if (i.freeze == "y")
                    {
                        MessageBox.Show("此账户已被冻结", "提示");
                        this.txtAccount.Clear();
                        this.txtPassword.Clear();
                        this.txtmount.Clear();
                        this.selfId.Clear();
                        this.othersId.Clear();
                    }
                    else
                    {
                        Custom custom = DataOperation.GetCustom(this.txtAccount.Text);
                        if (custom.AccountInfo.accountPass != this.txtPassword.Password)
                        {
                            MessageBox.Show("密码不正确");
                            return;
                        }
                        else if (custom.AccountInfo.IdCard != this.selfId.Text)
                        {
                            MessageBox.Show("账户不存在此银行卡");
                            return;
                        }
                        else if (custom.MoneyInfo.balance - double.Parse(txtmount.Text) < 0)
                        {
                            MessageBox.Show("账户余额不足");
                        }
                        else
                        {
                            custom.Transfer(double.Parse(this.txtmount.Text));
                        }
                        OperateRecord     page = new OperateRecord();
                        NavigationService ns   = NavigationService.GetNavigationService(this);
                        ns.Navigate(page);
                    }
                }
            }
        }
示例#6
0
 //存款
 private void btnOk_Click(object sender, RoutedEventArgs e)
 {
     Custom custom = DataOperation.GetCustom(this.txtAccount.Text);
     if (custom == null)
     {
         MessageBox.Show("帐号不存在!");
         return;
     }
     custom.MoneyInfo.accountNo = txtAccount.Text;
     custom.Diposit("存款", double.Parse(this.txtmount.Text));
     OperateRecord page = new OperateRecord();
     NavigationService ns = NavigationService.GetNavigationService(this);
     ns.Navigate(page);
 }
        //开户
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            Custom custom = DataOperation.CreateCustom(comboBoxAccountType.SelectedItem.ToString());

            custom.AccountInfo.accountNo   = this.txtAccountNo.Text;
            custom.AccountInfo.IdCard      = this.txtIDCard.Text;
            custom.AccountInfo.accountName = this.txtAccountName.Text;
            custom.AccountInfo.accountPass = this.txtPass.Password;
            custom.Create(this.txtAccountNo.Text, double.Parse(this.txtMoney.Text));
            OperateRecord     page = new OperateRecord();
            NavigationService ns   = NavigationService.GetNavigationService(this);

            ns.Navigate(page);
        }
示例#8
0
        //取款
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            string str;
            Custom custom = DataOperation.GetCustom(this.txtAccount.Text);

            // CustomFixed customFixed = (CustomFixed)DataOperation.GetCustom(this.txtAccount.Text);
            //  CustomSmallSum customSmallSum = (CustomSmallSum)DataOperation.GetCustom(this.txtAccount.Text);
            if (custom.AccountInfo.accountPass != this.txtPassword.Password)
            {
                MessageBox.Show("密码不正确");
                return;
            }
            if (custom.AccountInfo.IsLoss == 1)
            {
                MessageBox.Show("该卡已经被挂失!");
                return;
            }
            int mark = this.txtAccount.Text.IndexOf("3");

            if (mark == 0)
            {
                var q = from t in context.MoneyInfo
                        where t.accountNo == this.txtAccount.Text
                        select t.balance;

                str = q.ToList().Last().ToString();
                //var qq = q.Last();
                if (str != this.txtmount.Text)
                {
                    MessageBox.Show("请一次将零存整取账户中的余额取完\n" + "当前余额:" + str + " 元");
                    return;
                }
            }
            if (this.txtAccount.Text.IndexOf("3") == 0)
            {
                CustomSmallSum css = new CustomSmallSum();
                css.setaccount(this.txtAccount.Text);
            }
            else if (this.txtAccount.Text.IndexOf("2") == 0)
            {
                CustomFixed cf = new CustomFixed();
                cf.setaccount(this.txtAccount.Text);
            }
            custom.Withdraw(double.Parse(this.txtmount.Text));
            OperateRecord     page = new OperateRecord();
            NavigationService ns   = NavigationService.GetNavigationService(this);

            ns.Navigate(page);
        }
示例#9
0
        //取款
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            Custom custom = DataOperation.GetCustom(this.txtAccount.Text);

            if (custom.AccountInfo.accountPass != this.txtPassword.Password)
            {
                MessageBox.Show("密码不正确");
                return;
            }
            custom.Withdraw(double.Parse(this.txtmount.Text));
            OperateRecord     page = new OperateRecord();
            NavigationService ns   = NavigationService.GetNavigationService(this);

            ns.Navigate(page);
        }
        //存款
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            Custom custom = DataOperation.GetCustom(this.txtAccount.Text);

            if (custom == null)
            {
                MessageBox.Show("帐号不存在!");
                return;
            }
            custom.MoneyInfo.accountNo = txtAccount.Text;
            custom.Diposit("存款", double.Parse(this.txtmount.Text));
            OperateRecord     page = new OperateRecord();
            NavigationService ns   = NavigationService.GetNavigationService(this);

            ns.Navigate(page);
        }
示例#11
0
        //存款
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            string str; int a = 0;
            Custom custom = DataOperation.GetCustom(this.txtAccount.Text);

            if (custom == null)
            {
                MessageBox.Show("帐号不存在!");
                return;
            }

            if (custom.CheckLost())
            {
                MessageBox.Show("账户已挂失不能使用!");
                return;
            }

            str = this.txtmount.Text;
            a   = 0;
            for (int i = 0; i < str.Length; i++)
            {
                if (char.IsNumber(str[i]))
                {
                    a++;
                }
            }
            if (a == str.Length && a != 0)
            {
                custom.MoneyInfo.accountNo = txtAccount.Text;
            }
            else
            {
                MessageBox.Show("操作失败,请输入存款为数字");
                this.txtmount.Text = null; return;
            }

            custom.Diposit("存款", double.Parse(this.txtmount.Text));
            OperateRecord     page = new OperateRecord();
            NavigationService ns   = NavigationService.GetNavigationService(this);

            ns.Navigate(page);
        }
示例#12
0
 //取款
 private void btnOk_Click(object sender, RoutedEventArgs e)
 {
     Custom custom = DataOperation.GetCustom(this.txtAccount.Text);
     if (custom == null)
     {
         MessageBox.Show("账号不存在!");
     }
     else
     {
         if (custom.AccountInfo.accountPass != this.txtPassword.Password)
         {
             MessageBox.Show("密码不正确");
             return;
         }
         custom.Withdraw(double.Parse(this.txtmount.Text));
         OperateRecord page = new OperateRecord();
         NavigationService ns = NavigationService.GetNavigationService(this);
         ns.Navigate(page);
     }
     
 }
示例#13
0
        //取款
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            string str; int a = 0;
            Custom custom = DataOperation.GetCustom(this.txtAccount.Text);

            if (custom == null)
            {
                MessageBox.Show("帐号不存在!");
                return;
            }
            if (custom.AccountInfo.accountPass != this.txtPassword.Password)
            {
                MessageBox.Show("密码不正确");
                return;
            }
            str = this.txtmount.Text;
            a   = 0;
            for (int i = 0; i < str.Length; i++)
            {
                if (char.IsNumber(str[i]))
                {
                    a++;
                }
            }
            if (a == str.Length && a != 0)
            {
                custom.Withdraw(double.Parse(this.txtmount.Text));
            }
            else
            {
                MessageBox.Show("操作失败,请输入取款为数字");
                this.txtmount.Text = null; return;
            }
            OperateRecord     page = new OperateRecord();
            NavigationService ns   = NavigationService.GetNavigationService(this);

            ns.Navigate(page);
        }
示例#14
0
        //存款
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            var fre = from x in dbEntity.AccountInfo
                      where x.accountNo == txtAccount.Text
                      select x;

            foreach (var i in fre)
            {
                if (i.freeze == "y")
                {
                    MessageBox.Show("此账户已被冻结", "提示");
                    this.txtAccount.Clear();
                    this.txtmount.Clear();
                }
                else
                {
                    Custom custom = DataOperation.GetCustom(this.txtAccount.Text);
                    if (custom == null)
                    {
                        MessageBox.Show("帐号不存在!");
                        return;
                    }

                    custom.MoneyInfo.accountNo = txtAccount.Text;
                    var type = from x in dbEntity.AccountInfo
                               where x.accountNo == txtAccount.Text
                               select x;

                    foreach (var t in type)
                    {
                        if (t.accountType == "定期存款" || t.accountType == "活期存款")
                        {
                            int count1 = int.Parse(txtmount.Text);
                            if (count1 > 100)
                            {
                                custom.Diposit("存款", double.Parse(this.txtmount.Text));
                                OperateRecord     page = new OperateRecord();
                                NavigationService ns   = NavigationService.GetNavigationService(this);
                                ns.Navigate(page);
                            }
                            else
                            {
                                MessageBox.Show("低于最低存储金额");
                            }
                        }
                    }
                    foreach (var t in type)
                    {
                        if (t.accountType == "零存整取")
                        {
                            int count1 = int.Parse(txtmount.Text);
                            if (count1 > 5)
                            {
                                custom.Diposit("存款", double.Parse(this.txtmount.Text));
                                OperateRecord     page = new OperateRecord();
                                NavigationService ns   = NavigationService.GetNavigationService(this);
                                ns.Navigate(page);
                            }
                            else
                            {
                                MessageBox.Show("低于最低存储金额");
                            }
                        }
                    }
                }
            }
        }
示例#15
0
        //开户
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            String acconuttype = comboBoxAccountType.SelectedItem.ToString();
            Custom custom = DataOperation.CreateCustom(comboBoxAccountType.SelectedItem.ToString());
            if (acconuttype=="活期存款")
            {
                if ( Convert.ToInt32(this.txtMoney.Text)<100)
                {
                    MessageBox.Show("活期存款最低存款金额不能少于100元!");
                }
                else
                {
                    custom.AccountInfo.accountNo = this.txtAccountNo.Text;
                    custom.AccountInfo.IdCard = this.txtIDCard.Text;
                    custom.AccountInfo.accountName = this.txtAccountName.Text;
                    custom.AccountInfo.accountPass = this.txtPass.Password;
                    custom.Create(this.txtAccountNo.Text, double.Parse(this.txtMoney.Text));
                    OperateRecord page = new OperateRecord();
                    NavigationService ns = NavigationService.GetNavigationService(this);
                    ns.Navigate(page);
                }
            }
            if (acconuttype=="定期存款")
            {
                if (Convert.ToInt16(this.txtMoney.Text) < 100)
                {
                    MessageBox.Show("定期存款最低存款金额不能少于100元!");
                }
                else
                {
                    custom.AccountInfo.accountNo = this.txtAccountNo.Text;
                    custom.AccountInfo.IdCard = this.txtIDCard.Text;
                    custom.AccountInfo.accountName = this.txtAccountName.Text;
                    custom.AccountInfo.accountPass = this.txtPass.Password;
                    custom.Create(this.txtAccountNo.Text, double.Parse(this.txtMoney.Text));
                    OperateRecord page = new OperateRecord();
                    NavigationService ns = NavigationService.GetNavigationService(this);
                    ns.Navigate(page);
                }
                
            }
            if (acconuttype == "零存整取")
            {
                if (Convert.ToInt16(this.txtMoney.Text) < 5)
                {
                    MessageBox.Show("定期存款最低存款金额不能少于5元!");
                }
                else
                {
                    custom.AccountInfo.accountNo = this.txtAccountNo.Text;
                    custom.AccountInfo.IdCard = this.txtIDCard.Text;
                    custom.AccountInfo.accountName = this.txtAccountName.Text;
                    custom.AccountInfo.accountPass = this.txtPass.Password;
                    custom.Create(this.txtAccountNo.Text, double.Parse(this.txtMoney.Text));
                    OperateRecord page = new OperateRecord();
                    NavigationService ns = NavigationService.GetNavigationService(this);
                    ns.Navigate(page);
                }

            }

           
        }
示例#16
0
        //存款
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            Custom custom = DataOperation.GetCustom(this.txtAccount.Text);

            if (custom == null)
            {
                MessageBox.Show("帐号不存在!");
                return;
            }
            if (custom.AccountInfo.IsLoss == 1)
            {
                MessageBox.Show("该卡已经被挂失!");
                return;
            }
            //获得combox selectindex值
            BankEntities context = new BankEntities();

            custom.MoneyInfo.accountNo = txtAccount.Text;
            if (combox.SelectedIndex == 0)
            {
                custom.Diposit("存款", double.Parse(this.txtmount.Text), combox.SelectedIndex);
            }
            if (combox.SelectedIndex >= 1 && combox.SelectedIndex <= 3)
            {
                custom.Diposit("存款", double.Parse(this.txtmount.Text), combox.SelectedIndex);
            }
            if (combox.SelectedIndex > 3 && combox.SelectedIndex <= 6)
            {
                var q = from t in context.MoneyInfo
                        where t.accountNo == this.txtAccount.Text && t.dealType == "开户"
                        select t;
                var w  = q.FirstOrDefault();
                var qq = from t in context.AccountInfo
                         where t.accountNo == this.txtAccount.Text
                         select t;
                var m = qq.FirstOrDefault();
                if (txtmount.Text != w.balance.ToString())
                {
                    MessageBox.Show("此金额不正确,请重新填写!");
                    return;
                }
                else
                {
                    if (m.accountClass == null)
                    {
                        if (combox.SelectedIndex == 4)
                        {
                            m.accountClass = 1.ToString();
                        }
                        else if (combox.SelectedIndex == 5)
                        {
                            m.accountClass = 3.ToString();
                        }
                        else
                        {
                            m.accountClass = 5.ToString();
                        }
                    }
                    if (m.accountMark.Contains(MouthTimeBox.Text))
                    {
                        MessageBox.Show("此月已经存入所需金额,请重新填写!");
                        return;
                    }
                    else
                    {
                        string str = m.accountMark;
                        m.accountMark = str + " " + MouthTimeBox.Text;
                        context.SaveChanges();
                    }
                }
                custom.Diposit("存款", double.Parse(this.txtmount.Text), combox.SelectedIndex);
            }
            OperateRecord     page = new OperateRecord();
            NavigationService ns   = NavigationService.GetNavigationService(this);

            ns.Navigate(page);
        }
示例#17
0
        //开户
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            string str;
            int    a = 0, b = 0;
            Custom custom = DataOperation.CreateCustom(comboBoxAccountType.SelectedItem.ToString());

            custom.AccountInfo.accountNo = this.txtAccountNo.Text;
            str = this.txtIDCard.Text;
            for (int i = 0; i < str.Length; i++)
            {
                if (char.IsNumber(str[i]))
                {
                    a++;
                }
            }
            if (a == str.Length && a == 18)
            {
                custom.AccountInfo.IdCard = this.txtIDCard.Text;
            }
            else
            {
                MessageBox.Show("操作失败,身份证号请输入18位数字");
                this.txtIDCard.Text = null;
                b++;
                return;
            }
            str = this.txtAccountName.Text;
            a   = 0;
            for (int i = 0; i < str.Length; i++)
            {
                if (char.IsNumber(str[i]))
                {
                    a++;
                }
            }
            if (a == 0)
            {
                custom.AccountInfo.accountName = this.txtAccountName.Text;
            }
            else
            {
                MessageBox.Show("操作失败,姓名不能有数字");
                this.txtAccountName.Text = null;
                b++; return;
            }

            custom.AccountInfo.accountPass = this.txtPass.Password;
            str = this.txtMoney.Text;
            a   = 0;
            for (int i = 0; i < str.Length; i++)
            {
                if (char.IsNumber(str[i]))
                {
                    a++;
                }
            }
            if (a == str.Length && a != 0)
            {
                custom.Create(this.txtAccountNo.Text, double.Parse(this.txtMoney.Text));
            }
            else
            {
                MessageBox.Show("操作失败,请输入存款为数字");
                this.txtMoney.Text = null; return;

                b++;
            }
            if (b == 0)
            {
                OperateRecord     page = new OperateRecord();
                NavigationService ns   = NavigationService.GetNavigationService(this);
                ns.Navigate(page);
            }
        }
示例#18
0
 //取消存款
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     OperateRecord page = new OperateRecord();
     NavigationService ns = NavigationService.GetNavigationService(this);
     ns.Navigate(page);
 }