/// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IDatabaseService databaseService,
                             IAccountService accountService,
                             ICategoryService categoryService,
                             ITransactionService transactionService,
                             IOptionService optionService)
        {
            DatabaseService = databaseService;
            AccountService = accountService;
            TransactionService = transactionService;
            CategoryService = categoryService;
            OptionService = optionService;




            DatabaseService.Initialize();

            Rendu = new ObservableCollection<KeyValuePair<string, string>>();


            CategoryRunner = new RelayCommand(() =>  TestCategory());
            
            AccountRunner = new RelayCommand(() => TestAccount());

            TransactionRunner = new RelayCommand(() => TestTransaction());
           
        }
        public RemoveDatabaseController(IDatabaseService databaseService, IAblageService ablageService)
        {
            if(databaseService == null) throw new ArgumentNullException("databaseService");
            if(ablageService == null) throw new ArgumentNullException("ablageService");

            this.Database = databaseService;
            this.Ablage = ablageService;
        }
 public EntityOperationService(IEntityRepository repository, IDatabaseService dbService, IEnumerable<IEntityOperationInspector> inspectors, IEnumerable<IEntityQueryInspector> queryInspectors, IEnumerable<IEntityOperationLogic> logics)
 {
     _repository = repository;
     _dbService = dbService;
     _inspectors = inspectors ?? new IEntityOperationInspector[0];
     _queryInspectors = queryInspectors ?? new IEntityQueryInspector[0];
     _logics = logics ?? new IEntityOperationLogic[0];
 }
        public NewDatabaseController(IDatabaseService databaseService, IAblageService ablageService, ITextOutputService textOutputService)
        {
            if(databaseService == null) throw new ArgumentNullException("databaseService");
            if(ablageService == null) throw new ArgumentNullException("ablageService");
            if(textOutputService == null) throw new ArgumentNullException("textOutputService");

            this.Database = databaseService;
            this.Ablage = ablageService;
            this.TextOutput = textOutputService;
        }
		public ConferencesScheduleViewModel(
			SQLiteAsyncConnection sqLiteConnection,
			IRemoteConferenceService conferenceService,
			IDatabaseService databaseService,
			IMvxMessenger messenger)
		{
			_messenger = messenger;
			_databaseService = databaseService;
			_conferenceService = conferenceService;
		}
Example #6
0
 public UpgradePresenter(
     IUpgradeView view, 
     IErrorView errorView, 
     IBackgroundTaskFactory backgroundTaskFactory,
     IDatabaseService databaseService)
 {
     _view = view;
     _errorView = errorView;
     _backgroundTaskFactory = backgroundTaskFactory;
     _databaseService = databaseService;
 }
Example #7
0
 public TestController(IApplicationService applicationService, IDatabaseService databaseService)
 {
     _applicationService = applicationService;
     _databaseService = databaseService;
     _skillNames = new List<string>()
     {
         "Pascal", "Delphi", "Assembler", "C++", "C", "C#", "HTML", 
         "CSS", "JavaScript", "jQuery", "Python", "Scala", ".NET",
         "ASP.NET MVC", "WebForms", "EmberJs", "AngularJS", "ReactJS"
     };
 }
Example #8
0
		public LoginViewModel(IAuthenticationService authenticationService,
			IRemoteConferenceService remoteConferenceService,
						IMvxJsonConverter jsonConverter, 
						IDatabaseService databaseService, 
						HttpClient httpClient)
		{
			_remoteConferenceService = remoteConferenceService;
			_databaseService = databaseService;
			_jsonConverter = jsonConverter;
			_authenticationService = authenticationService;
			_httpClient = httpClient;
		}
        public TrainingsViewModel(INavigationService navigationService, IDatabaseService databaseService)
            : base(navigationService)
        {
            // Services
            this.databaseService = databaseService;

            // Properties
            exercises = new ObservableCollection<Exercise>();

            // Commands
            AddExerciseCommand = new DelegateCommand(AddExercise);
            RemoveExerciseCommand = new DelegateCommand(RemoveExercise);
            StoreInDatabaseCommand = new DelegateCommand(StoreInDatabase);
            LoadFromDatabaseCommand = new DelegateCommand(LoadFromDatabase);
        }
