Exemplo n.º 1
0
        public long GetBookmarkIDByUrl(string bookmarkUrl)
        {
            long result = -1;

            try
            {
                using (BookmarksDL _bookmarksDL = new BookmarksDL())
                {
                    Bookmark bkmrk = new Bookmark
                    {
                        Url = bookmarkUrl
                    };

                    DataTable dt = _bookmarksDL.GetChangeColumnList(bkmrk);
                    foreach (DataRow item in dt.Rows)
                    {
                        result = item["ID"].ToLong();
                    }
                }
            }
            catch (Exception ex)
            {
                result = -1;
                LightLogger.LogMethod(ex, "BookmarkManager", "GetBookmarkIDByUrl");
            }
            return(result);
        }
Exemplo n.º 2
0
 internal int Update()
 {
     try
     {
         using (BookmarksDL _bookmarksdlDL = new BookmarksDL())
         {
             return(_bookmarksdlDL.Update(this));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 3
0
 internal int InsertAndGetId()
 {
     try
     {
         using (BookmarksDL _bookmarksdlDL = new BookmarksDL())
         {
             return(_bookmarksdlDL.InsertAndGetId(this));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 4
0
        public DataTable GetExternalBrowserList()
        {
            DataTable result = null;

            try
            {
                using (BookmarksDL bookmrksDL = new BookmarksDL())
                {
                    result = bookmrksDL.GetTable(new Browser());
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(result);
        }
Exemplo n.º 5
0
 private void ExportToExcel()
 {
     try
     {
         DataTable dt2Export = new DataTable();
         using (BookmarksDL bkmrkDL = new BookmarksDL())
         {
             dt2Export = bkmrkDL.GetTable(new Bookmark {
             });
         }
         exportMan.Export2Excel(dt2Export, "Bookmarks", "D:/Bookmarks.xls");
     }
     catch (Exception ex)
     {
         LightLogger.LogMethod(ex, this.Name, "ExportToExcel");
         MessageUtil.Error("Export Operation failed");
     }
 }
Exemplo n.º 6
0
        private void FormLoad(object sender, EventArgs e)
        {
            try
            {
                using (BookmarksDL bookmrksDL = new BookmarksDL())
                {
                    bookmarkList = bookmrksDL.GetTableAsList <Bookmark>();

                    SetDataSourceOfGRid();
                }
            }
            catch (Exception ex)
            {
                LightLogger.LogMethod(ex, this.Name, "FormLoad");

                MessageUtil.Error("Bookmark List could not be loaded.");
            }
        }
Exemplo n.º 7
0
        public List <Browser> GetExternalBrowsers()
        {
            List <Browser> _browsers = new List <Browser>();

            try
            {
                using (BookmarksDL bkmrksDL = new BookmarksDL())
                {
                    _browsers = bkmrksDL.GetTableAsList <Browser>();
                }
            }
            catch (Exception ex)
            {
                LightLogger.LogMethod(ex, "BookmarkManager", "GetExternalBrowsers");
                _browsers = new List <Browser>();
            }
            return(_browsers);
        }
Exemplo n.º 8
0
        public Bookmark GetById(int bookmarkId)
        {
            Bookmark bkmrk = null;

            try
            {
                using (BookmarksDL bkmrksDL = new BookmarksDL())
                {
                    bkmrk = bkmrksDL.GetObjectById <Bookmark>(bookmarkId);
                }
            }
            catch (Exception ex)
            {
                bkmrk = null;
                LightLogger.LogMethod(ex, "BookmarkManager", "GetById");
            }
            return(bkmrk);
        }