private void button1_Click(object sender, EventArgs e)
        {
            int        amt      = int.Parse(txt_wdamt.Text);
            string     password = txt_wdpass.Text;
            Account_DB acc      = new Account_DB();

            if (password == Session.user.password)
            {
                if (int.Parse(acc.getBalance(Session.user.id)) >= amt)
                {
                    acc.updatebalance(Session.user, amt, "withdraw");
                    MessageBox.Show("you successfully withdraw amount");

                    Transaction_DB tranc = new Transaction_DB();
                    tranc.date    = DateTime.Now.ToString();
                    tranc.desc    = "Amount withdraw";
                    tranc.credit  = "";
                    tranc.debit   = "-" + txt_wdamt.Text;
                    tranc.balance = int.Parse(new Account_DB().getBalance(Session.user.id));
                    tranc.userid  = Session.user.id;
                    new Transaction_DB().AddTransaction(tranc);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Insufficeint Balance");
                }
            }
            else
            {
                MessageBox.Show("incorrect Password");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            int    amt      = int.Parse(txt_amt.Text);
            string password = txt_pass.Text;

            if (password == Session.password)
            {
                Account_DB acc = new Account_DB();
                acc.updatebalance(Session.user, amt, "withdraw");
                MessageBox.Show("Recharge Successfull");
                Transaction_DB tranc = new Transaction_DB();
                tranc.date    = DateTime.Now.ToString();
                tranc.desc    = "recharge done to No :" + txt_number.Text;
                tranc.credit  = "";
                tranc.debit   = "-" + txt_amt.Text;
                tranc.balance = int.Parse(new Account_DB().getBalance(Session.user.id));
                tranc.userid  = Session.user.id;
                new Transaction_DB().AddTransaction(tranc);

                this.Close();
            }
        }
示例#3
0
        private void button1_Click(object sender, EventArgs e)
        {
            int    amt  = int.Parse(txt_amount.Text);
            String pass = txt_password.Text;

            if (pass == Session.user.password)
            {
                Account_DB acc = new Account_DB();
                acc.updatebalance(Session.user, amt, "withdraw");
                MessageBox.Show("amount paid");
                Transaction_DB tranc = new Transaction_DB();
                tranc.date    = DateTime.Now.ToString();
                tranc.desc    = "Gas bill paid with cust id: " + txt_cust_id.Text;
                tranc.credit  = "";
                tranc.debit   = "-" + txt_amount.Text;
                tranc.balance = int.Parse(new Account_DB().getBalance(Session.user.id));
                tranc.userid  = Session.user.id;
                new Transaction_DB().AddTransaction(tranc);

                this.Close();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                int        amount = int.Parse(txt_amt.Text);
                Account_DB acc    = new Account_DB();
                acc.updatebalance(Session.user, amount, "add");
                MessageBox.Show("Amount added");

                Transaction_DB tranc = new Transaction_DB();
                tranc.date    = DateTime.Now.ToString();
                tranc.desc    = "Amount added";
                tranc.credit  = "+" + txt_amt.Text;
                tranc.debit   = "";
                tranc.balance = int.Parse(new Account_DB().getBalance(Session.user.id));
                tranc.userid  = Session.user.id;
                new Transaction_DB().AddTransaction(tranc);
                this.Close();
            }catch (FormatException ex)
            {
                MessageBox.Show("Enter some amount" + ex);
            }
        }