//*********************** COMPONENT EVENTS******************************************* private void btnLogin_Click(object sender, EventArgs e) { if (fieldsChecked()) { //login if (getStringValue("adminUser").Equals(txtUsername.Text) && getStringValue("adminPass").Equals(txtPassword.Text)) { //sql settings mode Form settingsForm = new SQLSettingsForm(); settingsForm.ShowDialog(); } else if (connectedToServer) { //normal login if (isUserAuthenticated()) { if (TempHolder.systemValuesLoaded) { MainForm mf = new MainForm(); mf.Show(); } else { LoadingForm lf = new LoadingForm(); lf.Show(); } txtUsername.Clear(); txtPassword.Clear(); lblConnectionMsg.Visible = false; this.Hide(); } } } }
//***********************FORM EVENTS*********************************** private void Form1_Load(object sender, EventArgs e) { TempHolder.loginform = this; sqlSettingsForm = new SQLSettingsForm(); txtUsername.Focus(); testConnection(); }
private void MenuSQLSettings_Click(object sender, EventArgs e) { if (Permissions.authorizedToUseFunction(Permissions.SQL_SETTINGS_PERMISSION)) { SQLSettingsForm sf = new SQLSettingsForm(); sf.ShowDialog(); } }
private void bgw_connectiontester_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (!connectedToServer) { showBottomMessage("Not Connected to Database"); if (TempHolder.sqlSettingsForm == null) { sqlSettingsForm = new SQLSettingsForm(); sqlSettingsForm.ShowDialog(); sqlSettingsForm.BringToFront(); } } else { lblConnectionMsg.Visible = false; } }