public string SetContactIntegrationShedule()
        {
            string result;

            try
            {
                UserConnection.DBSecurityEngine.CheckCanExecuteOperation("CanManageAdministration");
                object interval       = null;
                bool   hasOldInterval = Terrasoft.Core.Configuration.SysSettings.TryGetValue(UserConnection,
                                                                                             "LDAPSynchInterval", out interval);

                if (hasOldInterval && (int)interval != 0)
                {
                    AppScheduler.ScheduleMinutelyProcessJob("NavAdProcessJob", "NavProcess", "NavAdStarterProcess",
                                                            UserConnection.Workspace.Name, UserConnection.CurrentUser.Name, (int)interval * 60);

                    global::Common.Logging.ILog _logger = global::Common.Logging.LogManager.GetLogger("ContactProcessLog");
                    _logger.Info("������������� ������������� ��������� ������ " + (int)interval + " �����");
                }


                result = "Ok";
            }
            catch (Exception ex)
            {
                result = ex.ToString();
            }
            return(result);
        }
        private bool ScriptTask1Execute(ProcessExecutingContext context)
        {
            UserConnection userConnection              = Get <UserConnection>("UserConnection");
            string         useOldProcessFeatureCode    = "UseOldOpportunityManagementProcess";
            bool           useOldVersion               = Get <bool>("UseOldOpportunityManagement");
            bool           forceUpdateUsageState       = Get <bool>("ForceUpdateUsageState");
            bool           useOldVersionFeatureEnabled = userConnection.GetIsFeatureEnabled(useOldProcessFeatureCode);

            if (forceUpdateUsageState && useOldVersionFeatureEnabled != useOldVersion)
            {
                var newState = useOldVersion ? FeatureState.Enabled : FeatureState.Disabled;
                userConnection.SetFeatureState(useOldProcessFeatureCode, (int)newState);
            }
            global::Common.Logging.ILog _logger         = global::Common.Logging.LogManager.GetLogger("Process");
            StoredProcedure             storedProcedure = new StoredProcedure(userConnection,
                                                                              "tsp_ActualizeOpportunityManagementProcess");

            storedProcedure.WithParameter("fetchProcessesInfo", true);
            Dictionary <Guid, bool> processSchemasInfos = new Dictionary <Guid, bool>();

            using (var executor = userConnection.EnsureDBConnection()) {
                using (var reader = storedProcedure.ExecuteReader(executor)) {
                    while (reader.Read())
                    {
                        var schemaName  = reader.GetValue <string>("SchemaName");
                        var schemaId    = reader.GetValue <Guid>("SchemaId");
                        var toBeEnabled = reader.GetValue <bool>("ToBeEnabled");
                        _logger.InfoFormat("Process {0}({1}) will be set to enabled state = {2}", schemaName,
                                           schemaId, toBeEnabled);
                        processSchemasInfos[schemaId] = toBeEnabled;
                    }
                }
            }
            var processSchemaManager = userConnection.ProcessSchemaManager;

            foreach (var processSchemaInfo in processSchemasInfos)
            {
                if (processSchemaInfo.Value)
                {
                    processSchemaManager.EnableProcess(userConnection, processSchemaInfo.Key);
                }
                else
                {
                    processSchemaManager.DisableProcess(userConnection, processSchemaInfo.Key);
                }
            }
            return(true);
        }
예제 #3
0
        internal static void SetUpLogging(string loggingConfigPath)
        {
            if (loggingConfigPath == null)
            {
                Common.Logging.LogManager.Adapter = new AnimeRecs.CommonLoggingNetStandardStopgap.SimpleConsoleLoggerFactoryAdapter();
            }
            else
            {
                NLog.LogManager.LoadConfiguration(loggingConfigPath);

                // Do not pass the log config file here, because NLog has already been configured with NLogBuilder.ConfigureNLog.
                Common.Logging.LogManager.Adapter = new NLogLoggerFactoryAdapter(new Common.Logging.Configuration.NameValueCollection());
            }
            Log = Common.Logging.LogManager.GetLogger("AnimeRecs.Web");
            WriteLogPrologue();
        }
예제 #4
0
 internal static void SetUpLogging(string loggingConfigPath)
 {
     if (loggingConfigPath == null)
     {
         Common.Logging.LogManager.Adapter = new AnimeRecs.CommonLoggingNetStandardStopgap.SimpleConsoleLoggerFactoryAdapter();
     }
     else
     {
         Common.Logging.LogManager.Adapter = new NLogLoggerFactoryAdapter(new Common.Logging.Configuration.NameValueCollection()
         {
             ["configType"] = "FILE",
             ["configFile"] = loggingConfigPath
         });
     }
     Log = Common.Logging.LogManager.GetLogger("AnimeRecs.FreshenMalDatabase");
     WriteLogPrologue();
 }
예제 #5
0
파일: LogWrapper.cs 프로젝트: jrjohn/Grace
 /// <summary>
 /// default constructor
 /// </summary>
 /// <param name="log">log instance to wrap</param>
 public LogWrapper(global::Common.Logging.ILog log)
 {
     this.log = log;
 }
예제 #6
0
 internal static void SetUpLogging()
 {
     Log = global::Common.Logging.LogManager.GetLogger("AnimeRecs.FreshenMalDatabase");
     WriteLogPrologue();
 }
예제 #7
0
 public CommonLogging(global::Common.Logging.ILog log)
 {
     _log = log;
 }
예제 #8
0
 internal static void SetUpLogging()
 {
     Log = global::Common.Logging.LogManager.GetLogger("AnimeRecs.RecService");
     WriteLogPrologue();
 }
 public LogAdapter(global::Common.Logging.ILog logger)
 {
     this.logger = logger;
 }
 public LogAdapter(global::Common.Logging.ILog logger)
 {
     this.logger = logger;
 }