//Get list of evaluators with an 'Pending' status
        //Returns userID, first name, last name, email and its evaluator status
        public EvaluatorPagingQuery getPendingList(int index)
        {
            EvaluatorPagingQuery e = new EvaluatorPagingQuery();

            try
            {
                using (conferenceadminContext context = new conferenceadminContext())
                {
                    int pageSize = 10;
                    //Get list of pending applications
                    var query = context.users.Where(evaluator => evaluator.evaluatorStatus == "Pending").Select(evaluator => new EvaluatorQuery
                    {
                        userID = (long)evaluator.userID,
                        firstName = evaluator.firstName,
                        lastName = evaluator.lastName,
                        email = evaluator.membership.email,
                        acceptanceStatus = evaluator.evaluatorStatus

                    }).OrderBy(x => x.email);

                    e.rowCount = query.Count();
                    //Paging -> Filter results to obtain 10 results per page (index references to page number)
                    if (e.rowCount > 0)
                    {
                        e.maxIndex = (int)Math.Ceiling(e.rowCount / (double)pageSize);
                        var pending = query.Skip(pageSize * index).Take(pageSize).ToList(); //Skip past rows and take new elements
                        e.results = pending;
                    }

                    return e;
                }
            }
            catch (Exception ex)
            {
                Console.Write("EvaluatorManager.getPendingList error " + ex);
                return null;
            }
        }
        //Search evaluators that contain the specified criteria
        //Returns userID, first name, last name, email and its evaluator status
        public EvaluatorPagingQuery searchEvaluators(int index, String criteria)
        {
            EvaluatorPagingQuery e = new EvaluatorPagingQuery();

            try
            {

                using (conferenceadminContext context = new conferenceadminContext())
                {
                    int pageSize = 10;
                    //Get all evaluators applications
                    var query = context.users.Where(evaluator => ((evaluator.firstName.ToLower() + " " + evaluator.lastName.ToLower()).Contains(criteria.ToLower()) || evaluator.membership.email.ToLower().Contains(criteria.ToLower())) && (evaluator.evaluatorStatus == "Accepted" || evaluator.evaluatorStatus == "Rejected" || evaluator.evaluatorStatus == "Pending")).Select(evaluator => new EvaluatorQuery
                    {
                        userID = (long)evaluator.userID,
                        firstName = evaluator.firstName,
                        lastName = evaluator.lastName,
                        email = evaluator.membership.email,
                        acceptanceStatus = evaluator.evaluatorStatus

                    }).OrderBy(x => x.email);

                    e.rowCount = query.Count();
                    //Paging -> Filter results to 10 records per index (page)
                    if (e.rowCount > 0)
                    {
                        e.maxIndex = (int)Math.Ceiling(e.rowCount / (double)pageSize);
                        var evaluators = query.Skip(pageSize * index).Take(pageSize).ToList(); //Skip past rows and take new elements
                        e.results = evaluators;
                    }

                    return e;
                }
            }
            catch (Exception ex)
            {
                Console.Write("EvaluatorManager.searchEvaluators error " + ex);
                return null;
            }
        }
        //Get list of evaluators with an 'Accepted' or 'Rejected' status
        //Returns userID, first name, last name, email and its evaluator status
        public EvaluatorPagingQuery getEvaluatorList(int index, int id)
        {
            EvaluatorPagingQuery e = new EvaluatorPagingQuery();

            try
            {

                using (conferenceadminContext context = new conferenceadminContext())
                {
                    int pageSize = 10;
                    //Get list of evaluators
                    var query = context.users.Where(evaluator => (evaluator.evaluatorStatus == "Accepted" || evaluator.evaluatorStatus == "Rejected") && evaluator.userID != id && context.claims.Where(x => x.userID == evaluator.userID && x.deleted != true && (x.privilege.privilegesID == 1 || x.privilege.privilegesID == 3 || x.privilege.privilegesID == 5)).Select(x => x.userID).Count() == 0).Select(evaluator => new EvaluatorQuery
                    {
                        userID = (long)evaluator.userID,
                        firstName = evaluator.firstName,
                        lastName = evaluator.lastName,
                        email = evaluator.membership.email,
                        acceptanceStatus = evaluator.evaluatorStatus

                    }).OrderBy(x => x.email);

                    e.rowCount = query.Count();
                    //Paging -> Filter results to obtain 10 results per page (index references to page number)
                    if (e.rowCount > 0)
                    {
                        e.maxIndex = (int)Math.Ceiling(e.rowCount / (double)pageSize);
                        var evaluators = query.Skip(pageSize * index).Take(pageSize).ToList(); //Skip past rows and take new elements
                        e.results = evaluators;
                    }

                    return e;
                }
            }
            catch (Exception ex)
            {
                Console.Write("EvaluatorManager.getEvaluatorList error " + ex);
                return null;
            }
        }