public ActionResult Dpd() { DPDAction dpd_action = new DPDAction( _eventtrackingRepository, _eventtrackingtypeRepository, _eventtrackingparameterRepository, _eventtrackingunitloadRepository, _stateparcelsRepository, _stateRepository, _stateparcelsunitedRepository, _stateunitedRepository, _statehistoryRepository, _eventsRepository ); DPDActionResult result = dpd_action.Go(); if (result.IsOk) { //_timelineService.RegisterActivity(Realm.BG, ActivityType.LocationDeleted, User.Id); Feedback.AddMessageSuccess(result.Message); return(RedirectToAction("Index", nameof(DashboardController).RemoveControllerSuffix())); } else { Feedback.AddMessageWarning(result.Message); return(RedirectToAction("Index", nameof(DashboardController).RemoveControllerSuffix())); } }
private void OnElapsedTime(object source, ElapsedEventArgs e) { try { IDbConnectionFactory dbConnectionFactory = new ConnectionFactory(); EventTrackingRepository _eventtrackingRepository = new EventTrackingRepository(dbConnectionFactory); EventTrackingTypeRepository _eventtrackingtypeRepository = new EventTrackingTypeRepository(dbConnectionFactory); EventTrackingParameterRepository _eventtrackingparameterRepository = new EventTrackingParameterRepository(dbConnectionFactory); EventTrackingUnitLoadRepository _eventtrackingunitloadRepository = new EventTrackingUnitLoadRepository(dbConnectionFactory); StateParcelsRepository _stateparcelsRepository = new StateParcelsRepository(dbConnectionFactory); StateRepository _stateRepository = new StateRepository(dbConnectionFactory); StateUnitedRepository _stateunitedRepository = new StateUnitedRepository(dbConnectionFactory); StateParcelsUnitedRepository _stateparcelsunitedRepository = new StateParcelsUnitedRepository(dbConnectionFactory); StateHistoryRepository _statehistoryRepository = new StateHistoryRepository(dbConnectionFactory); EventsRepository _eventsRepository = new EventsRepository(dbConnectionFactory); DPDAction dpd_action = new DPDAction( _eventtrackingRepository, _eventtrackingtypeRepository, _eventtrackingparameterRepository, _eventtrackingunitloadRepository, _stateparcelsRepository, _stateRepository, _stateparcelsunitedRepository, _stateunitedRepository, _statehistoryRepository, _eventsRepository ); DPDActionResult result = dpd_action.Go(); if (result.IsOk) { WriteToFile("OK ! " + DateTime.Now); } else { WriteToFile("Что-то с пошло не так !!!" + result.Message + DateTime.Now); } } catch (Exception ex) { WriteToFile("Что-то с сервисом пошло не так !!!" + ex.Message + DateTime.Now); } }