コード例 #1
0
        private IEnumerable <ScoreCollection> SelectSysScores(ProfileParamsDto params_)
        {
            using (var _sqlConnection = new SqlConnection(_config.GetConnectionString("mssql")))
            {
                string q = (params_.TimeScale == ScaleType.YEAR)
                    ? TypeSessionCommand.SELECT_SCORES_LASTYEAR_ALL
                    : TypeSessionCommand.SELECT_SCORES_BYMONTH_ALL;

                return(_sqlConnection.Query <ScoreCollection>(
                           q,
                           new { endDate = params_.EndDate }));
            }
        }
コード例 #2
0
        public SysProfileDto SelectSysProfile(ProfileParamsDto params_)
        {
            SysProfileDto sysProfile = new SysProfileDto();

            using (var _sqlConnection = new SqlConnection(_config.GetConnectionString("mssql")))
            {
                sysProfile.Metrics = _sqlConnection.Query <UserMetrics>(
                    TypeSessionCommand.SELECT_ALL_METRICS).FirstOrDefault();

                sysProfile.Scores = SelectSysScores(params_);
            }

            return(sysProfile);
        }
コード例 #3
0
        // POST: api/Profile/5
        public ActionResult GetProfile(ProfileParamsDto params_)
        {
            UserProfileDto profileDto = _service.GetUserProfile(params_);

            //SysProfileDto sysProfileDto = _service.GetSysProfile(params_);

            //dynamic response = new {
            //    userData = profileDto,
            //    overallData = sysProfileDto
            //};

            if (profileDto == null)
            {
                BadRequest();
            }
            return(Ok(profileDto));
        }
コード例 #4
0
        public UserProfileDto SelectProfile(ProfileParamsDto params_)
        {
            UserProfileDto profile = new UserProfileDto();

            using (var _sqlConnection = new SqlConnection(_config.GetConnectionString("mssql")))
            {
                profile.Percentiles = _sqlConnection.Query <PercentileCollection>(
                    TypeSessionCommand.SELECT_USER_PERCENTILES,
                    new { userId = params_.UserId }).FirstOrDefault();

                profile.TopMisspellings = _sqlConnection.Query <string>(
                    MisspellingCommand.SELECT_TOP10,
                    new { userId = params_.UserId });

                profile.Records = _sqlConnection.Query <RecordCollection>(
                    TypeSessionCommand.SELECT_USER_RECORDS,
                    new { userId = params_.UserId }).FirstOrDefault();

                profile.Scores = SelectScores(params_);

                return(profile);
            }
        }
コード例 #5
0
        public ActionResult GetSysProfile(ProfileParamsDto params_)
        {
            SysProfileDto sysProfile = _service.GetSysProfile(params_);

            return(Ok(sysProfile));
        }
コード例 #6
0
 public SysProfileDto GetSysProfile(ProfileParamsDto params_)
 {
     return(_daoTypeSessions.SelectSysProfile(params_));
 }
コード例 #7
0
 public UserProfileDto GetUserProfile(ProfileParamsDto params_)
 {
     return(_daoTypeSessions.SelectProfile(params_));
 }