public db_config_frame(NtEcConFigs db, List<Frame> frames, string pageName)
 {
     _allFrames = frames;
     _db = db;
     _pageName = pageName;
     _pageId = -1;
     _frameId = -1;
 }
 public db_config_frame(NtEcConFigs db, List<Frame> frames, int pageId)
 {
     _allFrames = frames;
     _db = db;
     _pageName = string.Empty;
     _pageId = pageId;
     _frameId = -1;
 }
        public db_config_users(NtEcConFigs db, int userId)
        {
            _allUsers = new List<Users>();
            _db = db;
            _userName = string.Empty;
            _userId = userId;

            SelectObjectsFromDb();
        }
        public db_config_users(NtEcConFigs db, string userName)
        {
            _allUsers = new List<Users>();
            _db = db;
            _userName = userName;
            _userId = -1;

            SelectObjectsFromDb();
        }
        public db_config_page(NtEcConFigs db, List<Page> pages, int masterPageId)
        {
            _allPages = pages;
            _db = db;

            _pageName = string.Empty;
            _masterPageId = masterPageId;
            _pageId = -1;
        }
示例#6
0
 /// <summary>
 /// Try to Dispose linq object
 /// </summary>
 public void Close()
 {
     try
     {
         _db.Dispose();
         _db = null;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#7
0
 protected db_config()
 {
     _db = null;
 }
示例#8
0
        protected void ConnectToDataBase()
        {
            try
            {
                string dbPath;

                // Checked _dbPath if string is empty, if is empty then you are going to use the default site path
                if (_dbPath != string.Empty)
                {
                    dbPath = _dbPath;
                }
                else
                {
                    dbPath = System.Web.HttpContext.Current.Request.PhysicalApplicationPath;
                    dbPath = dbPath.EndsWith(@"\")
                                ? dbPath + @"\App_Data\configs.db"
                                : dbPath + @"App_Data\configs.db";

                    _dbPath = dbPath; // protection measure for reopen and refresh.
                }

                // if you receive the _db connection from anothe class then it does not need to connect again
                if (_db == null)
                    _db = new NtEcConFigs(new SQLiteConnection(@"Data Source=" + dbPath + ";Version=3;"));
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }