Esempio n. 1
0
        public ActionResult EditProfile(int profileId, string profileKey)
        {
            var profileViewModel = _reader.GetProfileDetails(profileKey).ToProfileViewModel();

            if (HttpContext.Request.UrlReferrer != null)
            {
                profileViewModel.ReturnUrl = HttpContext.Request.UrlReferrer.ToString();
            }

            profileViewModel.SelectedPdfAreaTypes = _reader.GetAreaTypesWhichContainsPdf(profileId).ToProfileAreaTypeList();

            profileViewModel.ProfileUsers = _reader.GetProfileUsers(profileId).ToProfileUserList();

            // Get all dropdowns in ViewBag

            ViewBag.AllUsers = _userRepository.GetAllFpmUsers().ToProfileUserList();

            ViewBag.DefaultAreaTypeId = new SelectList(_reader.GetSupportedAreaTypes(), "Id", "ShortName");

            ViewBag.SpineChartMinMaxLabelId = new SelectList(_reader.GetSpineChartMinMaxLabelOptions(), "Id", "Description");

            ViewBag.ContactUserId = GetFpmUserList();

            ViewBag.KeyColourId = new SelectList(_lookUpsRepository.GetKeyColours(), "Id", "Description");

            ViewBag.SkinId = new SelectList(_lookUpsRepository.GetSkins(), "Id", "Name");

            ViewBag.DefaultFingertipsTabId = new SelectList(GetListOfFingertipsTabs(), "Value", "Text");

            ViewBag.AvailableAreaTypes = _reader.GetAreaTypes(profileId).ToProfileAreaTypeList();

            return(View("EditProfile", profileViewModel));
        }