Пример #1
0
        public QuoteGroup AddItemToGroup(QuoteItem i, string id, string title, bool insert_begin = true)
        {
            QuoteGroup group = null;

            group = AllGroups.SingleOrDefault(s => s.UniqueId == id);
            if (group == null)
            {
                group = new QuoteGroup(id, title);

                _allGroups.Add(group);
                i.Group = group;
            }
            else
            {
                i.Group = group;
            }

            if (insert_begin)
            {
                group.Items.Insert(0, i);
            }
            else
            {
                group.Items.Add(i);
            }

            return(group);
        }
Пример #2
0
        public QuoteGroup AddGroup(string id, string title)
        {
            QuoteGroup group = AllGroups.SingleOrDefault(s => s.UniqueId == id);

            if (group == null)
            {
                group = new QuoteGroup(id, title);
                _allGroups.Add(group);
            }

            return(group);
        }
Пример #3
0
        public QuoteGroup ReturnRecentGroup()
        {
            QuoteGroup group = AllGroups.SingleOrDefault(s => s.UniqueId == "-2");

            return(group);
        }
Пример #4
0
        public QuoteGroup ReturnFavoriteGroup()
        {
            QuoteGroup group = AllGroups.SingleOrDefault(s => s.UniqueId == "-1");

            return(group);
        }
Пример #5
0
        //internal Groups_Class DeleteGroup(int id)
        //{
        //    Group = AllGroups.SingleOrDefault(x => x.Id == id);

        //}
        internal void DeleteGroup(int id)
        {
            Group = AllGroups.SingleOrDefault(x => x.Id == id);
            AllGroups.Remove(Group);
        }
Пример #6
0
 public void EditGroup(Groups_Class EGroup, int id)
 {
     Group           = AllGroups.SingleOrDefault(x => x.Id == id);
     Group.GroupName = EGroup.GroupName;
 }
Пример #7
0
 public Groups_Class GetGroup(int id)
 {
     Group = AllGroups.SingleOrDefault(x => x.Id == id);
     return(Group);
 }