Example #1
0
 public Administrator()
 {
     InitializeComponent();
     AccGridView.DataSource = admin.AccountTable();
     //Hide Update Button
     Up_BT.Hide();
 }
Example #2
0
        private void Cancel_BT_Click(object sender, EventArgs e)
        {
            //Clear textbox
            ClearData();

            //Hide update button and show add button
            Up_BT.Hide();
            Add_BT.Show();
        }
Example #3
0
        private void AccGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //Show Update button and hide add button
            Up_BT.Show();
            Add_BT.Hide();
            AdminCl admin = new AdminCl();

            //bring data to the textboxes
            string UpdateRow = AccGridView.CurrentRow.Cells["Acc_ID"].Value.ToString();

            Role_Cb.Text = admin.UpdateData(UpdateRow, "Role");
            User_TB.Text = admin.UpdateData(UpdateRow, "Username");
            Pass_TB.Text = admin.UpdateData(UpdateRow, "Password");
            ID_TB.Text   = admin.UpdateData(UpdateRow, "Acc_ID");
        }