コード例 #1
0
 public ViewDonorDetails()
 {
     principleUser = Login.GetPrincipalUser();
     InitializeComponent();
     PopulateViewGUI();
     SharedFunctions.FullSizeWindow(this);
 }
コード例 #2
0
 public Account( )
 {
     SharedFunctions.FullSizeWindow(this);
     principleUser = Login.GetPrincipalUser();
     InitializeComponent();
     if (AlreadyGaveDonorData())
     {
         medical.Content = "View Donor Details";
     }
     populateGUI();
 }
コード例 #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();
     }
 }
コード例 #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;
            }
        }
コード例 #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);
        }
コード例 #6
0
ファイル: Login.xaml.cs プロジェクト: LesliePinto89/BloodBank
 public static void SetPrincipleUser(tableUser principle)
 {
     user = principle;
 }