// GET: Administration
        public ActionResult Index(string section = "users")
        {
            ViewBag.CurrentPage = "Admin";

            var viewmodel = new AdministrationViewModel {
                Users = new List <SiteUserModel>()
            };

            viewmodel.SectionName = section.ToLower();

            if (section == "users")
            {
                var usermanager = new AppUserManager(_userStore);

                foreach (var user in _userStore.Users.ToList())
                {
                    SiteUserModel siteuser = AutoMapper.Mapper.Map <SiteUserModel>(user);
                    siteuser.UserRoles = usermanager.GetRoles(user.Id).ToArray();
                    viewmodel.Users.Add(siteuser);
                }
            }
            else
            {
                viewmodel.SiteSettings = _acidRepos.GetSettings();
            }


            return(View(viewmodel));
        }
예제 #2
0
        public async Task <IAcidCodeCompiler> GetCodeCompilerFromText(string codetext)
        {
            AcidCodeCompiler acidCodeCompiler = new AcidCodeCompiler(codetext, _codeRepository.GetSettings());

            await acidCodeCompiler.ParseCode();

            return(acidCodeCompiler);
        }