Example #10
0
 public LoginPresenter(
     ILoginView view,
     IErrorView errorView,
     IDatabaseService databaseService,
     IAuthService authService,
     ISettingsService settingsService,
     IBackgroundTaskFactory backgroundTaskFactory)
 {
     _view = view;
     _errorView = errorView;
     _databaseService = databaseService;
     _authService = authService;
     _settingsService = settingsService;
     _backgroundTaskFactory = backgroundTaskFactory;
 }
        public ModuleResults GetResults(IInstanceInfo instanceInfo)
        {
            List<string> report = new List<string>();

            mDatabaseService = instanceInfo.DBService;

            DataTable webPartsInTransformationsTable = GetPageTemplateWebParts(LikePageTemplateDisplayName);
            List<string> whereOrderResults = new List<string>();
            List<string> otherResults = new List<string>();
            foreach (DataRow webPart in webPartsInTransformationsTable.Rows)
            {
                string pageTemplateDisplayName = webPart["PageTemplateDisplayName"] as string;
                XmlDocument webPartsXmlDoc = new XmlDocument();
                webPartsXmlDoc.LoadXml(webPart["PageTemplateWebParts"] as string);

                whereOrderResults.AddRange(AnalyseWhereAndOrderByConditionsInPageTemplateWebParts(webPartsXmlDoc, pageTemplateDisplayName));
                otherResults.AddRange(AnalysePageTemplateWebParts(webPartsXmlDoc, pageTemplateDisplayName));
            }

            if (whereOrderResults.Count > 0)
            {
                report.Add("------------------------ Web parts - Where and Order condition results - Potential SQL injections -----------------");
                report.AddRange(whereOrderResults);
            }
            if (otherResults.Count > 0)
            {
                report.Add("------------------------ Macros in DB - Potential XSS -----------------");
                report.AddRange(otherResults);
            }

            if (report.Count == 0)
            {
                return new ModuleResults
                {
                    ResultComment = "No problems in web parts found.",
                    Status = Status.Good
                };
            }

            StringBuilder res = new StringBuilder();
            report.ForEach(it => res.Append(it.Replace("\n", "<br />")));

            return new ModuleResults
            {
                Result = report,
                Trusted = true
            };
        }
