Example #1
0
        public async Task <IActionResult> Index(string username, ProfileTab tab, int?page)
        {
            if (!await this.profileService.IsUserExist(username))
            {
                return(this.NotFound());
            }

            var currentUser = await this.userManager.GetUserAsync(this.User);

            var user = await this.profileService.ExtractUserInfo(username, currentUser);

            var adminRole = await this.roleManager.FindByNameAsync(Roles.Administrator.ToString());

            bool hasAdmin = await this.profileService.HasAdmin(adminRole);

            var pageNumber = page ?? 1;

            var model = new ProfileViewModel
            {
                ApplicationUser = user,
                HasAdmin        = hasAdmin,
                RatingScore     = this.profileService.ExtractUserRatingScore(username),
                LatestScore     = await this.profileService.GetLatestScore(currentUser, username),
                ActiveTab       = tab,
                Page            = pageNumber,
            };

            return(this.View(model));
        }
Example #2
0
        /*
         * public static SettingTab Instance
         * {
         *  get
         *  {
         *      if (_instance == null)
         *          _instance = new SettingTab();
         *      return _instance;
         *  }
         * }
         */

        public SettingTab(Users user, ProfileTab tab)
        {
            InitializeComponent();
            _user         = user;
            _currentPanel = panel1;
            _tab          = tab;
        }
Example #3
0
        public async Task <IActionResult> Profile(string username, ProfileTab tab, int?page)
        {
            if (!await this.usersService.IsUserExists(username))
            {
                return(this.NotFound());
            }

            var currentUser = await this.userManager.GetUserAsync(this.User);

            ApplicationUserViewModel user = await this.usersService.ExtractUserInfo(username, currentUser);

            var userThatRate = await this.userManager.GetUserAsync(this.User);

            var pageNumber = page ?? 1;

            var model = new UserProfileViewModel
            {
                ApplicationUser = user,
                CreatedPosts    = await this.usersService.TakeCreatedTripPostsCountByUsername(username),
                RatingScore     = this.usersService.ExtractUserRatingScore(username),
                LatestScore     = await this.usersService.GetLatestScore(userThatRate, username),
            };

            model.ActiveTab = tab;
            model.Page      = pageNumber;

            return(this.View(model));
        }
Example #4
0
 public void RefreshProfileList()
 {
     if (!IsValid)
         return;
     if (ProfileTab.InvokeRequired)
         ProfileTab.BeginInvoke(new guiInvokeCB(RefreshProfileListCallback));
     else
         RefreshProfileListCallback();
 }
Example #5
0
        private void Ranking_Click(object sender, MouseButtonEventArgs e)
        {
            RankingTab.Foreground = Brushes.White;
            ProfileTab.SetValue(ForegroundProperty, DependencyProperty.UnsetValue);
            MatchesTab.SetValue(ForegroundProperty, DependencyProperty.UnsetValue);

            RankingPane.Visibility = Visibility.Visible;
            MatchesPane.Visibility = ProfilePane.Visibility = Visibility.Collapsed;
        }
Example #6
0
 public void RefreshSettingsPropertyGrid()
 {
     if (!IsValid)
     {
         return;
     }
     if (ProfileTab.InvokeRequired)
     {
         ProfileTab.BeginInvoke(new GuiInvokeCB(RefreshSettingsPropertyGridCallback));
     }
     else
     {
         RefreshSettingsPropertyGridCallback();
     }
 }
Example #7
0
 public void RemoveProfileSettingsTab()
 {
     if (!IsValid)
     {
         return;
     }
     if (ProfileTab.InvokeRequired)
     {
         ProfileTab.BeginInvoke(new GuiInvokeCB(RemoveProfileSettingsTabCallback));
     }
     else
     {
         RemoveProfileSettingsTabCallback();
     }
 }
