private void studEst_FormClosing(object sender, FormClosingEventArgs e) { studentWork sw = new studentWork(numStud); sw.Show(); this.Hide(); }
private void checkStudent() { conn = new SqlConnection(connectionString); conn.Open(); SqlCommand comm = new SqlCommand(); comm.Connection = conn; comm.CommandText = "select [№ студента] from Студент where Фамилия = '"+ textBox1.Text +"' and Имя = '"+ textBox2.Text +"' and Отчество = '"+ textBox3.Text +"' and Пароль = '"+ textBox4.Text +"'"; SqlDataReader rdr = comm.ExecuteReader(); if (rdr.HasRows) { label6.Visible = false; rdr.Read(); studentWork sw = new studentWork(rdr[0].ToString(),textBox4.Text); sw.Show(); this.Hide(); } else { label6.Visible = true; clearColumns(); } rdr.Close(); conn.Close(); }
private void выходToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("Вы уверены, что хотите вернуться в систему?", "Подтверждение", MessageBoxButtons.OKCancel) == DialogResult.OK) { string pass = (string)SelectPassStud(); studentWork studwork = new studentWork(NumStud.ToString(), pass); this.Hide(); studwork.Show(); } }