public void GotoHome() { var User_Homepage = new User_Homepage(); NavigationService.Navigate(User_Homepage); }
//Sign In button click event private void UserSignInBtn_Click(object sender, RoutedEventArgs e) { SqlConnection sqlCon = new SqlConnection(connectionString); try { Connect obj = new Connect(); obj.conn.ConnectionString = obj.locate; obj.conn.Open(); SqlDataAdapter adapter = new SqlDataAdapter("SELECT COUNT (*) FROM tblSignUp WHERE StudentName = '" + tbID.Text + "' AND Password = '******'", obj.conn); DataTable dt = new DataTable(); adapter.Fill(dt); if (dt.Rows[0][0].ToString() == "1") { // Custom Message Box and Dim Effect var jim = new Dim(); jim.Show(); this.Effect = new BlurEffect(); var lsmb = new Custom_MessageBoxes.LoginSuccessfulMsgBox(); lsmb.ShowDialog(); this.Effect = null; jim.Close(); var User_Homepage = new User_Homepage(); NavigationService.Navigate(User_Homepage); } else { // Custom Message Box and Dim Effect 2 var him = new Dim(); him.Show(); this.Effect = new BlurEffect(); var rmdlgb = new ReturnMessageDialogueBox(); rmdlgb.ShowDialog(); this.Effect = null; him.Close(); } obj.conn.Close(); } catch (Exception ex) { using (EventLog eventlog = new EventLog("Application")) { eventlog.Source = "SQL Error: From My Application"; eventlog.WriteEntry(ex.StackTrace, EventLogEntryType.Error, 101, 1); } } finally { sqlCon.Close(); } }
private void BkBtnAdminSignUp_Click(object sender, RoutedEventArgs e) { var SignUp_Admin = new User_Homepage(); NavigationService.Navigate(SignUp_Admin); }