예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Users_DB user = new Users_DB();

            user.fname    = txt_fname.Text;
            user.lname    = txt_lname.Text;
            user.email    = txt_email.Text;
            user.phone    = txt_phone.Text;
            user.aadhar   = txt_aadhar.Text;
            user.username = txt_username.Text;
            if (txt_password.Text == txt_conf_password.Text)
            {
                user.password = txt_password.Text;
                user.AddAccount(user);
                MessageBox.Show("Account succesfullly created! you can log in now");
                MessageBox.Show("You ge]ot 500rs credit as your welcome gift.");
                Account_DB acc = new Account_DB();
                user.id = new Users_DB().getID(user.email);
                acc.insertBalanceForNew(user, 500);
                this.Close();
                new LoginForm().Show();
            }
            else
            {
                MessageBox.Show("password didnt match!!");
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int    amount      = int.Parse(tx_amt_tsf.Text);
            int    benefociary = int.Parse(txt_bf_acc.Text);
            String password    = txt_pass_tsf.Text;

            if (password == Session.password)
            {
                Account_DB acc = new Account_DB();
                if (amount <= int.Parse(acc.getBalance(Session.user.id)))
                {
                    acc.transfer(Session.user, benefociary, amount);
                }
                MessageBox.Show("Successfullly trasfered");

                Transaction_DB tranc = new Transaction_DB();
                tranc.date    = DateTime.Now.ToString();
                tranc.desc    = "Amout tranferres to user id :" + txt_bf_acc.Text;
                tranc.credit  = "";
                tranc.debit   = "-" + tx_amt_tsf.Text;
                tranc.balance = int.Parse(new Account_DB().getBalance(Session.user.id));
                tranc.userid  = Session.user.id;
                tranc.AddTransaction(tranc);
                tranc.desc    = "Amount recieved from account no. " + Session.user.id;
                tranc.credit  = "+" + tx_amt_tsf.Text;
                tranc.debit   = "";
                tranc.balance = int.Parse(new Account_DB().getBalance(txt_bf_acc.Text));
                tranc.userid  = txt_bf_acc.Text;
                tranc.AddTransaction(tranc);
                this.Close();
            }
        }
예제 #3
0
        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 AccountDetails_Load(object sender, EventArgs e)
        {
            txt_name.Text = Session.fname + " " + Session.lname;
            Account_DB acc = new Account_DB();

            txt_balance.Text = acc.getBalance(Session.user.id);
            Console.WriteLine("id" + Session.user.id);
            datadrid_view.AutoGenerateColumns = true;
            Transaction_DB tranc = new Transaction_DB();

            tranc.fillGridTop5(datadrid_view);

            startTimer();
        }
예제 #5
0
        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();
            }
        }
예제 #6
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();
            }
        }
예제 #7
0
        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);
            }
        }