Exemple #1
0
        public Dash(Shared.Profile profile)
        {
            InitializeComponent();
            this.profilePage       = new Pages.Profile(profile);
            this.notificationsPage = new Pages.Notifications();
            (Application.Current.MainWindow as MainWindow).Notifications.RegisterNotificationsPage(notificationsPage);

            ProfileFrame.Navigate(this.profilePage);
        }
Exemple #2
0
        public Profile(Shared.Profile profile)
        {
            InitializeComponent();

            productions = new Assets.Productions(profile.ScientificProductions);

            ProfileCardFrame.Navigate(new Assets.ProfileCard(profile));
            ProductionsFrame.Navigate(productions);
        }
        public ProfileCard(Shared.Profile p)
        {
            InitializeComponent();
            this.ID.Content       = p.Id;
            this.Username.Content = p.Username;
            this.Fullname.Content = p.Fullname;
            this.Email.Content    = p.Email;

            this.TeamId.Content = p.TeamId;
            foreach (string role in p.Roles)
            {
                this.Roles.Content += ", " + role;
            }
            this.Field.Content = p.Field;
        }
Exemple #4
0
        public void loginButton_Click(object sender, RoutedEventArgs e)
        {
            string username = Username.Text;
            string password = Password.Password;

            var mainWindow = (Application.Current.MainWindow as MainWindow);

            try
            {
                mainWindow.PublishingObject = mainWindow.AuthenticationObj.Login(username, password, mainWindow.Notifications);
                if (mainWindow.PublishingObject != null)
                {
                    Shared.Profile profile = mainWindow.PublishingObject.RetrieveProfile();

                    Console.WriteLine("{0} \t | {1} \t | {2} \t |\t {3}|\t {4}|\t {5}", profile.Id, profile.Fullname,
                                      profile.Username, profile.Email, profile.Field, profile.TeamId);

                    mainWindow.MainFrame.Navigate(new Pages.Dash(profile));

                    mainWindow.User.Profile = profile;
                }
                else
                {
                    Console.WriteLine("Wrong credentials");

                    Pages.LoginPage p = mainWindow.MainFrame.Content as Pages.LoginPage;
                    p.SetPasswordBox("");
                    p.SetErrors("Wrong credentials, try oussama oussama");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);

                Pages.LoginPage p = mainWindow.MainFrame.Content as Pages.LoginPage;
                p.SetErrors(ex.Message);
            }
        }