private void btn_Back2_Click(object sender, EventArgs e) { TeacherPanel teacherPanel = new TeacherPanel(id); teacherPanel.Show(); this.Hide(); }
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 if (this.LogInType.GetItemText(this.LogInType.SelectedItem) == "استاد") { if (authentication(1, username_id.Text, password1.Text)) { TeacherPanel teacherPanel = new TeacherPanel(username_id.Text); 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 confirm2_Click(object sender, EventArgs e) { if (master.EditPassword(currentpassword2.Text, newpassword2.Text, confirmpassword2.Text) == 2) { FileStream file = File.Create("Uni"); BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(file, Universal.instance); file.Close(); TeacherPanel teacherPanel = new TeacherPanel(id); teacherPanel.Show(); this.Hide(); } else if (master.EditPassword(currentpassword2.Text, newpassword2.Text, confirmpassword2.Text) == 1) { errorProvider2.SetError(confirmpassword2, "تکرار رمز عبور صحیح نیست"); } else { errorProvider1.SetError(currentpassword2, "رمز عبور اشتباه است"); } }