Esempio n. 1
0
        public static UserSetting GetDefaultSettingsForUser(string userId, bool isHelpDeskUser)
        {
            var collection = new UserTicketListSettingsCollection
            {
                UserTicketListSetting.GetDefaultListSettings(userId, isHelpDeskUser)
            };

            return(new UserSetting {
                UserId = userId, ListSettings = collection
            });
        }
        internal static bool HasRequiredDefaultListSettings(this UserTicketListSettingsCollection listSettings, bool isHelpDeskOrAdmin)
        {
            var hasLists = true;

            if (isHelpDeskOrAdmin)
            {
                hasLists =
                    listSettings.Any(s => s.ListName == "unassigned") &&
                    listSettings.Any(s => s.ListName == "assignedToMe");
            }
            return
                (hasLists &&
                 listSettings.Any(s => s.ListName == "mytickets") &&
                 listSettings.Any(s => s.ListName == "opentickets") &&
                 listSettings.Any(s => s.ListName == "historytickets"));
        }