Example #1
0
        //To Update the deposit details and save into th db
        private void UpdateButton_Click(object sender, EventArgs e)
        {
            try
            {
                banking_dbEntities1 context = new banking_dbEntities1();
                NewAccountForm      acc     = new NewAccountForm();
                Deposit             dp      = new Deposit();
                dp.Date       = datelbl.Text;
                dp.AccountNo  = Convert.ToDecimal(acctxt.Text);
                dp.Name       = nametxt.Text;
                dp.OldBalance = Convert.ToDecimal(oldbaltxt.Text);
                dp.Mode       = comboBox1.SelectedItem.ToString();
                dp.DipAmount  = Convert.ToDecimal(amounttxt.Text);
                context.Deposits.Add(dp);
                context.SaveChanges();
                decimal b    = Convert.ToDecimal(acctxt.Text);
                var     item = (from u in context.userAccounts
                                where u.Account_No == b
                                select u).FirstOrDefault();

                item.balance = item.balance + Convert.ToDecimal(amounttxt.Text);
                context.SaveChanges();
                //    MessageBox.Show("Deposited Money Sucessfully");
                MessageBox.Show("Deposited Money Sucessfully", "Deposit information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception occurred");
            }
        }
Example #2
0
        private void newAccountToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewAccountForm newacc = new NewAccountForm();

            newacc.MdiParent = this;
            newacc.Show();
        }