added pagesixe to userlist object. added total user count to enable PageCount to work correctly. added GET_TOTAL_USER_COUNT and GET_ALL_USERS_PAGINATE sqlite procedures to support pagination. updated methods in SQLiteRepository to support pagination procedures and pagination properties of UserList. updated UsersController to support pagination parameters. tidied html script tags. added pagination buttons at the bottom of user page. including drop down to select PageSize added setPageSize, goToUserPage and setPagination methods to the viewmodel. updated other methods for sammy etc to work with pagesize and PageNumber params. #11
26 lines
1.9 KiB
C#
26 lines
1.9 KiB
C#
namespace SQLiteRepository
|
|
{
|
|
internal static class SQLiteProcedures
|
|
{
|
|
public const string GET_TIMELOGS = "select * from "+nameof(TimeLogDb)+ " where (" + nameof(TimeLogDb.UserId_FK) + "=? AND " + nameof(TimeLogDb.CalendarWeek) + "=? and " + nameof(TimeLogDb.Year) + "=?)";
|
|
public const string GET_ALL_USERS = "select * from " + nameof(UserIdentity);
|
|
public const string GET_USER_BY_ID = "select * from " + nameof(UserIdentity) + " where " + nameof(UserIdentity.Id) + "=?";
|
|
|
|
public const string GET_CARDS_BY_USER_ID = "select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.UserId_FK) + "=?";
|
|
public const string GET_CARDS_BY_UNIQUE_ID = "select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.CardUId) + "=?";
|
|
public const string GET_UNASSIGNED_CARD_LIST = "select * from " + nameof(CardUniqueId) + " where " + nameof(CardUniqueId.UserId_FK) + "=?";
|
|
|
|
public const string GET_USER_BY_FIRST_AND_LAST =
|
|
"select * from " + nameof(UserIdentity) + " where " + nameof(UserIdentity.FirstName) + " = ? AND " + nameof(UserIdentity.LastName) + " = ?";
|
|
|
|
public const string UPDATE_CARD_USER_ID = "update " + nameof(CardUniqueId) + " set " + nameof(CardUniqueId.UserId_FK) + "=? where " + nameof(CardUniqueId.Id) + "=?";
|
|
|
|
public const string SEARCH_USER_LIST = "SELECT * FROM " + nameof(UserIdentity) + " where(" + nameof(UserIdentity.FirstName) + " Like ? OR " + nameof(UserIdentity.LastName) + " Like ?)";
|
|
|
|
public const string GET_LAST_TIMELOG_DIRECTION = "SELECT * FROM " + nameof(TimeLogDb) + " where " + nameof(TimeLogDb.UserId_FK) + " = ? order by " + nameof(TimeLogDb.SwipeEventDateTime) + " LIMIT 1";
|
|
|
|
public const string GET_ALL_USERS_PAGINATE = "select * from "+ nameof(UserIdentity)+" limit ? offset ?";
|
|
|
|
public const string GET_TOTAL_USER_COUNT = "select Max("+nameof(UserIdentity.Id)+") from " + nameof(UserIdentity);
|
|
}
|
|
} |