public string Execute(string argument) { SystemEventLogService logService = new SystemEventLogService(); PerformanceStatisticRepository pStatisticRepo = new PerformanceStatisticRepository(); try { PerformanceStatistic stats = new PerformanceStatistic(); stats = GetPCPerformance(); PerformanceStatistic input = new PerformanceStatistic(); input.CopyFrom(stats); if (input != null) { pStatisticRepo.InsertPerformanceStatistic(input); } List<NetworkStatistic> Networkstats = new List<NetworkStatistic>(); Networkstats = GetSystemNetworkStatistic(); if (Networkstats.Count > 0 && Networkstats != null) { foreach (NetworkStatistic nstatistic in Networkstats) { if (nstatistic.IpAddress != null) { //nstatistic.IpAddress = Convert.ToString(0); InsertNetworkStatistic(nstatistic); } } } return "Success"; } catch (Exception exp) { logService.InsertSystemEventLog(string.Format("Error in PerformanceStatisticThread: {0}", exp.Message), exp.StackTrace, EventCodes.Error); return "Error"; } }
public List<SystemEventLog> GetEventLogByLastUpdateDate(DateTime lastUpdateDate) { // ISystemEventLogService systemProcessThreadService = IoC.Resolve<ISystemEventLogService>("SystemEventLogService"); SystemEventLogService systemProcessThreadService = new SystemEventLogService(); return systemProcessThreadService.GetSystemEventLogsByLastUpdateDate(lastUpdateDate); }