public DataSet ToDataSet() { //Return a dataset containing values for this object ScannerDS ds = null; try { ds = new ScannerDS(); ScannerDS.ArgixLogTableRow logEntry = ds.ArgixLogTable.NewArgixLogTableRow(); logEntry.ID = this._id; logEntry.Name = this._name; logEntry.Level = this._level; logEntry.Date = this._date; logEntry.Source = this._source; logEntry.Category = this._category; logEntry.Event = this._event; logEntry.User = this._user; logEntry.Computer = this._computer; logEntry.Keyword1 = this._keyword1; logEntry.Keyword2 = this._keyword2; logEntry.Keyword3 = this._keyword3; logEntry.Message = this._message; ds.ArgixLogTable.AddArgixLogTableRow(logEntry); } catch (Exception) { } return(ds); }
//Interface public Terminal(string name, int imageIndex, int selectedImageIndex, string connectionID) : base(name, imageIndex, selectedImageIndex) { //Constructor try { //Set custom attributes this.mName = name; this.mConnectionID = connectionID; this.mScannerDS = new ScannerDS(); IDictionary dict = (IDictionary)ConfigurationManager.GetSection(this.mName.ToLower() + "/scanners"); int scanners = Convert.ToInt32(dict["count"]); for (int i = 1; i <= scanners; i++) { string src = ""; try { dict = (IDictionary)ConfigurationManager.GetSection(this.mName.ToLower() + "/scanner" + i.ToString()); src = dict["source"].ToString(); this.mScannerDS.ScannerTable.AddScannerTableRow(this.mName, src); } catch (Exception ex) { throw new ApplicationException("Unexpected error refreshing " + this.mName + " " + (src.Length > 0 ? src : "??") + " scanner node.", ex); } } this.mScannerDS.AcceptChanges(); LoadChildNodes(); } catch (Exception ex) { throw new ApplicationException("Unexpected error creating new terminal instance.", ex); } }
//Interface public TraceLog(string logName, int initialDaysback, string DBConnection) { //Constructor try { //Set custom attributes this.mEventLogName = logName; this.mDaysBack = initialDaysback; this.mMediator = new SQLMediator(DBConnection); // this.mMediator.DataStatusUpdate += new DataStatusHandler(frmMain.OnDataStatusUpdate); this.mLogEntries = new ScannerDS(); } catch (Exception ex) { throw ex; } }
//Interface public Terminal(string name, int imageIndex, int selectedImageIndex, string dbConnection) : base(name, imageIndex, selectedImageIndex) { //Constructor try { //Set custom attributes this.mName = name; this.mDBConnection = dbConnection; this.mMediator = new SQLMediator(dbConnection); this.mScannerDS = new ScannerDS(); Refresh(); } catch (Exception ex) { throw ex; } }
public Scanner GetScanner(string sourceName) { //Return an existing scanner for this terminal Scanner scanner = null; try { //Read from the collection (dataset) ScannerDS ds = new ScannerDS(); ds.Merge(this.mScannerDS.ScannerTable.Select("SourceName='" + sourceName + "'")); scanner = new Scanner(ds.ScannerTable[0].SourceName, App.ICON_SCANNER, App.ICON_SCANNER, ds.ScannerTable[0], 1, this.mMediator); } catch (Exception ex) { throw ex; } return(scanner); }
public ScannerDS GetLogEntries(string eventLogName, DateTime startDate, DateTime endDate) { //Refresh data for this object ScannerDS logEntries = null; try { logEntries = new ScannerDS(); DataSet ds = fillDataset(USP_TRACELOG_GETLIST, TBL_TRACELOG_GETLIST, new object[] { eventLogName, startDate, endDate }); if (ds != null) { logEntries.Merge(ds); } } catch (Exception ex) { throw new ApplicationException("Unexpected error reading log entries.", ex); } return(logEntries); }
public ScannerDS GetCubeDetail(string labelSequenceNumber) { //Refresh data for this object ScannerDS detail = null; try { detail = new ScannerDS(); DataSet ds = fillDataset(USP_CUBEDETAIL_SEARCH, TBL_CUBEDETAILS, new object[] { labelSequenceNumber }); if (ds != null) { detail.Merge(ds); } } catch (Exception ex) { throw new ApplicationException("Unexpected error reading cube detail.", ex); } return(detail); }
public ScannerDS GetCubeStatsSummary(string sourceName, DateTime startDate, DateTime endDate) { // ScannerDS summary = null; try { //Clear cuurent collection and re-populate summary = new ScannerDS(); DataSet ds = fillDataset(USP_CUBESTATSSUM, TBL_CUBESTATSSUM, new object[] { sourceName, startDate, endDate }); if (ds != null) { summary.Merge(ds); } } catch (Exception ex) { throw new ApplicationException("Unexpected error reading cube statistics summary.", ex); } return(summary); }
public ScannerDS GetCubeDetails(string sourceName, DateTime startDate, DateTime endDate) { // ScannerDS details = null; try { //Clear cuurent collection and re-populate details = new ScannerDS(); DataSet ds = fillDataset(USP_CUBEDETAILS, TBL_CUBEDETAILS, new object[] { sourceName, startDate, endDate }); if (ds != null) { ScannerDS _ds = new ScannerDS(); _ds.Merge(ds); details.Merge(_ds.Tables[TBL_CUBEDETAILS].Select("", "CubeDate DESC")); } } catch (Exception ex) { throw new ApplicationException("Unexpected error reading cube details.", ex); } return(details); }
public ScannerDS GetCubeStats(string sourceName, DateTime startDate, DateTime endDate) { // ScannerDS stats = null; try { //Clear cuurent collection and re-populate stats = new ScannerDS(); DataSet ds = fillDataset(USP_CUBESTATS, TBL_CUBESTATS, new object[] { sourceName, startDate, endDate }); if (ds.Tables[TBL_CUBESTATS].Rows.Count > 0) { ScannerDS _ds = new ScannerDS(); _ds.Merge(ds); stats.Merge(_ds.CubeStatisticsTable.Select("", "DATE DESC, HOUR DESC")); } } catch (Exception ex) { throw new ApplicationException("Unexpected error reading cube statistics.", ex); } return(stats); }
//Interface public Scanner(string text, int imageIndex, int selectedImageIndex, ScannerDS.ScannerTableRow scanner, int initialDaysback, Mediator mediator) : base(text, imageIndex, selectedImageIndex) { //Constructor try { //Configure this terminal from the terminal configuration information this.mMediator = mediator; if (scanner != null) { this.mTerminalName = scanner.TerminalName; this.mSourceName = scanner.SourceName; } this.mProperties = new Properties(this); this.mDaysBack = initialDaysback; this.mCubeStatsDS = new ScannerDS(); this.mCubeStatsSummaryDS = new ScannerDS(); this.mCubeDetailsDS = new ScannerDS(); this.mTraceLog = new TraceLog(this.mSourceName, initialDaysback, this.mMediator.Connection); } catch (Exception ex) { throw ex; } }
public void RefreshCubeDetails() { //Clear existing entries and refresh collection try { //Clear cuurent collection and re-populate this.mCubeDetailsDS.Clear(); DataSet ds = this.mMediator.FillDataset(App.USP_CUBEDETAILS, App.TBL_CUBEDETAILS, new object[] { this.mSourceName, DateTime.Today.AddDays(-this.mDaysBack), DateTime.Now }); if (ds != null) { ScannerDS _ds = new ScannerDS(); _ds.Merge(ds); this.mCubeDetailsDS.Merge(_ds.Tables[App.TBL_CUBEDETAILS].Select("", "CubeDate DESC")); } } catch (Exception ex) { throw ex; } finally { if (this.CubeDetailsChanged != null) { this.CubeDetailsChanged(this, EventArgs.Empty); } } }
public void RefreshCubeStats() { //Clear existing entries and refresh collection try { //Clear cuurent collection and re-populate this.mCubeStatsDS.Clear(); DataSet ds = this.mMediator.FillDataset(App.USP_CUBESTATS, App.TBL_CUBESTATS, new object[] { this.mSourceName, DateTime.Today.AddDays(-this.mDaysBack), DateTime.Now }); if (ds.Tables[App.TBL_CUBESTATS].Rows.Count > 0) { ScannerDS stats = new ScannerDS(); stats.Merge(ds); this.mCubeStatsDS.Merge(stats.CubeStatisticsTable.Select("", "DATE DESC, HOUR DESC")); } } catch (Exception ex) { throw ex; } finally { if (this.CubeStatsChanged != null) { this.CubeStatsChanged(this, EventArgs.Empty); } } }