public Todo(String __conn, String __token, String __emp, String __imei, Double __devicesTimer, Double __dailyHistoryTimer, String __startDailyHistorySyncDate, String __serviceName) { try { this.dbConnection = __conn; this.token = __token; this.emp = __emp; this.imei = __imei; this.devicesTimer = __devicesTimer; this.dailyHistoryTimer = __dailyHistoryTimer; this.startDailyHistorySyncDate = DateTime.Parse(__startDailyHistorySyncDate); this.api = new ApiHelper(this.token); this.dta = new devicesTableAdapter(); this.dhta = new dailyHistoryTableAdapter(); this.dslta = new DevicesSyncLogTableAdapter(); this.dta.Connection.ConnectionString = this.dbConnection; this.dhta.Connection.ConnectionString = this.dbConnection; this.dslta.Connection.ConnectionString = this.dbConnection; this.log = new LogHelper(__serviceName); this.serviceName = __serviceName; this.log.write("Configuracion cargada exitosamente iniciado exitosamente"); this.log.write("Iniciando sincronizacion manual"); this.manual = true; } catch (Exception ex) { this.devicesTimer = 0; this.dailyHistoryTimer = 0; this.log = new LogHelper("Error"); this.log.write("Ocurrio un error al cargar la informacion : " + ex.ToString()); } }
public Todo() { try { this.dbConnection = System.Configuration.ConfigurationManager.ConnectionStrings["GeoFleetService.Properties.Settings.geoFleetConnectionString"].ConnectionString; this.token = System.Configuration.ConfigurationManager.AppSettings["apiToken"].ToString(); this.emp = System.Configuration.ConfigurationManager.AppSettings["enterpriceName"].ToString(); this.imei = System.Configuration.ConfigurationManager.AppSettings["deviceImei"].ToString(); this.devicesTimer = Double.Parse(System.Configuration.ConfigurationManager.AppSettings["devicesTimer"].ToString()); this.dailyHistoryTimer = Double.Parse(System.Configuration.ConfigurationManager.AppSettings["dailyHistoryTimer"].ToString()); this.startDailyHistorySyncDate = DateTime.Parse(System.Configuration.ConfigurationManager.AppSettings["startDailyHistorySyncDate"].ToString()); this.api = new ApiHelper(this.token); this.dta = new devicesTableAdapter(); this.dhta = new dailyHistoryTableAdapter(); this.dslta = new DevicesSyncLogTableAdapter(); this.dta.Connection.ConnectionString = this.dbConnection; this.dhta.Connection.ConnectionString = this.dbConnection; this.dslta.Connection.ConnectionString = this.dbConnection; this.log = new LogHelper(System.Configuration.ConfigurationManager.AppSettings["serviceName"].ToString()); this.serviceName = System.Configuration.ConfigurationManager.AppSettings["serviceName"].ToString(); this.log.write("Servicio iniciado exitosamente"); } catch (Exception ex) { this.devicesTimer = 0; this.dailyHistoryTimer = 0; this.log = new LogHelper("Error"); this.log.write("Ocurrio un error al iniciar el servicio : " + ex.ToString()); } }