public BuchhaltungKomponenteFacade(
            IPersistenceServices persistenceService,
            ITransactionServices transactionService,
            IUnterbeauftragungServicesFuerBuchhaltung unterbeauftragungService,
            IBankServicesFuerBuchhaltung bankService,
            ITransportplanServicesFuerBuchhaltung transportplanServicesFuerBuchhaltung,
            IAuftragServicesFuerBuchhaltung auftragServicesFuerBuchhaltung,
            IGeschaeftspartnerServices geschaeftspartnerServices,
            IPDFErzeugungsServicesFuerBuchhaltung pDFErzeugungsServicesFuerBuchhaltung)
        {
            Check.Argument(persistenceService != null, "persistenceService != null");
            Check.Argument(transactionService != null, "transactionService != null");
            Check.Argument(unterbeauftragungService != null, "unterbeauftragungService != null");
            Check.Argument(transportplanServicesFuerBuchhaltung != null, "transportplanServicesFuerBuchhaltung != null");
            Check.Argument(bankService != null, "bankService != null");
            Check.Argument(auftragServicesFuerBuchhaltung != null, "auftragServicesFuerBuchhaltung != null");
            Check.Argument(geschaeftspartnerServices != null, "geschaeftspartnerServices != null");
            Check.Argument(pDFErzeugungsServicesFuerBuchhaltung != null, "PDFErzeugungsServicesFuerBuchhaltung != null");

            this.bh_REPO = new BuchhaltungRepository(persistenceService);
            this.transactionService = transactionService;
            this.unterbeauftragungService = unterbeauftragungService;
            this.bankService = bankService;
            this.transportplanServiceFuerBuchhaltung = transportplanServicesFuerBuchhaltung;
            this.auftragServiceFuerBuchhaltung = auftragServicesFuerBuchhaltung;
            this.geschaeftspartnerService = geschaeftspartnerServices;
            this.pDFErzeugungsServiceFuerBuchhaltung = pDFErzeugungsServicesFuerBuchhaltung;
        }
        public GeschaeftspartnerKomponenteFacade(IPersistenceServices persistenceService, ITransactionServices transactionService)
        {
            Check.Argument(persistenceService != null, "persistenceService != null");
            Check.Argument(transactionService != null, "transactionService != null");

            this.gp_REPO = new GeschaeftspartnerRepository(persistenceService);
            this.transactionService = transactionService;
        }
 public UnterbeauftragungKomponenteFacade(IPersistenceServices persistenceService, ITransactionServices transactionService, IFrachtfuehrerServicesFürUnterbeauftragung frachtfuehrerServices)
 {
     Check.Argument(persistenceService != null, "persistenceService != null");
     Check.Argument(transactionService != null, "transactionService != null");
     this.transactionService = transactionService;
     this.frv_REPO = new FrachtfuehrerRahmenvertragRepository(persistenceService);
     this.frf_REPO = new FrachtfuehrerRepository(persistenceService);
     this.fra_REPO = new FrachtauftragRepository(persistenceService);
     this.ubK_BL = new UnterbeauftragungKomponenteBusinessLogic(persistenceService, frachtfuehrerServices); 
 }
        public AuftragKomponenteFacade(IPersistenceServices persistenceService, ITransactionServices transactionService, ITimeServices timeServices)
        {
            Check.Argument(persistenceService != null, "persistenceService != null");
            Check.Argument(transactionService != null, "transactionService != null");
            Check.Argument(timeServices != null, "timeServices != null");

            this.sa_REPO = new SendungsanfrageRepository(persistenceService);
            this.aufK_BL = new AuftragKomponenteBusinessLogic(this.sa_REPO, timeServices);
            this.transactionService = transactionService;
            this.perdiodicGültigkeitsprüfungTaskCancellationTokenSource = new CancellationTokenSource();
        }
        public TransportplanungKomponenteFacade(IPersistenceServices persistenceService, ITransactionServices transactionService, IAuftragServicesFürTransportplanung auftragServices, IUnterbeauftragungServicesFürTransportplanung unterbeauftragungServices, ITransportnetzServicesFürTransportplanung transportnetzServices, ITimeServices timeServices)
        {
            Check.Argument(persistenceService != null, "persistenceService != null");
            Check.Argument(transactionService != null, "transactionService != null");
            Check.Argument(auftragServices != null, "auftragServices != null");
            Check.Argument(unterbeauftragungServices != null, "unterbeauftragungsServices != null");
            Check.Argument(transportnetzServices != null, "transportnetzServices != null");

            this.transactionService = transactionService;
            this.auftragServices = auftragServices;
            this.tp_REPO = new TransportplanRepository(persistenceService);
            this.tpK_BL = new TransportplanungKomponenteBusinessLogic(tp_REPO, transactionService, auftragServices, unterbeauftragungServices, transportnetzServices, timeServices);
        }
        public SendungKomponenteFacade(
            IPersistenceServices persistenceService,
            ITransactionServices transactionService,
            ITransportplanungServicesFuerSendung transportplanungServicesFuerSendung,
            IAuftragServices auftragService,
            IBuchhaltungServicesFuerSendung buchhaltungServicesFuerSendung)
        {
            Check.Argument(persistenceService != null, "persistenceService != null");
            Check.Argument(transactionService != null, "transactionService != null");
            Check.Argument(transportplanungServicesFuerSendung != null, "transportplanungServicesFuerSendung != null");

            this.transactionService = transactionService;
            this.se_REPO = new SendungRepository(persistenceService);
            this.transportplanungServicesFuerSendung = transportplanungServicesFuerSendung;
            this.auftragService = auftragService;
            this.buchhaltungServiceFuerSendung = buchhaltungServicesFuerSendung;
        }
