Example #1
0
 public ApplicationViewModel(IDialogService dialogService, EFClientRepository repo)
 {
     fromDate                    = DateTime.Now;
     byDate                      = DateTime.Now;
     clientRepository            = repo;
     ClientsViewModelsColliction = new ObservableCollection <ClientViewModel>();
     UploadClients();
     this.dialogService  = dialogService;
     DocxCreater.Message = dialogService.ShowMessage;
 }
Example #2
0
        public async Task InitAsync()
        {
            var optionsBuilder = new DbContextOptionsBuilder <EFClientRepository>();

            optionsBuilder.UseSqlite("DataSource=:memory:");
            _clientRepository = new EFClientRepository(optionsBuilder.Options);
            await _clientRepository.Database.OpenConnectionAsync().ConfigureAwait(false);

            await _clientRepository.Database.EnsureCreatedAsync().ConfigureAwait(false);

            _clientService = new ClientService(_clientRepository);
        }
Example #3
0
        static void Main(string[] args)
        {
            var optionsBuilder = new DbContextOptionsBuilder <ProjetsORMContexte>();

            optionsBuilder.UseSqlServer(ConfigurationManager.ConnectionStrings["bdProjetsORMConnectionString"].ConnectionString);
            ProjetsORMContexte contexte = new ProjetsORMContexte(optionsBuilder.Options);

            //Instanciation des repositories
            EFClientRepository  clientRepo  = new EFClientRepository(contexte);
            EFEmployeRepository employeRepo = new EFEmployeRepository(contexte);
            EFProjetRepository  projetRepo  = new EFProjetRepository(contexte);


            Console.WriteLine("Démarrage...");

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            var optionsBuilder = new DbContextOptionsBuilder <ProjetsORMContexte>();

            optionsBuilder.UseSqlServer(ConfigurationManager.ConnectionStrings["bdProjetsORMConnectionString"].ConnectionString);
            ProjetsORMContexte contexte = new ProjetsORMContexte(optionsBuilder.Options);

            //Instanciation des repositories
            EFClientRepository      clientRepo      = new EFClientRepository(contexte);
            EFAffTravailRepository  affTravailRepo  = new EFAffTravailRepository(contexte);
            EFEmployeRepository     employeRepo     = new EFEmployeRepository(contexte);
            EFProjetRepository      projetRepo      = new EFProjetRepository(contexte);
            EFDepartementRepository departementRepo = new EFDepartementRepository(contexte);


            Console.WriteLine("Démarrage...");

            if (contexte.Employes.Count() == 0)
            {
                //Mettre en place le code nécessaire pour exécuter la procédure stockée PR_PREMIER_CHARGEMENT_PROJETS_ORM
            }

            Console.ReadKey();
        }