//Добавляет ошибку в ErrorsList private void LogToErrorsList(ErrorCommand er) { try { DateTime t = DateTime.Now; if (ErrorsRec != null) { ErrorsRec.AddNew(); ErrorsRec.Put("Description", er.Text); ErrorsRec.Put("Params", er.ToLog()); ErrorsRec.Put("Time", t); if (CommandLog != null) { ErrorsRec.Put("Command", CommandLog.Name); ErrorsRec.Put("Context", CommandLog.Context); } if (CommandSubLog != null) { ErrorsRec.Put("PeriodBegin", CommandSubLog.PeriodBegin); ErrorsRec.Put("PeriodEnd", CommandSubLog.PeriodEnd); } ErrorsRec.Update(); } LogErrorsSpecial(er, t, CommandLog); } catch (Exception ex) { AddErrorAboutHistory(ex); } }
//Добавляет Ошибку в лог private void LogError(ErrorCommand er) { try { if (SuperHistory != null) { SuperHistory.AddNew(); if (HistoryId > 0) { SuperHistory.Put("HistoryId", HistoryId); } SuperHistory.Put("Description", er.Text); SuperHistory.Put("Params", er.ToLog()); SuperHistory.Put("Time", DateTime.Now); if (CommandLog != null) { SuperHistory.Put("FromStart", CommandLog.FromEvent); } SuperHistory.Put("Status", "Ошибка"); SuperHistory.Update(); } } catch (Exception ex) { AddErrorAboutHistory(ex); } }