private void btnEdit_Click(object sender, EventArgs e)
        {
            int    id     = Convert.ToInt32(cmdLoad.Text);
            string date   = dateTrans.Text;
            string status = cmdMode.Text;
            double amount = Convert.ToDouble(txtAmm.Text);
            string desc   = txtDesc.Text;
            string type   = cmdTransType.Text;

            DataAccessTier.Transaction tr = new DataAccessTier.Transaction();
            BuisnessTier.Transaction   bt = new BuisnessTier.Transaction();
            if (type == "Withdraw")
            {
                bt.Withdraw(amount, id);
            }
            else if (type == "Deposit")
            {
                bt.Deposit(id, amount);
            }
            tr.InsertBankTransaction(date, amount, type, id, desc, status);

            if (cmdTransType.Text == "Transfer")
            {
                bt.Transfer(id, Convert.ToInt32(metroComboBox1.Text), amount);
                DataTable dt = new DataTable();
                dt = tr.SelectRecords();
                DataAccessTier.MoneyTransfer mt = new DataAccessTier.MoneyTransfer();
                mt.InsertMoneyTransfer(Convert.ToInt32(dt.Rows[dt.Rows.Count - 1][0]), id, Convert.ToInt32(metroComboBox1.Text));
            }


            MessageBox.Show("Transaction performed Sucessfullt");
        }
Пример #2
0
        private void btnDelte_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value);

            DataAccessTier.Transaction dp = new DataAccessTier.Transaction();

            dp.DeleteBankTransaction(id);

            MessageBox.Show("Delete Sucessful");

            DataTable dt = new DataTable();

            dt = dp.SelectRecords();

            dataGridView1.DataSource = dt;
        }
Пример #3
0
        private void ViewTransaction_Load(object sender, EventArgs e)
        {
            dataGridView1.BorderStyle = BorderStyle.None;
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(238, 239, 249);
            dataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.SingleHorizontal;
            dataGridView1.DefaultCellStyle.SelectionBackColor = Color.Green;
            dataGridView1.DefaultCellStyle.SelectionForeColor = Color.WhiteSmoke;
            dataGridView1.BackgroundColor = Color.White;

            dataGridView1.EnableHeadersVisualStyles = false;
            dataGridView1.ColumnHeadersBorderStyle  = DataGridViewHeaderBorderStyle.None;
            dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(50, 205, 50);
            dataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;

            DataAccessTier.Transaction dp = new DataAccessTier.Transaction();
            DataTable dt = new DataTable();

            dt = dp.SelectRecords();

            dataGridView1.DataSource = dt;
        }