private void EditAccount_Load(object sender, EventArgs e)
        {
            DataAccessTier.Account dp = new DataAccessTier.Account();
            DataTable dt = new DataTable();

            dt = dp.SelectRecords();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cmdLoad.Items.Add(dt.Rows[i][2]);
            }
        }
        private void AddTransaction_Load(object sender, EventArgs e)
        {
            DataAccessTier.Account dp = new DataAccessTier.Account();
            DataTable dt = new DataTable();

            dt = dp.SelectRecords();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                cmdLoad.Items.Add(dt.Rows[i][0]);
                metroComboBox1.Items.Add(dt.Rows[i][0]);
            }
        }
Example #3
0
        private void btnDelte_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value);

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

            dp.DeleteAccount(id);


            MessageBox.Show("Delete Sucessful");

            DataTable dt = new DataTable();

            dt = dp.SelectRecords();

            dataGridView1.DataSource = dt;
        }
Example #4
0
        private void DeleteAccount_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.Account dp = new DataAccessTier.Account();
            DataTable dt = new DataTable();

            dt = dp.SelectRecords();

            dataGridView1.DataSource = dt;
        }