public string FindScanEvent(string labelSeqNum) { //Find a carton scan in the Argix Log table DataSet ds = new DataSet(); string sScans = ""; try { ds = this.mMediator.FillDataset(App.USP_SCANFINDINLOG, App.TBL_SCANFINDINLOG, new object[] { labelSeqNum }); ArgixLogDS dsLog = new ArgixLogDS(); dsLog.Merge(ds); if (dsLog.ArgixLogTable.Rows.Count > 0) { sScans += "ID Name Level Date Source Category Event User Computer Keyword1 Keyword2 Keyword3 Message \n"; sScans += "--------------------- ------------------------------ ----------- ----------------------- ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- \n"; for (int i = 0; i < dsLog.ArgixLogTable.Rows.Count; i++) { sScans += dsLog.ArgixLogTable[i].ID.ToString().PadRight(21, ' ') + " " + dsLog.ArgixLogTable[i].Name.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Level.ToString().PadRight(11, ' ') + " " + dsLog.ArgixLogTable[i].Date.ToString("MM/dd/yyyy hh:mm:ss tt").PadRight(23, ' ') + " " + dsLog.ArgixLogTable[i].Source.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Category.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Event.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].User.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Computer.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Keyword1.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Keyword2.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Keyword3.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Message + "\n"; } } else { sScans += "(0 row(s) returned)\n"; } sScans += "\n"; } catch (Exception ex) { throw new ApplicationException("Unexpected error while searching for sorted item " + labelSeqNum + ".", ex); } return(sScans); }
public string FindLogEvents(DateTime startDate, DateTime endDate, string logEvent) { //Find all occurrences of a log event DataSet ds = new DataSet(); string sEvents = ""; try { ds = this.mMediator.FillDataset(App.USP_LOGGETFOREVENT, App.TBL_LOGGET, new object[] { logEvent, startDate.ToString("yyyy-MM-dd HH:mm:ss"), endDate.ToString("yyyy-MM-dd HH:mm:ss") }); ArgixLogDS dsLog = new ArgixLogDS(); dsLog.Merge(ds); if (dsLog.ArgixLogTable.Rows.Count > 0) { sEvents += "ID Name Level Date Source Category Event User Computer Keyword1 Keyword2 Keyword3 Message \n"; sEvents += "--------------------- ------------------------------ ----------- ----------------------- ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- \n"; for (int i = 0; i < dsLog.ArgixLogTable.Rows.Count; i++) { sEvents += dsLog.ArgixLogTable[i].ID.ToString().PadRight(21, ' ') + " " + dsLog.ArgixLogTable[i].Name.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Level.ToString().PadRight(11, ' ') + " " + dsLog.ArgixLogTable[i].Date.ToString("MM/dd/yyyy HH:mm:ss tt").PadRight(23, ' ') + " " + dsLog.ArgixLogTable[i].Source.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Category.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Event.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].User.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Computer.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Keyword1.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Keyword2.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Keyword3.PadRight(30, ' ') + " " + dsLog.ArgixLogTable[i].Message + "\n"; } } else { sEvents += "(0 row(s) returned)\n"; } sEvents += "\n"; } catch (Exception ex) { throw ex; } return(sEvents); }
public ArgixLogDS GetLogEvents(DateTime startDate, DateTime endDate, string stationName) { //Read log events ArgixLogDS logDS = null; try { logDS = new ArgixLogDS(); DataSet ds = this.mMediator.FillDataset(App.USP_LOGGETFORSTATION, App.TBL_LOGGET, new object[] { stationName, startDate.ToString("yyyy-MM-dd HH:mm:ss"), endDate.ToString("yyyy-MM-dd HH:mm:ss") }); if (ds != null) { logDS.Merge(ds); } } catch (Exception ex) { throw new ApplicationException("Unexpected error while reading log events for station " + stationName + ".", ex); } return(logDS); }
private ArgixLogDS getLogEvents(DateTime startDate, DateTime endDate) { //Read log events ArgixLogDS logDS = null; try { logDS = new ArgixLogDS(); Mediator mediator = new SQLMediator(this.mTraceSQLConnection); DataSet ds = mediator.FillDataset(App.USP_LOGGET, App.TBL_LOGGET, new object[] { startDate.ToString("yyyy-MM-dd HH:mm:ss"), endDate.ToString("yyyy-MM-dd HH:mm:ss") }); if (ds != null) { logDS.Merge(ds); } } catch (Exception ex) { throw new ApplicationException("Unexpected error while reading log events.", ex); } return(logDS); }