Exemple #1
0
 // Check Password Click
 private void BtnHitelesites_Click_1(object sender, EventArgs e)
 {
     using (System.IO.StreamReader sr = new System.IO.StreamReader("data.dat"))
     {
         if (SecurePassword.Decrypt(sr.ReadLine()) == TxtUsername.Text && SecurePassword.Decrypt(sr.ReadLine()) == TxtPassword.Text)
         {
             PanelLocked.Visible = false;
         }
     }
 }
Exemple #2
0
 // New School, Registrate Leader Teacher
 private void BtnRegisztralas_Click(object sender, EventArgs e)
 {
     LblNewErrorLeaderTeacher.Text = string.Empty;
     if (ccs.Belepe())
     {
         LblNewErrorLeaderTeacher.Text += check.notempty(TxtNewLeaderTeacher.Text, TxtNewLeaderTeacherMail.Text, TxtNewLeaderTeacherPhone.Text);
         if (LblNewErrorLeaderTeacher.Text == string.Empty)
         {
             string psw = SecurePassword.UjJelszo();
             ccs.Upload("INSERT INTO `iskola`(`varos`, `cim`, `elerhetoseg`) VALUES ('" + TxtNewSchoolCity.Text + "','" + TxtNewSchoolAddress.Text + "','" + TxtNewSchoolContact.Text + "')");
             int school_id = ccs.Identifier("SELECT MAX(id) FROM iskola");
             ccs.Upload("INSERT INTO `tanar`(`nev`, `felh`, `jelszo`, `tema`, `beosztas_id`, `telsz`, `email`, `iskola_id`) VALUES ('" + TxtNewLeaderTeacher.Text + "','" + TxtUjVoFelh.Text + "','" + "" + SecurePassword.Encrypt(psw) + "','Szürke'," + 1 + ",'" + TxtNewLeaderTeacherPhone.Text + "','" + TxtNewLeaderTeacherMail.Text + "'," + school_id + ")");
             LblNewErrorLeaderTeacher.Text += "Sikeres regisztrálás " + TxtNewLeaderTeacher.Text + " ! \r\n A jelszavad: " + psw + ". \r\n A belépés után kérlek változtasd meg!";
         }
         ccs.connection.Close();
     }
 }