Exemplo n.º 1
0
        private void delete_btn_Click(object sender, EventArgs e)
        {
            dataBase      dataBase = new dataBase();
            SqlConnection con      = dataBase.connect_to_scheduluz_DB();

            for (int i = 0; i < detele_lst.Items.Count; i++)
            {
                string username = detele_lst.Items[i].ToString().Replace(" ", "");

                string         queryTogetStudentID = "Select id from connection_details Where userName = '******'";
                SqlDataAdapter sda = new SqlDataAdapter(queryTogetStudentID, con);
                DataTable      dtb = new DataTable();
                sda.Fill(dtb);
                string sendToId = dtb.Rows[0][0].ToString().Trim();

                User n = new User();
                n.DeleteUser(sendToId);
            }
            MessageBox.Show("The user deleted.");
            delete_user frm = new delete_user();

            this.Hide();
            frm.Show();
        }
Exemplo n.º 2
0
 private void button2_Click_1(object sender, EventArgs e)
 {
     Manager.delete_user n = new Manager.delete_user();
     n.Show();
     this.Hide();
 }