Example #1
0
        public void SaveConfig(IConfiguration config)
        {
            if (null == _tblConfigTable)
            {
                return;
            }
            DBConfiguration dbConfig = new DBConfiguration(config);

            logger.Info("Updating config with the last modified date and the modifier");
            dbConfig.LastUpdated      = DateTime.Now;
            dbConfig.LastUpdateSource = string.Format("{0}@{1}", Environment.UserName, Environment.MachineName);

            logger.Info("Saving config");
            IList <IRow <DBConfiguration> > rows = _tblConfigTable.FindAll();

            if (null != rows && rows.Count > 0)
            {
                rows[0].Element = dbConfig;
                rows[0].Update();
            }
            else
            {
                _tblConfigTable.Add(dbConfig);
            }
        }
Example #2
0
        public void SaveConfig(IConfiguration config)
        {
            if (null == _tblConfigTable)
            {
                return;
            }
            DBConfiguration dbConfig = new DBConfiguration(config);
            logger.Info("Updating config with the last modified date and the modifier");
            dbConfig.LastUpdated = DateTime.Now;
            dbConfig.LastUpdateSource = string.Format("{0}@{1}", Environment.UserName, Environment.MachineName);

            logger.Info("Saving config");
            IList<IRow<DBConfiguration>> rows = _tblConfigTable.FindAll();
            if (null != rows && rows.Count > 0)
            {
                rows[0].Element = dbConfig;
                rows[0].Update();
            }
            else
            {
                _tblConfigTable.Add(dbConfig);
            }
        }