Example #8
0
 private void RefreshProfileList()
 {
     if (!IsValid)
     {
         return;
     }
     if (ProfileTab.InvokeRequired)
     {
         ProfileTab.BeginInvoke(new GuiInvokeCB(RefreshProfileListCallback));
     }
     else
     {
         RefreshProfileListCallback();
     }
 }
        /// <summary>
        /// The intilizaing of menu tabs creates the correct pages depending on if a user is a instructor or student.
        /// </summary>
        private void InitializeMenuTabs()
        {
            if (Session.LoggedInUser.Sysmin)
            {
                overviewTab = new InstructorOverviewTab();
                profileTab  = new InstructorProfileTab(Session.LoggedInUser);
            }
            else
            {
                overviewTab = new StudentOverviewTab();
                profileTab  = new StudentProfileTab(Session.LoggedInUser);
            }

            documentViewer = new DocumentViewer();
            userSearchTab  = new UserSearchTab();
            calendarTab    = new CalendarTabG(overviewTab, this);
            driveLogTab    = new DriveLogTab(Session.LoggedInUser);
            _lessonCreator = new TemplateCreator();


            overviewTab.Hide();
            profileTab.Hide();
            driveLogTab.Hide();
            documentViewer.Hide();
            userSearchTab.Hide();
            calendarTab.Hide();
            _lessonCreator.Hide();

            MoveButtonSpaces(OverviewButton, 8);
            MoveButtonSpaces(ProfileButton, 8);
            MoveButtonSpaces(bookingButton, 8);
            MoveButtonSpaces(settingsButton, 8);
            MoveButtonSpaces(userSearchButton, 8);
            OverviewButton.Controls.Add(pictureHomeTab);
            ProfileButton.Controls.Add(pictureProfileTab);
            bookingButton.Controls.Add(pictureBookingTab);
            settingsButton.Controls.Add(pictureSettingsTab);
            userSearchButton.Controls.Add(pictureSearchTab);
        }
        public async Task <IActionResult> Index(string username, ProfileTab tab, int?page)
        {
            if (!await this.profileService.IsUserExist(username))
            {
                return(this.NotFound());
            }

            var currentUser = await this.userManager.GetUserAsync(this.User);

            ApplicationUserViewModel user = await this.profileService.ExtractUserInfo(username, currentUser);

            var adminRole = await this.roleManager.FindByNameAsync(Roles.Administrator.ToString());

            bool hasAdmin = await this.profileService.HasAdmin(adminRole);

            var pageNumber = page ?? 1;

            var model = new ProfileViewModel
            {
                ApplicationUser = user,
                HasAdmin        = hasAdmin,
                CreatedPosts    = await this.profileService.TakeCreatedPostsCountByUsername(username),
                LikedPosts      = await this.profileService.TakeLikedPostsCountByUsername(username),
                CommentsCount   = await this.profileService.TakeCommentsCountByUsername(username),
                RatingScore     = this.profileService.ExtractUserRatingScore(username),
                LatestScore     = await this.profileService.GetLatestScore(currentUser, username),
            };

            // if (tab == 0)
            // {
            //    tab = ProfileTab.Activities;
            // }
            model.ActiveTab = tab;
            model.Page      = pageNumber;

            return(this.View(model));
        }
 //Click on Profile tab
 public void ClickOnProfileTab()
 {
     driver.WaitForElementIsVisible(ProfileTab);
     ProfileTab.Click();
 }
        public void Profile_EditAvailability()
        {
            ProfileTab profile = new ProfileTab(driver);

            profile.EditAvailability();
        }
        public void GivenIHaveLoggedIntoTheWebsite()
        {
            ProfileTab profile = new ProfileTab(driver);

            profile.VerifyCopies(driver);
        }
Example #14
0
        //        public static ProjectTab Instance
        //        {
        //            get
        //            {
        //                if (_instance == null)
        //                    _instance = new ProjectTab(TODO);
        //                return _instance;
        //            }
        //        }

        public ProjectTab(ProfileTab tab)
        {
            _tab = tab;
            InitializeComponent();
            _currentPanel = panel1;
        }
        public void GivenIAmAbleToCheckEditAndRemoveMyAvailabilityDetailsUnderProfileTab()
        {
            ProfileTab profile = new ProfileTab(driver);

            profile.EditAvailability();
        }
Example #16
0
 internal void NavigateToProfileTab()
 {
     Extension.WaitForElementDisplayed(Driver, By.LinkText("Profile"), 2);
     ProfileTab.Click();
 }
        public void GivenIAmAbleToCheckEditAndRemoveMyHoursDetailsUnderProfileTab()
        {
            ProfileTab profile = new ProfileTab(driver);

            profile.EditHours();
        }
        public void GivenIAmAbleToCheckEditAndRemoveMyEarnTargetDetailsUnderProfileTab()
        {
            ProfileTab profile = new ProfileTab(driver);

            profile.EditEarnTarget();
        }
        public void Profile_EditEarnTarget()
        {
            ProfileTab profile = new ProfileTab(driver);

            profile.EditEarnTarget();
        }
        public void Profile_EditHours()
        {
            ProfileTab profile = new ProfileTab(driver);

            profile.EditHours();
        }
        public void Profile_CopyVerification()
        {
            ProfileTab profile = new ProfileTab(driver);

            profile.VerifyCopies(driver);
        }