According to your description, the problem of not jumping to the page, according to the code logic you provided, is the login window form1 did not pop out, or clicked the button in form1 can not open form2. No error is no response.
namespace TomSmartERP.UI
{
public partial class LoginWindow : Form
{
public LoginWindow()
{
InitializeComponent();
}
private void btnLogin_Click(object sender, EventArgs e)
{
//UI层将用户输入数据传递给BLL层
string userName = txtUserName.Text.Trim();
string password = txtPassword.Text;
TomSmartERPBLL.LoginManager mgr = new TomSmartERPBLL.LoginManager();
TomSmartERPMODEL.UserInfo user = mgr.UserLogin(userName, password);
//将UI层返回业务层传递的数据给用户
MessageBox.Show("登陆用户:" + user.UserName);
this.DialogResult = DialogResult.OK;
this.Dispose();
this.Close();
//this.Form2();
}
private void txtUserName_TextChanged(object sender, EventArgs e)
{
}
}
}
internal static class Program
{
///
/// 应用程序的主入口点。
///
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new LoginWindow());
LoginWindow Form1 = new LoginWindow();
// Form1.ShowDialog();
if (Form1.ShowDialog() == DialogResult.OK)
{
//运行form2窗体
//Form2 form2 = new Form2();
Application.Run(new Form2());
}
}
}
}
0 Answer
According to your description, the problem of not jumping to the page, according to the code logic you provided, is the login window form1 did not pop out, or clicked the button in form1 can not open form2. No error is no response.
Returns the value of a row in the database. The login has been implemented, but the click Confirm Form1 does not jump.
这家伙很懒,什么都没留下...