Esempio n. 1
0
        private void OnUsersCommand()
        {
            StaffHomeView view     = container.Resolve <StaffHomeView>();
            StaffMenuView menuView = container.Resolve <StaffMenuView>();

            ChangeMenu(menuView);
            ChangeContent(view);
        }
Esempio n. 2
0
        public ActionResult Index()
        {
            string userId = User.Identity.GetUserId();

            var homeView = new StaffHomeView()
            {
                staff            = new Instructor(),
                InformationDesks = new List <InformationDesk>(),
                semInfo          = new SemesterProgressSummary()
            };
            Instructor staffInfo = _staffRepo.GetStaffByUserId(int.Parse(userId));

            if (staffInfo.Person.ProfilePhotoName != null)
            {
                staffInfo.Person.ProfilePhotoUrl = Path.Combine(ApplicationConstants.StaffResourcesThumbnailUrl,
                                                                staffInfo.Person.ProfilePhotoName);
            }

            homeView.staff = staffInfo;

            //Need to limit to the number to be displayed (4)
            var ides = _coreRepo.GetAll <InformationDesk>().ToList();

            foreach (var id in ides)
            {
                if (id.ShortDescription == null)
                {
                    var sd = _generalHelper.ConvertHtmlToPlainText(id.Content);
                    id.ShortDescription = sd.Length > summaryLength?sd.Substring(0, summaryLength) + "... " : sd;
                }
                else
                {
                    id.ShortDescription = id.ShortDescription.Length > summaryLength?id.ShortDescription.Substring(0, summaryLength) + "... " :
                                          id.ShortDescription + "...";
                }

                homeView.InformationDesks.Add(id);
            }

            // Get Semester Progress

            DateTime today           = DateTime.Now;
            Cohort   currentSemester = new Cohort();

            currentSemester = _semesterRepository.GetCurrentSemester(today);

            homeView.semInfo = currentSemester == null ? null : new SemesterProgressSummary();

            return(View(homeView));
        }
Esempio n. 3
0
        private void OnUserHomeCommand()
        {
            StaffHomeView view = container.Resolve <StaffHomeView>();

            SwitchView(view);
        }