static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ApplicationExit += new EventHandler(evenExitApp); clsDBCore.getInstance(clsDBUltity.ConnectionString); Common.CreateFolderHidden(Common.PathDataErrors); deleteMeasureRawOld(); using (var db = new clsDBUltity()) { db.LoginCheck("admin", "admin"); } Application.Run(new GraphForm()); //using (var frmLogin = new LoginForm()) //{ // clsDBCore.getInstance(clsDBUltity.ConnectionString); // Common.CreateFolderHidden(Common.PathDataErrors); // deleteMeasureRawOld(); // frmLogin.ShowDialog(); // if (frmLogin.LoginSusses) // { // Application.Run(new GraphForm()); // } else // { // Application.Exit(); // } //} }
private void btLogin_Click(object sender, EventArgs e) { if (!ValidateLogin()) { return; } using (var objDb = new clsDBUltity()) { if (objDb.LoginCheck(txtUser.Text, txtPass.Text)) { ExitForm(true); } else { Common.ShowMsg(MessageBoxIcon.Error, MSG_ERR_LOGIN); } } }