Example #1
0
        public IEnumerable <LoginLog> ReportLoginLogPage(int accountid, string username, DateTime startdate,
                                                         DateTime enddate,
                                                         string sortby, bool isdescending, int pagenumber, int pagecount)
        {
            VodigiLogsContext db = new VodigiLogsContext();

            var query = from loginlog in db.LoginLogs
                        select loginlog;

            query = query.Where(lls => lls.AccountID.Equals(accountid));
            if (!String.IsNullOrEmpty(username))
            {
                query = query.Where(lls => lls.Username.Equals(username));
            }
            query = query.Where(lls => lls.LoginDateTime >= startdate);
            query = query.Where(lls => lls.LoginDateTime < enddate);
            if (!String.IsNullOrEmpty(sortby))
            {
                query = query.OrderBy(sortby, isdescending);
            }

            // Get a single page from the filtered records
            int iSkip = (pagenumber * Constants.PageSize) - Constants.PageSize;

            List <LoginLog> loginlogs = query.Skip(iSkip).Take(Constants.PageSize).ToList();

            return(loginlogs);
        }
Example #2
0
        public int ReportActivityLogRecordCount(int accountid, string username,
                                                string entitytype, string entityaction,
                                                DateTime startdate, DateTime enddate)
        {
            VodigiLogsContext db = new VodigiLogsContext();

            var query = from activitylog in db.ActivityLogs
                        select activitylog;

            query = query.Where(als => als.AccountID.Equals(accountid));
            if (!String.IsNullOrEmpty(username))
            {
                query = query.Where(als => als.Username.Equals(username));
            }
            if (!String.IsNullOrEmpty(entitytype))
            {
                query = query.Where(als => als.EntityType.Equals(entitytype));
            }
            if (!String.IsNullOrEmpty(entityaction))
            {
                query = query.Where(als => als.EntityAction.Equals(entityaction));
            }
            query = query.Where(als => als.ActivityDateTime >= startdate);
            query = query.Where(als => als.ActivityDateTime < enddate);

            // Get a Count of all filtered records
            return(query.Count());
        }
Example #3
0
        public int ReportPlayerScreenContentLogRecordCount(int accountid, string playername,
                                                           string screenname, string screencontentname, string screencontenttypename,
                                                           DateTime startdate, DateTime enddate)
        {
            VodigiLogsContext db = new VodigiLogsContext();

            var query = from playerscreencontentlog in db.PlayerScreenContentLogs
                        select playerscreencontentlog;

            query = query.Where(pscls => pscls.AccountID.Equals(accountid));
            if (!String.IsNullOrEmpty(playername))
            {
                query = query.Where(pscls => pscls.PlayerName.Equals(playername));
            }
            if (!String.IsNullOrEmpty(screenname))
            {
                query = query.Where(pscls => pscls.ScreenName.Equals(screenname));
            }
            if (!String.IsNullOrEmpty(screencontentname))
            {
                query = query.Where(pscls => pscls.ScreenContentName.Equals(screencontentname));
            }
            if (!String.IsNullOrEmpty(screencontenttypename))
            {
                query = query.Where(pscls => pscls.ScreenContentTypeName.Equals(screencontenttypename));
            }
            query = query.Where(pscls => pscls.DisplayDateTime >= startdate);
            query = query.Where(pscls => pscls.DisplayDateTime < enddate);

            // Get a Count of all filtered records
            return(query.Count());
        }
Example #4
0
        public IEnumerable <PlayerScreenLog> ReportPlayerScreenLogPage(int accountid, string playername, string screenname,
                                                                       DateTime startdate, DateTime enddate,
                                                                       string sortby, bool isdescending, int pagenumber, int pagecount)
        {
            VodigiLogsContext db = new VodigiLogsContext();

            var query = from playerscreenlog in db.PlayerScreenLogs
                        select playerscreenlog;

            query = query.Where(psls => psls.AccountID.Equals(accountid));
            if (!String.IsNullOrEmpty(playername))
            {
                query = query.Where(psls => psls.PlayerName.Equals(playername));
            }
            if (!String.IsNullOrEmpty(screenname))
            {
                query = query.Where(psls => psls.ScreenName.Equals(screenname));
            }
            query = query.Where(psls => psls.DisplayDateTime >= startdate);
            query = query.Where(psls => psls.DisplayDateTime < enddate);

            // Apply the ordering
            if (!String.IsNullOrEmpty(sortby))
            {
                query = query.OrderBy(sortby, isdescending);
            }

            // Get a single page from the filtered records
            int iSkip = (pagenumber * Constants.PageSize) - Constants.PageSize;

            List <PlayerScreenLog> playerscreenlogs = query.Skip(iSkip).Take(Constants.PageSize).ToList();

            return(playerscreenlogs);
        }
Example #5
0
        public int ReportLoginLogRecordCount(int accountid, string username, DateTime startdate, DateTime enddate)
        {
            VodigiLogsContext db = new VodigiLogsContext();

            var query = from loginlog in db.LoginLogs
                        select loginlog;

            query = query.Where(lls => lls.AccountID.Equals(accountid));
            if (!String.IsNullOrEmpty(username))
            {
                query = query.Where(lls => lls.Username.Equals(username));
            }
            query = query.Where(lls => lls.LoginDateTime >= startdate);
            query = query.Where(lls => lls.LoginDateTime < enddate);

            // Get a Count of all filtered records
            return(query.Count());
        }