Beispiel #1
0
        protected void DeleteCashier(String id, frmEmployeeReg clear)
        {
            try
            {
                DialogResult check = MessageBox.Show("Delete this account?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                conn = new MySqlConnection(this.connection());
                conn.Open();

                if (check == DialogResult.Yes)
                {
                    using (command = new MySqlCommand("DELETE FROM users WHERE user_id = '" + id + "'", conn))
                    {
                        bool checkResult = (int)command.ExecuteNonQuery() > 0;

                        if (checkResult == true)
                        {
                            MessageBox.Show("Deleted Successfully", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            clear.clearTheWay();
                        }
                    }
                    return;
                }

                conn.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #2
0
 public void DelCashier(String id, frmEmployeeReg clear)
 {
     this.DeleteCashier(id, clear);
 }