public ViewDonorDetails()
 {
     principleUser = Login.GetPrincipalUser();
     InitializeComponent();
     PopulateViewGUI();
     SharedFunctions.FullSizeWindow(this);
 }
Esempio n. 2
0
 public Account( )
 {
     SharedFunctions.FullSizeWindow(this);
     principleUser = Login.GetPrincipalUser();
     InitializeComponent();
     if (AlreadyGaveDonorData())
     {
         medical.Content = "View Donor Details";
     }
     populateGUI();
 }
Esempio n. 3
0
 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();
     }
 }
Esempio n. 4
0
        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;
            }
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 public static void SetPrincipleUser(tableUser principle)
 {
     user = principle;
 }