예제 #1
0
        private void newAcoountToolStripMenuItem_Click(object sender, EventArgs e)
        {
            newAccount newacc = new newAccount();

            newacc.MdiParent = this;
            newacc.Show();
        }
예제 #2
0
        private void SaveDate()
        {
            banking_dbEntities dbe  = new banking_dbEntities();
            newAccount         nacc = new newAccount();
            debit dp = new debit();

            dp.Date        = lblDate.Text;
            dp.AccountNo   = Convert.ToDecimal(txtAccountNumber.Text);
            dp.Name        = txtName.Text;
            dp.OldBalancae = Convert.ToDecimal(txtOldBalance.Text);
            dp.Mode        = cboMode.SelectedItem.ToString();
            dp.DebAmount   = Convert.ToDecimal(txtAmount.Text);
            dbe.debits.Add(dp);
            dbe.SaveChanges();

            decimal b = Convert.ToDecimal(txtAccountNumber.Text);

            var item = (from u in dbe.userAccounts
                        where u.Account_No == b
                        select u).FirstOrDefault();

            item.Balance = item.Balance - Convert.ToDecimal(txtAmount.Text);
            dbe.SaveChanges();
            MessageBox.Show("Debit Money");
        }
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            banking_dbEntities context = new banking_dbEntities();
            newAccount         acc     = new newAccount();
            Deposit            dp      = new Deposit();

            dp.Date        = lblDate.Text;
            dp.AccountNo   = Convert.ToDecimal(txtAccountNumber.Text);
            dp.Name        = txtName.Text;
            dp.OldeBalance = Convert.ToDecimal(txtOldBalance.Text);
            dp.Mode        = cboMode.SelectedItem.ToString();
            dp.DipAmount   = Convert.ToDecimal(txtAmount.Text);
            context.Deposits.Add(dp);
            context.SaveChanges();
            decimal b    = Convert.ToDecimal(txtAccountNumber.Text);
            var     item = (from u in context.userAccounts
                            where u.Account_No == b
                            select u).FirstOrDefault();

            item.Balance = item.Balance + Convert.ToDecimal(txtAmount.Text);
            context.SaveChanges();
            MessageBox.Show("Deposit Money Successfully");
        }