Exemplo n.º 1
0
 private void btn_add_Click(object sender, EventArgs e)
 {
     using (UserED userED = new UserED())
     {
         if (userED.ShowDialog() != DialogResult.Cancel)
         {
             txt_search.Focus();
             btn_clear.Hide();
             txt_search.Clear();
             this.LoadUser(this.users.getUsers());
         }
     }
 }
Exemplo n.º 2
0
        private void dgv_users_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string user_role = Login.user_role;

            if (e.RowIndex > -1)
            {
                if (user_role.Equals("admin"))
                {
                    int user_id = int.Parse(dgv_users.Rows[e.RowIndex].Cells["id"].Value.ToString());
                    using (UserED userED = new UserED(user_id))
                    {
                        if (userED.ShowDialog() != DialogResult.Cancel)
                        {
                            txt_search.Focus();
                            btn_clear.Hide();
                            txt_search.Clear();
                            this.LoadUser(this.users.getUsers());
                        }
                    }
                }
            }
        }