private void Button3_Click(object sender, EventArgs e) { uMainwindow f1 = new uMainwindow(NumS); f1.Show(); this.Hide(); }
private void Button2_Click(object sender, EventArgs e) { uMainwindow f1 = new uMainwindow(NumD); f1.Show(); this.Close(); }
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); }