private void btn_Back2_Click(object sender, EventArgs e) { MasterPanel teacherPanel = new MasterPanel(id); teacherPanel.Show(); this.Hide(); }
private void btn_enter_Click(object sender, EventArgs e) { if (this.LogInType.GetItemText(this.LogInType.SelectedItem) == "دانشجو") { if (authentication(0, Int32.Parse(username_id.Text), password1.Text)) { StudentPanel studentPanel = new StudentPanel(Int32.Parse((username_id.Text))); studentPanel.Show(); this.Hide(); } } else if (this.LogInType.GetItemText(this.LogInType.SelectedItem) == "استاد") { if (authentication(1, Int32.Parse(username_id.Text), password1.Text)) { MasterPanel teacherPanel = new MasterPanel(Int32.Parse(username_id.Text)); teacherPanel.Show(); this.Hide(); } } else if (this.LogInType.GetItemText(LogInType.SelectedItem) == "آموزش") { if (authentication(2, Int32.Parse(username_id.Text), password1.Text)) { ManagerPanel amoozesh = new ManagerPanel(Int32.Parse(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(); MasterPanel teacherPanel = new MasterPanel(id); teacherPanel.Show(); this.Hide(); } else if (master.EditPassword(currentpassword2.Text, newpassword2.Text, confirmpassword2.Text) == 1) { errorProvider2.SetError(confirmpassword2, "تکرار رمز عبور صحیح نیست"); } else { errorProvider1.SetError(currentpassword2, "رمز عبور اشتباه است"); } }