Esempio n. 1
0
 public void AddSet(ChannelsSet set)
 {
     SetsList.AddSet(set);
     dbHandler.AddSet(set);
     if (SetsList.Count == 1)
     {
         SelectedSetIndex = 0;
     }
     ((FragmentEditSets)fragmentPagerAdapter.tabs[1]).UpdateEditSetListView();
 }
Esempio n. 2
0
        /// <summary>
        /// Добавить сет в локальную БД
        /// </summary>
        /// <param name="set"></param>
        public void AddSet(ChannelsSet set)
        {
            SQLiteDatabase db = WritableDatabase;
            ContentValues  sets_table_values = new ContentValues();

            sets_table_values.Put(KEY_SET_NAME, set.Name);
            var id = db.Insert(SETS_TABLE_NAME, null, sets_table_values);

            foreach (Channel channel in set.Channels)
            {
                AddChannel(channel, (int)id);
            }

            db.Close();
        }