using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.Reporting;
namespace SafeMobileLib
{
public class ReportsModule
{
public enum Filters {TIME_START, TIME_END, UNITS_IDS, COORDINATES, COMPUTE, GEOFENCE_NAME_IDS, GEOFENCE_TYPE,
LANDMARK_NAME_IDS, LANDMARK_TYPE, STATUS_TYPE, IDLING_PERIOD};
public enum Geofence_Type { IN = 1, OUT = 2 };
public enum Landmark_Type { IN = 1, OUT = 2 };
public enum Status_Type { ON = 1, OFF = 2, MADE_OFF = 3, MADE_ON = 4}
///
/// Generate a Speeding Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// COORDINATES --- Boolean
/// COMPUTE --- Boolean
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report SpeedingReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if(parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime) parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
// check if coordinates needs to be displayed with Lat/Lng
if (parameters.ContainsKey(Filters.COORDINATES))
{
Boolean coordinates = (Boolean)parameters[Filters.COORDINATES];
}
// check if addresses needs to be computed
if (parameters.ContainsKey(Filters.COMPUTE))
{
Boolean computer = (Boolean)parameters[Filters.COMPUTE];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a Geofence Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// GEO_NAME_IDS --- List
/// GEOFENCE_TYPE --- List
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report GeofenceReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
// check if geofence name was selected
if (parameters.ContainsKey(Filters.GEOFENCE_NAME_IDS))
{
List geofencesIds = (List)parameters[Filters.GEOFENCE_NAME_IDS];
}
// check if addresses needs to be computed
if (parameters.ContainsKey(Filters.GEOFENCE_TYPE))
{
List geofenceTypes = (List)parameters[Filters.GEOFENCE_TYPE];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a Landmark Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// LAND_NAME_IDS --- List
/// LANDMARK_TYPE --- List
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report LandmarkReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
// check if geofence name was selected
if (parameters.ContainsKey(Filters.LANDMARK_NAME_IDS))
{
List landmarkIds = (List)parameters[Filters.LANDMARK_NAME_IDS];
}
// check if addresses needs to be computed
if (parameters.ContainsKey(Filters.LANDMARK_TYPE))
{
List landmarkTypes = (List)parameters[Filters.LANDMARK_TYPE];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a Emergency Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// COORDINATES --- Boolean
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report EmergencyReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
// check if coordinates needs to be displayed with Lat/Lng
if (parameters.ContainsKey(Filters.COORDINATES))
{
Boolean coordinates = (Boolean)parameters[Filters.COORDINATES];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a OnOff Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// STATUS --- List
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report OnOffReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
// check if status type was selected
if (parameters.ContainsKey(Filters.STATUS_TYPE))
{
List statusTypes = (List)parameters[Filters.STATUS_TYPE];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a All Alarms Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report AllAlarmsReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a History Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// COORDINATES --- Boolean
/// COMPUTE --- Boolean
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report HistoryReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
// check if coordinates needs to be displayed with Lat/Lng
if (parameters.ContainsKey(Filters.COORDINATES))
{
Boolean coordinates = (Boolean)parameters[Filters.COORDINATES];
}
// check if addresses needs to be computed
if (parameters.ContainsKey(Filters.COMPUTE))
{
Boolean computer = (Boolean)parameters[Filters.COMPUTE];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a End of Day Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// COORDINATES --- Boolean
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report EndOfDayReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
// check if coordinates needs to be displayed with Lat/Lng
if (parameters.ContainsKey(Filters.COORDINATES))
{
Boolean coordinates = (Boolean)parameters[Filters.COORDINATES];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a Idling Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// COORDINATES --- Boolean
/// IDLING_PERIOD --- Int16
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report IdlingReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
// check if coordinates needs to be displayed with Lat/Lng
if (parameters.ContainsKey(Filters.COORDINATES))
{
Boolean coordinates = (Boolean)parameters[Filters.COORDINATES];
}
// check if Idling time was selected
if (parameters.ContainsKey(Filters.IDLING_PERIOD))
{
Int16 idlingPeriod = (Int16)parameters[Filters.IDLING_PERIOD];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a Stops Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// COORDINATES --- Boolean
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report StopsReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
// check if coordinates needs to be displayed with Lat/Lng
if (parameters.ContainsKey(Filters.COORDINATES))
{
Boolean coordinates = (Boolean)parameters[Filters.COORDINATES];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a Fleet Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// COORDINATES --- Boolean
/// COMPUTE --- Boolean
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report FleetReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a TelemetryAlarms Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// COORDINATES --- Boolean
/// COMPUTE --- Boolean
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report TelemetryAlarmsReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
// check if coordinates needs to be displayed with Lat/Lng
if (parameters.ContainsKey(Filters.COORDINATES))
{
Boolean coordinates = (Boolean)parameters[Filters.COORDINATES];
}
// check if addresses needs to be computed
if (parameters.ContainsKey(Filters.COMPUTE))
{
Boolean computer = (Boolean)parameters[Filters.COMPUTE];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a Telemetry Events Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// COORDINATES --- Boolean
/// COMPUTE --- Boolean
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report TelemetryEventsReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
// check if coordinates needs to be displayed with Lat/Lng
if (parameters.ContainsKey(Filters.COORDINATES))
{
Boolean coordinates = (Boolean)parameters[Filters.COORDINATES];
}
// check if addresses needs to be computed
if (parameters.ContainsKey(Filters.COMPUTE))
{
Boolean computer = (Boolean)parameters[Filters.COMPUTE];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
///
/// Generate a Text Message Location Report with the desired parameters which will act as
/// filter.
/// For each Filter the type of the object will be according to the below list
/// TIME_START --- DateTime
/// TIME_END --- DateTime
/// UNITS_IDS --- List
/// COORDINATES --- Boolean
/// COMPUTE --- Boolean
///
/// List with filters on which the search will be
/// done when generating this report
/// Telerik Report that will be used inside a ReportViewer or
/// used to generate the pdf
public static Report TextMessageLocationReport(Dictionary parameters)
{
Report report = new Report();
// check if time start was selected
if (parameters.ContainsKey(Filters.TIME_START))
{
DateTime start = (DateTime)parameters[Filters.TIME_START];
}
// check if time end was selected
if (parameters.ContainsKey(Filters.TIME_END))
{
DateTime end = (DateTime)parameters[Filters.TIME_END];
}
// check if Units was selected
if (parameters.ContainsKey(Filters.UNITS_IDS))
{
List unitsIds = (List)parameters[Filters.UNITS_IDS];
}
// check if coordinates needs to be displayed with Lat/Lng
if (parameters.ContainsKey(Filters.COORDINATES))
{
Boolean coordinates = (Boolean)parameters[Filters.COORDINATES];
}
// check if addresses needs to be computed
if (parameters.ContainsKey(Filters.COMPUTE))
{
Boolean computer = (Boolean)parameters[Filters.COMPUTE];
}
//TODO
// create the gl_where based on the filters and then generate the
// report
return report;
}
}
}