예제 #1
0
 private void buttonConfirm_Click(object sender, EventArgs e)
 {
     if (AdminForm.send == "exam")
     {
         con.Open();
         string       Query = "SELECT * FROM `exam` WHERE `exam`.`exam_id`=@textBoxExamID";
         MySqlCommand cmd   = new MySqlCommand(Query, con);
         cmd.Parameters.AddWithValue("@textBoxExamID", textBoxExamID.Text);
         UpdtadeDataTable = new DataTable();
         MySqlDataAdapter da = new MySqlDataAdapter(cmd);
         da.Fill(UpdtadeDataTable);
         if (UpdtadeDataTable.Rows.Count == 0)
         {
             MessageBox.Show("המבחן שהוזן אינו קיים");
         }
         else
         {
             exam    = textBoxExamID.Text;
             needUpd = true;
             AdminNewExamForm adminNew = new AdminNewExamForm();
             Hide();
             Login.adminF.Hide();
             adminNew.Show();
         }
         con.Close();
     }
     else if (AdminForm.send == "proctor")
     {
         con.Open();
         string       Query = "SELECT * FROM `proctor` WHERE `proctor`.`proctor_id`=@textBoxExamID";
         MySqlCommand cmd   = new MySqlCommand(Query, con);
         cmd.Parameters.AddWithValue("@textBoxExamID", textBoxExamID.Text);
         UpdtadeDataTable = new DataTable();
         MySqlDataAdapter da = new MySqlDataAdapter(cmd);
         da.Fill(UpdtadeDataTable);
         if (UpdtadeDataTable.Rows.Count == 0)
         {
             MessageBox.Show("ת.ז שהוזנה אינה קיים");
         }
         else
         {
             proctor = textBoxExamID.Text;
             needUpd = true;
             AddProctorForm add = new AddProctorForm();
             Hide();
             Login.adminF.Hide();
             add.Show();
         }
         con.Close();
     }
 }
예제 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (button1.Text.Equals("הוספת בחינה חדשה"))
     {
         AdminNewExamForm admN = new AdminNewExamForm();
         admN.Show();
         Hide();
     }
     if (button1.Text.Equals("הוספת משגיח בחינה"))
     {
         AddProctorForm addProctor = new AddProctorForm();
         Hide();
         addProctor.Show();
     }
 }