コード例 #1
0
        public ActionResult UserProfile(string Id)
        {
            if (Id != null)
            {
                OrganizationBL organizationBL = new OrganizationBL();
                var            organization   = organizationBL.OrganizationList();

                var collection = organization.Select(s => new
                {
                    Name = s.Name,
                    ID   = s.OrganizationID
                }).ToList();

                UserProfileBL userProfile = new UserProfileBL();
                var           countries   = userProfile.GetCountries().Select(s => new
                {
                    Text  = s.CoutnryName,
                    Value = s.CountryID
                }).ToList();

                ViewBag.UserId          = Id;
                ViewBag.Organizations   = new SelectList(collection, "ID", "Name");
                ViewBag.CountryDropDown = new SelectList(countries, "Value", "Text");
                return(View());
            }
            else
            {
                return(View("Index"));
            }
        }
コード例 #2
0
        public ActionResult EditUserProfile(string userID, int?orgID)
        {
            if (userID != null && orgID != null)
            {
                UserProfileBL profileBL = new UserProfileBL();

                var countries = profileBL.GetCountries().Select(s => new
                {
                    Text  = s.CoutnryName,
                    Value = s.CountryID
                }).ToList();
                ViewBag.CountryDropDown = new SelectList(countries, "Value", "Text");

                EditUserProfileViewModel viewModel = profileBL.EditUserProfile(userID, orgID);
                return(View(viewModel));
            }
            else
            {
                return(View("Index"));
            }
        }