Пример #1
0
        public List <Earned_CE_Table> earnedList(int caseID, int userID)
        {
            List <Earned_CE_Table> earned = new List <Earned_CE_Table>();

            using (var db = new ModelDbContext())
            {
                earned = db.EarnedCE
                         .Where(x => x.Case_Id == caseID &&
                                x.User_Id == userID)
                         .ToList();
            }
            return(earned);
        }
Пример #2
0
        public List <Case_Table> activityData(int caseID)
        {
            List <Case_Table> activity = new List <Case_Table>();

            using (var db = new ModelDbContext())
            {
                activity = db.Cases
                           .Where(x => x.Case_Id == caseID)
                           .ToList();
            }

            return(activity);
        }
Пример #3
0
        public List <int?> accountPrePostHistory(int?userID, int prePostNumber)
        {
            List <int?> history = new List <int?>();

            using (var db = new ModelDbContext())
            {
                history = db.DataCollectionTable.Where(x => x.User_Id == userID &&
                                                       x.Pre_Test == prePostNumber
                                                       ).Select(x => x.Case_Id).Distinct().ToList();
            }
            //history = history.Where(x => x.Value == 28).ToList();

            return(history);
        }
Пример #4
0
        public bool IsEmail(string email)
        {
            bool checkForExistingEmail = false;

            using (var db = new ModelDbContext())
            {
                checkForExistingEmail = db.Users
                                        .Where(x => x.Email == email)
                                        .Select(x => x.User_Id)
                                        .Any();
            }

            return(checkForExistingEmail);
        }
Пример #5
0
        public bool checkIfUniqueIDExists(int uID)
        {
            bool ifExists = false;

            using (var db = new ModelDbContext())
            {
                ifExists = db.Users
                           .Where(X => X.UId == uID)
                           .Select(x => x.UId)
                           .Any();
            }

            return(ifExists);
        }
Пример #6
0
        public List <int?> accountEvaluationHistory(int?userID, int caseID)
        {
            List <int?> history = new List <int?>();

            using (var db = new ModelDbContext())
            {
                history = db.EvalCollector
                          .Where(x => x.EvalId == caseID &&
                                 x.UserId == userID)
                          .Select(x => x.EvalId)
                          .Distinct()
                          .ToList();
            }
            return(history);
        }
Пример #7
0
        public int countPostAttempts(int caseID, int userID)
        {
            int attemptCount = 0;

            using (var db = new ModelDbContext())
            {
                attemptCount = db.DataCollectionTable
                               .Where(x => x.User_Id == userID &&
                                      x.Case_Id == caseID &&
                                      x.Pre_Test == 0)
                               .Select(x => x.Attempt)
                               .Distinct()
                               .Count();
            }

            return(attemptCount);
        }