private void Button2_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=Stoc;Integrated Security=True"); SqlDataAdapter sda = new SqlDataAdapter(@"SELECT Rol FROM Inregistrare where Nume = '" + textBox1.Text + "' and Parola = '" + textBox2.Text + "'", con); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows.Count == 1) //verifica nume si parola { this.Hide(); StocPrincipal prin = new StocPrincipal(); prin.Show(); Produs prod = new Produs(); prod.MdiParent = prin; prod.Show(); } else { MessageBox.Show("Nume sau parola gresita", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ProduseToolStripMenuItem_Click(object sender, EventArgs e) { Produs pro = new Produs(); pro.MdiParent = this; pro.Show(); }