Example #12
0
        public FileService(IEntityRepository repository, ISecurityService securityService, IDatabaseService dbService)
        {
            _repository = repository;
            _securityService = securityService;
            _dbService = dbService;

            FileServiceConfigurationSection config = ConfigurationManager.GetSection("fileService") as FileServiceConfigurationSection;
            _tempPath = config.TemporaryStoragePath;
            _permPath = config.PermanentStoragePath;
            _bufferSize = config.BufferSize;
            _allowed = new string[config.AllowedExtensions.Count];
            for (int i = 0; i < config.AllowedExtensions.Count; i++)
            {
                _allowed[i] = config.AllowedExtensions[i].Value;
            }
        }
        public GetLatestController(IVersionControlService versionControlService, IAdeNetExeAdaper adeNetExeAdapter, IBuildEngineService buildEngineService, IDatabaseService databaseService, IEnvironmentService environmentService, IConvention convention, ITextOutputService textOutputService)
        {
            if(versionControlService == null) throw new ArgumentNullException("versionControlService");
            if(adeNetExeAdapter == null) throw new ArgumentNullException("adeNetExeAdapter");
            if(buildEngineService == null) throw new ArgumentNullException("buildEngineService");
            if(databaseService == null) throw new ArgumentNullException("databaseService");
            if(environmentService == null) throw new ArgumentNullException("environmentService");

            this.VersionControl = versionControlService;
            this.AdeNet = adeNetExeAdapter;
            this.BuildEngine = buildEngineService;
            this.Database = databaseService;
            this.Environment = environmentService;
            this.Convention = convention;
            this.TextOutput = textOutputService;
        }
        public RemoveMappingController(IVersionControlService versionControlService, IAdeNetExeAdaper adeNetExeAdapter, IFileSystemAdapter fileSystemAdapter, IDatabaseService databaseService, IAblageService ablageService, IEnvironmentService environmentService, IConvention convention, ITextOutputService textOutputService)
        {
            if(versionControlService == null) throw new ArgumentNullException("versionControlService");
            if(adeNetExeAdapter == null) throw new ArgumentNullException("adeNetExeAdapter");
            if(fileSystemAdapter == null) throw new ArgumentNullException("fileSystemAdapter");
            if(databaseService == null) throw new ArgumentNullException("databaseService");
            if(ablageService == null) throw new ArgumentNullException("ablageService");
            if(convention == null) throw new ArgumentNullException("convention");

            this.VersionControl = versionControlService;
            this.AdeNetExeAdapter = adeNetExeAdapter;
            this.FileSystem = fileSystemAdapter;
            this.Database = databaseService;
            this.Ablage = ablageService;
            this.Environment = environmentService;
            this.Convention = convention;
            this.TextOutput = textOutputService;
        }
        public MainViewModel(IAccountService accountService, ICategoryService categoryService, ITransactionService transactionService, IOptionService optionService, IDatabaseService databaseService)
        {
            #region Set des objects obligatoire � la vue et ViewModel

            this.AccountSelectedCommand = new RelayCommand<SelectionChangedEventArgs>((args) => HandleAccountTaskSelected(args));
            this.CategorySelectedCommand = new RelayCommand<SelectionChangedEventArgs>((args) => HandleCategoryTaskSelected(args));

            this.EditAccountCommand = new RelayCommand<AccountViewData>((args) => HandleEditAccountTaskSelected(args));
            this.DeleteAccountCommand = new RelayCommand<AccountViewData>((args) => HandleDeleteAccountTaskSelected(args));
            this.FavoriteAccountCommand = new RelayCommand<AccountViewData>((args) => HandleFavoriteAccountTaskSelected(args));

            this.EditCategoryCommand = new RelayCommand<CategoryViewData>((args) => HandleEditCategoryTaskSelected(args));
            this.DeleteCategoryCommand = new RelayCommand<CategoryViewData>((args) => HandleDeleteCategoryTaskSelected(args));
            this.FavoriteCategoryCommand = new RelayCommand<CategoryViewData>((args) => HandleFavoriteCategoryTaskSelected(args));

            this.TileOptionChanged = new RelayCommand(HandleTileOptionChanged);

            DatabaseService = databaseService;
            AccountService = accountService;
            TransactionService = transactionService;
            CategoryService = categoryService;
            OptionService = optionService;

            this.ListeAccount = new ObservableCollection<AccountViewData>();
            this.ListeCategory = new ObservableCollection<CategoryViewData>();

            #endregion

            #region FAKE DATA

            var isAlreadyCreated = DatabaseService.Initialize();

            if (isAlreadyCreated)
            {
                DumpMyDBSQLCE.ProcessDatasOnDB(AccountService, CategoryService, TransactionService, OptionService);

                //FAVORI COMPTE 1
                OptionService.SetFavoriteIdAccount(1);
            }

            #endregion

            ExecuteSafeDispatcher(() => SetOption(), () => RefreshAccountAndFavori(), () => RefreshCategory());
        }
Example #16
0
        public static SQLConstraint GenerateSQLConstraint(IDatabaseService db, Dictionary<string, Type> typeMappings, string json)
        {
            var tokenizer = new JSONTokenizer(new StringReader(json));

            var events = new JSONWalkingEvents();

            var constraint = new JSONToSQLConstraint(db, events, typeMappings);

            JSONWalkingValidator walker = new JSONWalkingValidator();
            walker.Walk(tokenizer.GetEnumerator(), events);

            return constraint.GenerateSQLConstraint();
        }
 public HistoryViewModel()
 {
     databaseService = new DatabaseService();
     SearchResults = new ObservableCollection<HistorySearchResult>();
     SelectedSearch = null;
     SearchName = null;
     PerformSearch();
 }
