public ViewDonorDetails() { principleUser = Login.GetPrincipalUser(); InitializeComponent(); PopulateViewGUI(); SharedFunctions.FullSizeWindow(this); }
public Account( ) { SharedFunctions.FullSizeWindow(this); principleUser = Login.GetPrincipalUser(); InitializeComponent(); if (AlreadyGaveDonorData()) { medical.Content = "View Donor Details"; } populateGUI(); }
private void navLog_Click(object sender, RoutedEventArgs e) { //This would appear as sign out logged = Login.GetPrincipalUser(); if (logged != null) { LogOut(); SharedFunctions.GoHomeOnly(this); } else //this appears as signin { Login log = new Login(); this.Hide(); log.Show(); } }
public MainWindow() { SharedFunctions.FullSizeWindow(this); logged = Login.GetPrincipalUser(); InitializeComponent(); if (logged != null) { navLog.Content = "Sign out"; label.Content = $"Welcome {logged.Username}"; Button personalDetails = new Button { Content = "My Account", Margin = new Thickness(0, 0, 0, 10), Background = new SolidColorBrush(Color.FromRgb(122, 180, 230)), Foreground = Brushes.White }; nav.Children.Add(personalDetails); personalDetails.Click += details_Click; } }
public void AddValidateDetails() { var databaseContext = new UserRegistrationDBEntities(); var user = new tableUser() { FirstName = first.Text.Trim(), LastName = last.Text.Trim(), Contact = number.Text.Trim(), Address = location.Text.Trim(), Username = alias.Text.Trim(), Password = pass.Text.Trim(), Email = mail.Text.Trim() }; databaseContext.tableUsers.Add(user); databaseContext.SaveChanges(); MessageBox.Show("Registered successfully"); registered = true; Login.SetPrincipleUser(user); SharedFunctions.Clear(this); SharedFunctions.GoHomeOnly(this); }
public static void SetPrincipleUser(tableUser principle) { user = principle; }