Пример #1
0
        public static List <BookmarkItem> deleteItem(string titleIn)
        {
            var adapter = new BookmarksTableAdapter();
            var results = new List <BookmarkItem>();
            var rows    = adapter.GetData();

            foreach (var row in rows)
            {
                if (row.Title.Equals(titleIn))
                {
                    adapter.Delete(row.Id, row.URL, row.Title);
                    break;
                }
            }
            foreach (var row in rows)
            {
                var item = new BookmarkItem();
                item.URL   = row.URL;
                item.Title = row.Title;
                item.Id    = row.Id;

                results.Add(item);
            }
            return(results);
        }
Пример #2
0
        public static void DeleteBookmark(string URLin)
        {
            var adapter = new BookmarksTableAdapter();
            var rows    = adapter.GetData();

            foreach (var row in rows)
            {
                if (row.URL.Equals(URLin))
                {
                    adapter.Delete(row.Id, row.URL, row.Title);
                    break;
                }
            }
        }
Пример #3
0
        /////////////////////////////
        // DELETES BOOKMARK ITEMS //
        ///////////////////////////
        public static void DeleteBook(string candidate)
        {
            var adapter = new BookmarksTableAdapter();
            var rows    = adapter.GetData();

            foreach (var row in rows)
            {
                string rowChecker = string.Format(string.Format("{0} ({1})", row.URL, row.Title));

                if (rowChecker == candidate)
                {
                    adapter.Delete(row.Id, row.Title);
                }
            }
        }
Пример #4
0
        // Method to delete bookmarkItem from the database
        public static void DeleteItem(int index)
        {
            BookmarkItem item = GetItem(index);

            adapter.Delete(item.Id, item.URL, item.Title);
        }
        public static void DeleteBookmarkItem(int id)
        {
            BookmarksTableAdapter adapter = new BookmarksTableAdapter();

            adapter.Delete(id);
        }