Example #18
0
 public WorkoutPullService(IDatabaseService database, IFitocracyService fitocracy, IActivityGroupingService grouping)
 {
     _database = database;
     _fitocracy = fitocracy;
     _grouping = grouping;
 }
Example #19
0
 public StallRepository(IDatabaseService databaseService)
 {
     dbService = databaseService as RealmDatabaseService;
 }
        static ComponentDal()
        {
            var obj = new DataAccessService(ConfigHelper.GetDalConfig(DefineTable.ComponentConnectionName));

            _dalService = obj.CreateIntance();
        }
Example #21
0
 public PostSeedUtility(Subreddit subreddit, IDatabaseService <Post> postDatabase)
 {
     _subreddit    = subreddit;
     _postDatabase = postDatabase;
 }
Example #22
0
 public StartCommand(IDatabaseService db, IBotManager bot)
 {
     _db = db;
     _bot = bot;
 }
Example #23
0
 public ThumbnailService(IDatabaseService databaseService, IOptionsService optionsService)
 {
     _databaseService = databaseService;
     _optionsService  = optionsService;
 }
Example #24
0
 public GetSaleDetailQuery(IDatabaseService database)
 {
     _database = database;
 }
Example #25
0
 public WorkoutDetailPageViewModel(INavigationService navigationService, IDatabaseService dbService) :
     base(navigationService, dbService)
 {
     Workout = new WorkoutDTO();
 }
        public ModuleResults GetResults(IInstanceInfo instanceInfo)
        {
            List <string> report = new List <string>();

            mDatabaseService = instanceInfo.DBService;

            DataTable     webPartsInTransformationsTable = GetPageTemplateWebParts(LikePageTemplateDisplayName);
            List <string> whereOrderResults            = new List <string>();
            List <string> whereOrderCustomMacroResults = new List <string>();
            List <string> otherResults            = new List <string>();
            List <string> otherCustomMacroResults = new List <string>();

            foreach (DataRow webPart in webPartsInTransformationsTable.Rows)
            {
                string      pageTemplateDisplayName = webPart["PageTemplateDisplayName"] as string;
                XmlDocument webPartsXmlDoc          = new XmlDocument();
                webPartsXmlDoc.LoadXml(webPart["PageTemplateWebParts"] as string);

                whereOrderResults.AddRange(AnalyseWhereAndOrderByConditionsInPageTemplateWebParts(webPartsXmlDoc, pageTemplateDisplayName));
                otherResults.AddRange(AnalysePageTemplateWebParts(webPartsXmlDoc, pageTemplateDisplayName));

                if (MacroValidator.Current.CheckForCustomMacros(instanceInfo.Version))
                {
                    whereOrderCustomMacroResults.AddRange(AnalyseWhereAndOrderByConditionsInPageTemplateWebParts(webPartsXmlDoc, pageTemplateDisplayName, MacroValidator.MacroType.Custom));
                    otherCustomMacroResults.AddRange(AnalysePageTemplateWebParts(webPartsXmlDoc, pageTemplateDisplayName, MacroValidator.MacroType.Custom));
                }
            }

            if (whereOrderResults.Count > 0)
            {
                report.Add("------------------------ Web parts - Where and Order condition results - Potential SQL injections -----------------");
                report.AddRange(whereOrderResults);
                report.Add("<br /><br />");
            }

            if (whereOrderCustomMacroResults.Count > 0)
            {
                report.Add("------------------------ Web parts - Where and Order condition results - Using deprecated Custom Macro type -----------------");
                report.AddRange(whereOrderCustomMacroResults);
                report.Add("<br /><br />");
            }


            if (otherResults.Count > 0)
            {
                report.Add("------------------------ Macros in DB - Potential XSS -----------------");
                report.AddRange(otherResults);
                report.Add("<br /><br />");
            }

            if (otherCustomMacroResults.Count > 0)
            {
                report.Add("------------------------ Macros in DB - Using deprecated Custom Macro type -----------------");
                report.AddRange(otherCustomMacroResults);
                report.Add("<br /><br />");
            }

            if (report.Count == 0)
            {
                return(new ModuleResults
                {
                    ResultComment = "No problems in web parts found.",
                    Status = Status.Good
                });
            }

            StringBuilder res = new StringBuilder();

            report.ForEach(it => res.Append(it.Replace("\n", "<br />")));

            return(new ModuleResults
            {
                Result = report,
                Trusted = true
            });
        }
