Exemple #1
0
        //
        // GET: /Admin/
        public ActionResult Index()
        {
            var view = new IndexAdminViewModel();

            view.Posts = Context.Posts.ToList();

            return(View(view));
        }
        public void IndexAdminViewModel_Constructor_Should_Initialize_Object()
        {
            //Arrange & Act
            IndexAdminViewModel model = new IndexAdminViewModel();

            //Assert
            Assert.IsInstanceOf <IndexAdminViewModel>(model);
        }
        // GET: Admin
        public async Task <ActionResult> Index()
        {
            var indexVm = new IndexAdminViewModel()
            {
                ProfileModels = new List <ProfileModel>(await _profileService.GetAllProfilesAsync())
            };

            return(View(indexVm));
        }
        public ActionResult Index()
        {
            var viewModel = new IndexAdminViewModel();

            viewModel.cars = _context.carModels
                             .OrderByDescending(p => p.ProductionYear);
            viewModel.services = _context.carServices.ToList();
            viewModel.users    = _context.Users.ToList();
            return(View(viewModel));
        }
        public ActionResult EventDetailsSummary(int id)
        {
            var model = new IndexAdminViewModel()
            {
                IndexEvents  = _repository.Events,
                IndexTickets = _ticketRepository.Tickets,
                Event        = _repository.GetEvent(id)
            };

            return(PartialView("Shared/EventDetailsSummary", model));
        }
        // GET: Admin
        public ViewResult Index()
        {
            IndexAdminViewModel model = new IndexAdminViewModel()
            {
                IndexEvents  = _repository.Events,
                IndexArtists = _artistRepository.Artists,
                IndexTickets = _ticketRepository.Tickets
            };

            return(View(model));
        }
        public void IndexAdminViewModel_Should_Set_UsersCount_Object(int count)
        {
            //Arrange
            IndexAdminViewModel model = new IndexAdminViewModel();

            //Act
            model.UsersCount = count;

            //Assert
            Assert.AreEqual(count, model.UsersCount);
        }
Exemple #8
0
        public IActionResult Index()
        {
            List <Livre> livres = context.Livre.ToList();
            String       titre  = "Accès administration";

            IndexAdminViewModel model = new IndexAdminViewModel();

            model.Livres = livres;
            model.Titre  = titre;

            return(View(model));
        }
Exemple #9
0
        public ActionResult Index()
        {
            IndexAdminViewModel model = new IndexAdminViewModel()
            {
                OptionsCount   = this.Service.GetAllOptionsCount(),
                QuestionsCount = this.Service.GetAllQuestionsCount(),
                UsersCount     = this.Service.GetAllUsersCount(),
                VotesCount     = this.Service.GetAllVotesCount()
            };

            return(View(model));
        }
Exemple #10
0
        public IndexAdminViewModel PreparedPage()
        {
            var indexAdminViewModel = new IndexAdminViewModel()
            {
                CountAdmins   = this.CountUsersByType("admin"),
                CountAllUsers = this.CountAllUsers(),
                CountLibrarys = this.CountUsersByType("library"),
                CountUsers    = this.CountUsersByType("user"),
            };

            return(indexAdminViewModel);
        }
Exemple #11
0
        public async Task <IActionResult> Index(string Message = "", bool?IsDBResetConfirmed = false)
        {
            var adminIndexViewModel = new IndexAdminViewModel()
            {
                Users              = await _context.Users.ToListAsync(),
                Roles              = await _context.Roles.ToListAsync(),
                UserRoles          = await _context.UserRoles.ToListAsync(),
                Message            = Message,
                IsDBResetConfirmed = IsDBResetConfirmed,
            };

            return(View(adminIndexViewModel));
        }
Exemple #12
0
        // GET: Admin
        public ActionResult Index()
        {
            var allProjects  = _unitOfWork.ProjectRepositry.GetAllProjectsWithClientAndUsersAndTasksWithFiles().ToList();
            var allEmployees = _unitOfWork.UserRepositry.GetAllUsersWithProjectsAndTasksAndRolesAndFinanicalWithFilesWithPayments().ToList();
            var allTasks     = _unitOfWork.TTaskRepositry.GetAllTasksWithUserAndUserAndProject().ToList();

            var vm = new IndexAdminViewModel()
            {
                Projects = allProjects,
                Users    = allEmployees,
                Tasks    = allTasks
            };

            return(View(vm));
        }
        // GET: Admin
        public ActionResult Index()
        {
            if (Session["Admin"] == null)
            {
                return(RedirectToAction("Login"));
            }
            IndexAdminViewModel model = new IndexAdminViewModel();

            model.Pending = new Dictionary <string, List <BuildUnsignedVCResponse> >();
            if (AdminCountry.ContainsKey(Admin))
            {
                foreach (var cred in UnsignedCredentials)
                {
                    foreach (var valueCred in cred.Value)
                    {
                        if (valueCred.unsignedCredential.credentialSubject.data.Country == AdminCountry[Admin])
                        {
                            if (model.Pending.ContainsKey(cred.Key))
                            {
                                model.Pending[cred.Key].Add(valueCred);
                            }
                            else
                            {
                                model.Pending.Add(cred.Key, new List <BuildUnsignedVCResponse>()
                                {
                                    valueCred
                                });
                            }
                        }
                    }
                }
            }
            else
            {
                model.Pending = UnsignedCredentials;
            }
            return(View(model));
        }
Exemple #14
0
        // GET: Admin
        public async Task <ActionResult> Index(string sortOrder, string searchString)
        {
            ViewBag.NameSortParm      = String.IsNullOrEmpty(sortOrder) ? "name_desc" : "";
            ViewBag.FirstNameSortParm = String.IsNullOrEmpty(sortOrder) ? "firstname_desc" : "";
            ViewBag.EmailSortParm     = String.IsNullOrEmpty(sortOrder) ? "email_desc" : "";
            var indexVm = new IndexAdminViewModel()
            {
                ProfileModels = new List <ProfileModel>(await _profileService.GetAllProfilesAsync())
            };

            if (!String.IsNullOrEmpty(searchString))
            {
                indexVm.ProfileModels = indexVm.ProfileModels.Where(s => s.LastName.ToLower().Contains(searchString.ToLower()) ||
                                                                    s.FirstName.ToLower().Contains(searchString.ToLower()) ||
                                                                    s.Email.ToLower().Contains(searchString.ToLower())).ToList();
            }
            switch (sortOrder)
            {
            case "name_desc":
                indexVm.ProfileModels = indexVm.ProfileModels.OrderByDescending(s => s.LastName).ToList();
                break;

            case "firstname_desc":
                indexVm.ProfileModels = indexVm.ProfileModels.OrderByDescending(s => s.FirstName).ToList();
                break;

            case "email_desc":
                indexVm.ProfileModels = indexVm.ProfileModels.OrderByDescending(s => s.Email).ToList();
                break;

            default:
                indexVm.ProfileModels = indexVm.ProfileModels.OrderBy(s => s.FirstName).ToList();
                break;
            }
            return(View(indexVm));
        }