/// <summary> /// Instantiate the maps used to store tickets. /// Maps are sorted by the ticket status. /// </summary> private void InstantiateVars() { if (_results is null) { _results = new List <RepairTicket>(); } _ticketMap = BackParser.BuildTicketMap(_context, _userId, _ticketMap); _displayMap = BackParser.BuildStatusMap(_context, _userId, _displayMap); UserSettings usett = UpdateDatabase.GetCurrentUserSettings(_context, _userId); if (usett is not null) { string statusOrderStr = usett.ticketOrder; _statusOrder = statusOrderStr.Split(", "); _ticketsPerRow = usett.numTicketsPerStatus; } else { _statusOrder = _defaultStatusOrder; } SetStatuses(); }
/// <summary> /// Keep track of the number of each type of ticket. /// </summary> /// <param name="repairList"></param> private void UpdateStatuses(List <RepairTicket> repairList) { BackParser.ClearMap(_ticketMap); Sorter.ParseStatusMap(repairList, _ticketMap); BackParser.UpdateStatuses(repairList, _ticketMap); }
/// <summary> /// Add labels to include status list. /// This is used to show all tickets when display is first loads. /// </summary> private void SetStatuses() { _includeTickets = BackParser.SetStatusList(_userId, _includeTickets, _displayMap); }
/// <summary> /// Initialize the dropdown menus with appropriate values. /// </summary> private void CreateDropdowns() { _numCardDropdown = BackParser.CreateDropdowns(_numCardDropdown); _numCardDropdownStatus = BackParser.CreateDropdownStatus(_numCardDropdownStatus); }