Example #27
0
 public Device8021DBService(IDatabaseService databaseService)
 {
     _databaseService = databaseService;
 }
Example #28
0
 public QuoteListPageModel(IDatabaseService databaseService)
 {
     _databaseService = databaseService;
 }
Example #29
0
 public Custom(IDatabaseService databaseService, ILogger <Custom> logger)
 {
     this.databaseService = databaseService;
     this.logger          = logger;
 }
Example #30
0
 public DeleteEmployeeCommand(IDatabaseService databaseService)
 {
     _databaseService = databaseService;
 }
 public AddGroupMemberController(IDatabaseService databaseService)
 {
     _databaseService = databaseService;
 }
 public AppActors(IDatabaseService db) : base()
 {
     this._db = db;
 }
Example #33
0
        public Commands(IServiceProvider serviceProvider, IConfiguration configuration, IDatabaseService databaseService, ILoggerFactory loggerFactory)
        {
            var databaseConfiguration = new Configuration
            {
                ConnectionString = configuration["ConnectionStrings:DefaultConnection"],
                ObjectFactory    = new Allors.ObjectFactory(MetaPopulation.Instance, typeof(User)),
                IsolationLevel   = this.IsolationLevel,
                CommandTimeout   = this.CommandTimeout
            };

            databaseService.Database = new Database(serviceProvider, databaseConfiguration);

            loggerFactory.AddNLog(new NLogProviderOptions {
                CaptureMessageTemplates = true, CaptureMessageProperties = true
            });
            NLog.LogManager.LoadConfiguration("nlog.config");
        }
Example #34
0
 public CommandHandler(IDatabaseService context, ILogger <CommandHandler> logger)
 {
     _context = context;
     _logger  = logger;
 }
Example #35
0
 public Report(IDatabaseService databaseService, IReportMetadataService reportMetadataService)
     : base(reportMetadataService)
 {
     this.databaseService = databaseService;
 }
        public PatientFinTradesPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDatabaseService databaseService)
        {
            _navigationService = navigationService;
            _pageDialogService = pageDialogService;
            _databaseService   = databaseService;

            MessagingCenter.Subscribe <PatientFinTradesPage>(this, Constants.OnPatientFinTradesPageAppearingMsg, (sender) => { GetPatientFinTradesAsync(); });

            FinTrades = new ObservableCollection <FinTrade>();
            AddOrEditFinTradeCommand = new DelegateCommand <string>(AddOrEditFinTradeAsync);
        }
 public Searcher(IDatabaseService databaseService = null)
 {
     _db = databaseService == null ? new DatabaseService(new SqlStoreDatabaseFactory()) : databaseService;
 }
 public Engine(IDatabaseService databaseService, ICommandDispatcher commandDispatcher)
 {
     this.databaseService   = databaseService;
     this.commandDispatcher = commandDispatcher;
 }
 public AltiumDBApiController(IDatabaseService databaseService, IDirectoryService directoryService)
 {
     _databaseService  = databaseService;
     _directoryService = directoryService;
 }
Example #40
0
 public void Setup()
 {
     Cleanup();
     _mb = Substitute.For <IMessageBox>();
     _db = new DatabaseService(new SqlStoreDatabaseFactory());
 }
