Esempio n. 1
0
 private void btnEditUser_Click(object sender, EventArgs e)
 {
     if (gridUser.RowCount > 0)
     {
         DataRow row = gridUser.GetDataRow(gridUser.GetSelectedRows()[0]);
         EditUser.oldInfo = row;
         EditUser edit = new EditUser();
         edit.ShowDialog();
         dgvListUser.DataSource = User_BUS.ListUsers();
     }
     else
     {
         MessageBox.Show("Error!", "My Application", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
 }
Esempio n. 2
0
 private void btnDeleteUser_Click(object sender, EventArgs e)
 {
     if (gridUser.RowCount > 0)
     {
         DataRow      row          = gridUser.GetDataRow(gridUser.GetSelectedRows()[0]);
         DialogResult dialogResult = MessageBox.Show("Are you sure?", "Delete user", MessageBoxButtons.YesNo);
         if (dialogResult == DialogResult.Yes)
         {
             User_BUS.DeleteUser(row["IDUser"].ToString());
             MessageBox.Show("User was deleted", "My Application", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
         dgvListUser.DataSource = User_BUS.ListUsers();
     }
     else
     {
         MessageBox.Show("Error!", "My Application", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
 }
Esempio n. 3
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     dgvListUser.DataSource = User_BUS.ListUsers();
 }
Esempio n. 4
0
 private void ListUser_Load(object sender, EventArgs e)
 {
     dgvListUser.DataSource = User_BUS.ListUsers();
 }