private void Button6_Click(object sender, EventArgs e) { mainwindow f1 = new mainwindow(); f1.Show(); this.Hide(); }
private void button5_Click(object sender, EventArgs e) { mainwindow m1 = new mainwindow(); m1.Show(); this.Hide(); }
private bool Login() { if (textBox1.Text == "" || textBox2.Text == "" || comboBox1.Text == "") { MessageBox.Show("输入不完整,请检查", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } else { string sql = "select *from Login1 where EmployeeNum='" + textBox1.Text + "'and UserPass='******'and level='" + comboBox1.Text + "'"; Dao dao = new Dao(); IDataReader dr = dao.read(sql); if (dr.Read()) { if (comboBox1.Text == "0") { eNum = dr["EmployeeNum"].ToString(); uMainwindow f1 = new uMainwindow(eNum); f1.Show(); this.Hide(); } else if (comboBox1.Text == "1") { mainwindow f1 = new mainwindow(); f1.Show(); this.Hide(); } } else { MessageBox.Show("用户名或密码不正确", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } } return(true); }