コード例 #1
0
        public RecentlyOpenedDocs()
        {
            //Ensure entries still exist in sermons table
            List <Database.RODs>   rods    = new Database.RODs().SelectAll();
            List <Database.Sermon> sermons = new Database.Sermon().SelectAll();

            bool found = false;

            for (int i = rods.Count - 1; i >= 0; i--)
            {
                found = false;
                for (int j = 0; j < sermons.Count; j++)
                {
                    if ((sermons[j].Id == rods[i].Id) && (sermons[j].Title == rods[i].Title))
                    {
                        found = true;
                        break;
                    }
                }
                if (!found)
                {
                    Database.RODs rod = new Database.RODs(rods[i].Id);
                    rod.Delete(rod);
                }
            }
        }
コード例 #2
0
 static public void AddNewNode(int id, string title)
 {
     Database.RODs rods = new Database.RODs()
     {
         Id    = id,
         Title = title,
     };
     if (rods.Exists(rods))
     {
         rods.Delete(rods);
     }
     rods.Insert(rods);
 }
コード例 #3
0
 static public void DeleteSermonFromID(int id)
 {
     Database.RODs rods = new Database.RODs(id);
     rods.Delete(rods);
 }