예제 #1
0
 private void btn_enter_Click(object sender, EventArgs e)
 {
     if (this.LogInType.GetItemText(this.LogInType.SelectedItem) == "دانشجو")
     {
         if (authentication(0, username_id.Text, password1.Text))
         {
             StudentPanel studentPanel = new StudentPanel(username_id.Text);
             studentPanel.Show();
             this.Hide();
         }
         else
         {
             //Showing Error #Not Found
             StudentPanel studentPanel = new StudentPanel(username_id.Text);
             studentPanel.Show();
             this.Hide();
         }
     }
     else if (this.LogInType.GetItemText(this.LogInType.SelectedItem) == "استاد")
     {
         if (authentication(1, username_id.Text, password1.Text))
         {
             TeacherPanel teacherPanel = new TeacherPanel();
             teacherPanel.Show();
             this.Hide();
         }
         else
         {
             TeacherPanel teacherPanel = new TeacherPanel();
             teacherPanel.Show();
             this.Hide();
         }
     }
     else if (this.LogInType.GetItemText(LogInType.SelectedItem) == "آموزش")
     {
         if (authentication(2, username_id.Text, password1.Text))
         {
             ManagerPanel amoozesh = new ManagerPanel(username_id.Text);
             amoozesh.Show();
             this.Hide();
         }
     }
 }
 private void confirm1_Click(object sender, EventArgs e)
 {
     if (std.EditPassword(currentpassword1.Text, newpassword1.Text, confirmpassword1.Text) == 2)
     {
         //FileStream file = File.Create("Uni");
         //BinaryFormatter bf = new BinaryFormatter();
         //bf.Serialize(file, Universal.instance);
         //file.Close();
         StudentPanel studentPanel = new StudentPanel(id);
         studentPanel.Show();
         this.Hide();
     }
     else if (std.EditPassword(currentpassword1.Text, newpassword1.Text, confirmpassword1.Text) == 1)
     {
         errorProvider2.SetError(confirmpassword1, "تکرار رمز عبور صحیح نیست");
     }
     else
     {
         errorProvider1.SetError(currentpassword1, "رمز عبور اشتباه است");
     }
 }