Example #41
0
 public CommandFields(IDatabaseService database, IMapper mapper)
 {
     _database = database;
     _mapper   = mapper;
 }
 public PointOfInterestRepository(IDatabaseService databaseService)
 {
     _databaseService = databaseService;
 }
Example #43
0
 public CoreInfrastructure(IDatabaseService dbService)
 {
     _dbService = dbService;
 }
 public ClickUpController(ILogger <ClickUpController> logger, IDatabaseService databaseService)
 {
     _logger          = logger;
     _databaseService = databaseService;
 }
 public AchievementPushService(IDatabaseService database, IFitocracyService fitocracy)
 {
     _database = database;
     _fitocracy = fitocracy;
 }
 public FavoritesController(IDatabaseService databaseClient, IAuthService authClient)
 {
     _dbClient   = databaseClient;
     _authClient = authClient;
 }
Example #47
0
        public JSONToSQLConstraint(IDatabaseService db, JSONWalkingEvents events, Dictionary<string, Type> typeMappings)
        {
            if (null == db)
            {
                throw new ArgumentNullException("db");
            }

            if (null == events)
            {
                throw new ArgumentNullException("events");
            }

            if (null == typeMappings)
            {
                throw new ArgumentNullException("typeMappings");
            }

            _db = db;
            _events = events;
            _typeMappings = typeMappings;

            _events.ObjectStart += new JSONEventHandler(_events_ObjectStart);
            _events.ObjectEnd += new JSONEventHandler(_events_ObjectEnd);
            _events.ObjectKey += new JSONEventHandler<string>(_events_ObjectKey);

            _events.ArrayStart += new JSONEventHandler(_events_ArrayStart);
            _events.ArrayEnd += new JSONEventHandler(_events_ArrayEnd);
            _events.ArrayNext += new JSONEventHandler(_events_ArrayNext);

            _events.String += new JSONEventHandler<string>(_events_String);
            _events.Number += new JSONEventHandler<decimal>(_events_Number);
            _events.Null += new JSONEventHandler(_events_Null);
            _events.Boolean += new JSONEventHandler<bool>(_events_Boolean);

            _constraints = new Stack<Constraint>();
        }
Example #48
0
 public DataTable TestService(IDatabaseService inputValues) => _updateRepository.TestDbService(inputValues);
 public QuotePageModel (IDatabaseService databaseService)
 {
     _databaseService = databaseService;
 }
Example #50
0
 public AdminBillService(IDatabaseService dbService, IAddressService addressService) : base(dbService)
 {
     _addressService = addressService;
 }
Example #51
0
 public MainViewModel(IDatabaseService databaseService, ILocalFileService localFileService)
 {
     this.databaseService = databaseService;
     this.localFileService = localFileService;
 }
 static AppUserDal()
 {
     var obj = new DataAccessService(ConfigHelper.GetDalConfig(DefineTable.AppUserConnectionName));
     _dalService = obj.CreateIntance();
 }
 public ConfigurationViewModel(IDatabaseService databaseService)
 {
     _databaseService = databaseService;
 }
 public CarRepository(IDatabaseService databaseService)
 {
     _databaseService = databaseService;
 }
 static SolutionComponentRelationDal()
 {
     var obj = new DataAccessService(ConfigHelper.GetDalConfig(DefineTable.SolutionComponentRelationConnectionName));
     _dalService = obj.CreateIntance();
 }
 public DeleteBafuSpotModel(IDatabaseService databaseService)
 {
     _dataBaseService = databaseService;
 }
 public ApplicationService(IMappingService mappingService, IDatabaseService databaseService)
 {
     _mappingService = mappingService;
     _databaseService = databaseService;
 }
Example #58
0
 public SeedManager(IDatabaseService databaseService)
 {
     this.databaseService = databaseService;
     this.InititSeedList();
 }
Example #59
0
 public UserPullService(IDatabaseService database, IFitocracyService fitocracy)
 {
     _database = database;
     _fitocracy = fitocracy;
 }
Example #60
0
 public LoadNationalityQuery(IDatabaseService databaseService)
 {
     this.databaseService = databaseService;
 }