private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { Stall_Manage.mForm1_main f = new Stall_Manage.mForm1_main(); f.OnlyNumber(e); }
private void button1_Click(object sender, EventArgs e) { login a = new login(); stall_merchant.Merchant merchant = new stall_merchant.Merchant(); if (textBox1.Text == "") { MessageBox.Show("请输入用户名"); } else { if (textBox2.Text == "") { MessageBox.Show("请输入密码"); } else { if (a.staffexist(textBox1.Text.ToString()) || merchant.merchantexist(textBox1.Text.ToString())) { if (a.check(textBox1.Text, textBox2.Text)) { user_ifms.ID = textBox1.Text; if (user_ifms.ID[0] == '5')//warehouse 管仓库5 { Stall_Manage.wForm1_main p = new Stall_Manage.wForm1_main(); this.Hide(); p.ShowDialog(); this.Close(); } else if (user_ifms.ID[0] == '6')//管摊位信息登陆 { Stall_Manage.sForm1_main p = new Stall_Manage.sForm1_main(); this.Hide(); p.ShowDialog(); this.Close(); } else if (user_ifms.ID[0] == '7')//管商家的人登陆 { Stall_Manage.mForm1_main p = new Stall_Manage.mForm1_main(); this.Hide(); p.ShowDialog(); this.Close(); } else if (user_ifms.ID[0] == '8' || user_ifms.ID[0] == '9')//管理员工信息人事部登陆 { Stall_Manage.staffForm1_main p = new Stall_Manage.staffForm1_main(); this.Hide(); p.ShowDialog(); this.Close(); } else//商家登陆 { this.Hide(); usermainpage pp = new usermainpage(); pp.ShowDialog(); this.Close(); } } else { MessageBox.Show("登录失败,请检查用户名和密码"); } } else { MessageBox.Show("用户名不存在"); } } } }