Ejemplo n.º 1
0
        public IEnumerable<ActivityLog> ReportActivityLogPage(int accountid, string username,
                                                        string entitytype, string entityaction,
                                                        DateTime startdate, DateTime enddate,
                                                        string sortby, bool isdescending, int pagenumber, int pagecount)
        {
            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);
            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<ActivityLog> activitylogs = query.Skip(iSkip).Take(Constants.PageSize).ToList();

            return activitylogs;
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 4
0
        public int ReportPlayerScreenLogRecordCount(int accountid, string playername, string screenname,
                                                        DateTime startdate, DateTime enddate)
        {
            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);

            // Get a Count of all filtered records
            return query.Count();
        }
Ejemplo n.º 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();
        }