Example #1
0
 public ErrorReportSelect(ErrorReport _errorReport)
 {
     this.ErrorReport= _errorReport;
     Command = @"SELECT * FROM tblErrorLog WHERE serviceName = :serviceName AND" +
               @" errorTime BETWEEN :serviceName and :serviceName" +
      			      @" ORDER BY errorTime DESC;";
 }
    private void loadGridData()
    {
        try
        {
            string _startTime = _dtStart.SelectedDate.ToString();
            string _endTime=_dtEnd.SelectedDate.ToString();

            string _serviceName = "";
            if (_rdSpeedingAlarm.Checked)
                _serviceName = "Speeding";
            else if (_rdGeofence.Checked)
                _serviceName = "Geofence";
            else if (_rdGeocoding.Checked)
                _serviceName = "Geocoding";

            #region old_1
            //string _strSQL = "select * from tblErrorLog where serviceName='" + _serviceName + "' and errorTime between '" + _startTime + "' and '" + _endTime + "'  order by errorTime desc";
            //Database _db = new Database();
            DataSet _ds = new DataSet();

            //_ds = _db.getDataSet(_strSQL);
            #endregion
            ErrorReport _errorReport = new ErrorReport();
            _errorReport.ServiceName = _serviceName;
            _errorReport.StartTime = _startTime;
            _errorReport.EndTime = _endTime;

            ProcessErrorReport _errorReports = new ProcessErrorReport();
            _errorReports.ErrorReport = _errorReport;
            _errorReports.invoke();
            _ds = _errorReports.Ds;

            #region new_1

            #endregion

            int count = _ds.Tables[0].Rows.Count;

            _grdErrorLog.DataSource = _ds;
            _grdErrorLog.DataBind();

            if (_grdErrorLog.Items.Count < 1)
                _grdErrorLog.Visible = false;
            else
                _grdErrorLog.Visible = true;
        }
        catch (Exception ex)
        {

        }
    }