/// <summary> /// Initializes a new instance of the <see cref="TicketCenterListViewModel"/> class. /// </summary> /// <param name="listName">Name of the list.</param> /// <param name="ticketsList">The tickets list.</param> /// <param name="serviceModel">The service model.</param> public TicketCenterListViewModel(string listName, IPagination <Ticket> ticketsList, SettingsService settings, ISecurityService security) { Tickets = ticketsList; CurrentListSettings = settings.UserSettings.GetDisplayPreferences().GetPreferencesForList(listName); FilterBar = new FilterBarViewModel(CurrentListSettings, security.GetTdStaffUsers(), security.GetTdSubmitterUsers()); ListsForMenu = settings.UserSettings.GetDisplayPreferences().TicketCenterListPreferences.OrderBy(lp => lp.ListMenuDisplayOrder).ToArray(); }
/// <summary> /// Initializes a new instance of the <see cref="TicketCenterListViewModel"/> class. /// </summary> /// <param name="listName">Name of the list.</param> /// <param name="ticketsList">The tickets list.</param> /// <param name="serviceModel">The service model.</param> public TicketCenterListViewModel(string listName, IPagination<Ticket> ticketsList, SettingsService settings, ISecurityService security) { Tickets = ticketsList; CurrentListSettings = settings.UserSettings.GetDisplayPreferences().GetPreferencesForList(listName); FilterBar = new FilterBarViewModel(CurrentListSettings, security.GetTdStaffUsers(), security.GetTdSubmitterUsers()); ListsForMenu = settings.UserSettings.GetDisplayPreferences().TicketCenterListPreferences.OrderBy(lp => lp.ListMenuDisplayOrder).ToArray(); }
/// <summary> /// Initializes a new instance of the <see cref="TicketCenterListViewModel" /> class. /// </summary> /// <param name="currentPage">The current page.</param> /// <param name="listName">Name of the list.</param> /// <param name="context">The context.</param> /// <param name="userId">The user identifier.</param> private TicketCenterListViewModel(int currentPage, string listName, TicketDeskContext context, string userId) { UserListSettings = context.UserSettings.GetUserListSettings(userId).OrderBy(lp => lp.ListMenuDisplayOrder); CurrentPage = currentPage; if (string.IsNullOrEmpty(listName)) { listName = UserListSettings.First().ListName; } CurrentListSetting = context.UserSettings.GetUserListSettingByName(listName, userId); FilterBar = new FilterBarViewModel(CurrentListSetting); }