public TaskExplorer(Logging log)
 {
     _log             = log;
     _logMessage      = new Logging.WriteMessage(_log.ToPrint);
     _logMessageDbLog = new Logging.WriteMessageToDbLog(_log.ToDbLog);
     ActionExTask     = new ActionDBExplorer <ExplorerTasks>(_log);
     ActionExObj      = new ActionDBExplorer <ExplorerObjects>(_log);
 }
Ejemplo n.º 2
0
        public void ToDbLog(string objectname, int hresult, string message)
        {
            message = hresult > 0 ? message + ": error = " + hresult.ToString() : message;
            message = string.Format("{0}: ", objectname) + message;
            DynamicParameters dp = new DynamicParameters();

            dp.Add("@Keyid", this.Keyid, System.Data.DbType.Guid, System.Data.ParameterDirection.Input);
            dp.Add("@HResult", hresult, System.Data.DbType.Int32, System.Data.ParameterDirection.Input);
            dp.Add("@Message", message, System.Data.DbType.AnsiString, System.Data.ParameterDirection.Input);
            ActionTaskLog = new ActionDBExplorer <ExplorerTasksLog>(this);
            ActionTaskLog.Insert(dp);
        }