private void menuMain_ConnDatabase_Click(object sender, EventArgs e) { LoginForm loginForm = new LoginForm(); loginForm.StartPosition = FormStartPosition.CenterParent; loginForm.ShowDialog(); if (loginForm.DialogResult != DialogResult.OK) { return; } if (GlobalVar.User.Equals("sa") && GlobalVar.Pwd.Equals("pinusdb")) { UpdatePwdForm updateForm = new UpdatePwdForm(); updateForm.StartPosition = FormStartPosition.CenterScreen; updateForm.ShowDialog(); if (updateForm.DialogResult != DialogResult.OK) { return; } } InitTreeNav(); UpdateStatusInfo(); InitBtnEnabled(); timerState.Enabled = true; }
private void MainForm_Load(object sender, EventArgs e) { if (!GlobalVar.IsConnected) { LoginForm loginForm = new LoginForm(); loginForm.StartPosition = FormStartPosition.CenterScreen; loginForm.ShowDialog(); if (loginForm.DialogResult != DialogResult.OK) { this.Close(); return; } } if (GlobalVar.User.Equals("sa") && GlobalVar.Pwd.Equals("pinusdb")) { UpdatePwdForm updateForm = new UpdatePwdForm(); updateForm.StartPosition = FormStartPosition.CenterScreen; updateForm.ShowDialog(); if (updateForm.DialogResult != DialogResult.OK) { this.Close(); return; } } InitTreeNav(); UpdateStatusInfo(); InitBtnEnabled(); ShowSysMessage(); timerState.Enabled = true; }