Exemplo n.º 1
0
 /// <summary>
 /// Saves the display preferences.
 /// </summary>
 /// <param name="prefrences">The preferences.</param>
 public void SaveDisplayPreferences(UserDisplayPreferences prefrences)
 {
     Repository.DisplayPreferences = prefrences;//ProfileCommon implicitly saves on set accessor
 }
Exemplo n.º 2
0
        /// <summary>
        /// Verifies the minimum set of default preferences for the default lists.
        /// </summary>
        /// <param name="preferences">The preferences to check for defaults.</param>
        public void VerifyDefaultTicketCenterLists(UserDisplayPreferences preferences)
        {
            if (preferences == null)
            {
                preferences = new UserDisplayPreferences();
            }
            int numStaffLists = preferences.TicketCenterListPreferences.Count(s => s.ListName == "unassigned" || s.ListName == "assignedtome");
            int numSubmitterLists = preferences.TicketCenterListPreferences.Count(s => s.ListName == "mytickets" || s.ListName == "opentickets" || s.ListName == "historytickets");

            if ((((Security.IsTdStaff()) && (numStaffLists < 2)) || ((!Security.IsTdStaff()) && (numStaffLists > 0)) || (numSubmitterLists < 3)))
            {
                preferences.TicketCenterListPreferences.Clear();
                preferences.TicketCenterListPreferences = CreateDefaultTicketCenterListPreferences();
                SaveDisplayPreferences(preferences);//Saves data to profile
            }
        }