Ejemplo n.º 1
0
    public void AddSuggestion(string title, string description)
    {
        SuggestionEntry entry = new SuggestionEntry
        {
            title       = title,
            description = description,
            dateLogged  = string.Format("logged on: {0}", DateTime.Now.ToString(new CultureInfo("en-GB")))
        };

        suggestionDB.list.Add(entry);
    }
Ejemplo n.º 2
0
        // add suggestion to forward index
        int AddSuggestionEntry(string suggestion, out bool isNew)
        {
            int             id;
            SuggestionEntry entry;

            isNew = !contentToSuggestion.TryGetValue(suggestion, out entry);
            if (isNew)
            {
                id    = contentToSuggestion.Count;
                entry = new SuggestionEntry(id, suggestion, 1);
                contentToSuggestion[suggestion] = idToSuggestion[id] = entry;
            }
            else
            {
                entry.count++;
            }

            return(entry.id);
        }