Esempio n. 7
0
        public ReceiveController(
            IEncryptionServices encryptionServices,
            IZipServices zipServices,
            IFileManagementServices fileManagementServices,
            IPersistenceServices persistenceServices,
            IConfiguration configuration)
        {
            _encryptionServices     = encryptionServices;
            _zipServices            = zipServices;
            _fileManagementServices = fileManagementServices;
            _persistenceServices    = persistenceServices;
            _configuration          = configuration;

            var persistFiles = configuration[_persistFilesFieldName];

            persistFiles  = string.IsNullOrEmpty(persistFiles) ? _defaultPersistFiles : persistFiles; // if  not in conf, defautl 'default key'
            _persistFiles = bool.Parse(persistFiles);
        }
Esempio n. 8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DriveManager" /> class.
        /// </summary>
        /// <param name="securityManager">The security manager.</param>
        /// <param name="services">The services.</param>
        /// <param name="contentRoot">The root.</param>
        /// <exception cref="System.ArgumentNullException">
        /// securityManager
        /// or
        /// services
        /// or
        /// root
        /// </exception>
        public DriveManager(SecurityManager securityManager, IPersistenceServices services, string contentRoot)
        {
            if (securityManager == null)
            {
                throw new ArgumentNullException(nameof(securityManager));
            }
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }
            if (contentRoot == null)
            {
                throw new ArgumentNullException(nameof(contentRoot));
            }

            _securityManager = securityManager;
            _services        = services;
            _contentRoot     = contentRoot;
        }
 public FrachtfuehrerRepository(IPersistenceServices persistenceService)
 {
     this.persistenceService = persistenceService;
 }
 public FrachtauftragRepository(IPersistenceServices persistenceService)
 {
     this.persistenceService = persistenceService;
 }
 public GeschaeftspartnerRepository(IPersistenceServices persistenceService)
 {
     this.persistenceService = persistenceService;
 }
 public BuchhaltungRepository(IPersistenceServices persistenceService)
 {
     this.persistenceService = persistenceService;
 }
        public TransportplanRepository(IPersistenceServices persistenceService)
        {
            Check.Argument(persistenceService != null, "persistenceService != null");

            this.persistenceService = persistenceService;
        }
        /// <summary>
        /// Factory-method for different persistences.
        /// </summary>
        /// <param name="type">Type of persistence to create.</param>
        /// <param name="schemaUpdate">Indicates if schema is updated ('true') or recreated from scratch ('false').</param>
        /// <param name="persistenceService">Reference to persistence service.</param>
        /// <param name="transactionService">Reference to transaction service.</param>
        /// /// <param name="conversationFactory">Reference to conversation factory for creating conversations.</param>
        public static void CreatePersistenceService(
            PersistenceServiceType type, 
            bool schemaUpdate, 
            out IPersistenceServices persistenceService, 
            out ITransactionServices transactionService,
            out IConversationFactory conversationFactory)
        {
            Configuration configuration = new Configuration();
            FluentConfiguration fluentConfiguration = Fluently.Configure(configuration);

            // fetch connection string from configuration file
            System.Configuration.ConnectionStringSettings connectionSettings = System.Configuration.ConfigurationManager.ConnectionStrings["DatabaseConnection"];
            Contract.Assert(connectionSettings != null, "A database connection setting needs to be defined in the App.config."); 
            string connectionString = connectionSettings.ConnectionString;
            Contract.Assert(connectionString != null, "A database connection string needs to be defined in the App.config."); 

            // set persistencetype
            switch (type)
            {
                case PersistenceServiceType.MSSQL2008:
                    fluentConfiguration = fluentConfiguration.Database(
                        MsSqlConfiguration.MsSql2008.ConnectionString(connectionString));
                    break;
                case PersistenceServiceType.MySQL:
                    fluentConfiguration = fluentConfiguration.Database(
                        MySQLConfiguration.Standard.ConnectionString(connectionString));
                    break; 
            }

            // get all user assemblies
            ICollection<Assembly> allAssemblies = AppDomain.CurrentDomain.GetAssemblies().Where(assembly => 
                         assembly.ManifestModule.Name != "<In Memory Module>"
                     && !assembly.FullName.StartsWith("mscorlib") 
                     && !assembly.FullName.StartsWith("System")
                     && !assembly.FullName.StartsWith("Microsoft")).ToList();
            foreach (Assembly mappingAssembly in allAssemblies)
            {
                // find all types that derive from ClassMap<>
                IList<Type> types = mappingAssembly.GetTypes().Where(t =>
                       t != typeof(AutoMapping<>)
                    && t.BaseType != null
                    && t.BaseType.IsGenericType
                    && t.BaseType.GetGenericTypeDefinition() == typeof(ClassMap<>)).ToList();

                // if there are any, we add their assembly
                if (types.Count > 0)
                {
                    fluentConfiguration = fluentConfiguration.Mappings(m => m.FluentMappings.AddFromAssembly(mappingAssembly));
                }
            }

            try
            {
                configuration = fluentConfiguration
                    .ExposeConfiguration(cfg =>
                        {
                            if (schemaUpdate)
                            {
                                new SchemaUpdate(cfg)
                                    .Execute(false, true);
                            }
                            else
                            {
                                new SchemaExport(cfg)
                                    .Create(false, true);
                            }
                        })
                    .BuildConfiguration();
            }
            catch (FluentConfigurationException fluentEx)
            {
                if (fluentEx.InnerException != null)
                {
                    if (fluentEx.InnerException is HibernateException)
                    {
                        if (fluentEx.InnerException.Message.Contains("Table") && fluentEx.InnerException.Message.Contains("already exists"))
                        {
                            TechnicalProblemException tpEx = new TechnicalProblemException("Error building FluentNHibernate configuration. Try dropping and re-creating database schema.", fluentEx);
                            Log.Fatal(tpEx.ToString());
                            throw tpEx;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                TechnicalProblemException tpEx = new TechnicalProblemException("Error building FluentNHibernate configuration.", ex);
                Log.Fatal(tpEx.ToString());
                throw tpEx;
            }
            NHibernatePersistenceServices nhPersistenceService = new NHibernatePersistenceServices(configuration);
            persistenceService = nhPersistenceService as IPersistenceServices;
            transactionService = nhPersistenceService as ITransactionServices;
            conversationFactory = persistenceService as IConversationFactory;
        }
        public SendungsanfrageRepository(IPersistenceServices persistenceService)
        {
            Check.Argument(persistenceService != null, "persistenceService != null");

            this.persistenceService = persistenceService;
        }
Esempio n. 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlaylistItemsController" /> class.
 /// </summary>
 /// <returns></returns>
 public PlaylistItemsController(IPersistenceServices services)
 {
     _services = services;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FilesController" /> class.
 /// </summary>
 /// <param name="services">An object that defines application-level services.</param>
 public FilesController(IPersistenceServices services)
 {
     _services = services;
 }
        /// <summary>
        /// Creates a simple MySQL persistence with one conversation per transaction.
        /// </summary>
        /// <param name="persistenceService">Reference to persistence service.</param>
        /// <param name="transactionService">Reference to transaction service.</param>
        public static void CreateSimpleMySQLPersistenceService(
            out IPersistenceServices persistenceService, 
            out ITransactionServices transactionService)
        {
            IConversationFactory conversationFactory;

            PersistenceServicesFactory.CreatePersistenceService(
               PersistenceServicesFactory.PersistenceServiceType.MySQL,
               false,
               out persistenceService,
               out transactionService,
               out conversationFactory);

            // forget the conversationFactory
        }
 public SendungRepository(IPersistenceServices persistenceService)
 {
     this.persistenceService = persistenceService;
 }