コード例 #1
0
        public ActionResult GenerateJournal(FormCollection Form)
        {
            Journal            journal         = (Journal)Session["Journal"];
            List <Transaction> transactionList = (List <Transaction>)Session["TransactionList"];

            ServiceFactory.GetJournalServices().Insert(journal);
            ITransactionServices       tranService   = ServiceFactory.GetTransactionServices();
            ITransactionDetailServices detailService = ServiceFactory.GetTransactionDetailServices();

            foreach (Transaction t in transactionList)
            {
                t.JournalId = journal.Id;
                tranService.Update(t);
                List <TransactionDetail> detail = (List <TransactionDetail>)detailService.GetAll(t.Id);
                foreach (TransactionDetail d in detail)
                {
                    d.JournalId = t.JournalId;
                    detailService.Update(d);
                }
            }
            Session["Journal"]         = null;
            Session["TransactionList"] = null;

            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public FusionController(IConfiguration configuration, ITransactionServices transactionServices, IStringLocalizer <FusionController> localizer, IMapper mapper)
 {
     _configuration       = configuration;
     _transactionServices = transactionServices;
     _localizer           = localizer;
     _mapper = mapper;
 }
コード例 #3
0
 public UsersController(IUserServices userServices,
                        IAccountServices accountServices,
                        ICategoryServices categoryServices,
                        ITransactionServices transactionServices,
                        IBudgetServices budgetServices,
                        IHttpContextProvider context,
                        ISiteConfiguration config,
                        ICryptoProvider crypto,
                        IUrlHelper urlHelper,
                        IModelCache cache,
                        ICachingHelpers cachingHelpers,
                        ISessionServices sessionServices)
     : base(userServices,
                                                                 accountServices,
                                                                 categoryServices,
                                                                 transactionServices, 
                                                                 budgetServices,
                                                                 context,
                                                                 config,
                                                                 urlHelper,
                                                                 cache,
                                                                 cachingHelpers)
 {
     _crypto = crypto;
     _sessionServices = sessionServices;
 }
コード例 #4
0
 public PermissionsController(
     IMailingHistoryService mailingHistoryService,
     IMciRequestService mciRequestService,
     IClientScopeService clientScopeService,
     ILog logger,
     IPermissionService permissionService,
     IMembershipService membershipService,
     ICustomerDetailsService customerDetailsService,
     ITransactionServices transactionServices,
     ICustomerMatchService customerMatchService,
     ITravelSummaryService travelSummaryService,
     IIndex <GetRequestProcessImplementations, IGetRequestProcess> strategyProcesses
     )
 {
     _mailingHistoryService = mailingHistoryService;
     _mciRequestService     = mciRequestService;
     _clientScopeService    = clientScopeService;
     _logger                 = logger;
     _permissionsService     = permissionService;
     _membershipService      = membershipService;
     _customerDetailsService = customerDetailsService;
     _transactionServices    = transactionServices;
     _customerMatchService   = customerMatchService;
     _travelSummaryService   = travelSummaryService;
     _logParameterValue      = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableObjectDump"]);
     _strategyProcesses      = strategyProcesses;
 }
コード例 #5
0
        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;
        }
コード例 #6
0
 public TransactionProcess(WebApiServices.Models.Transaction.TransactionParamter transaction,
                           ITransactionServices transactionServices, ILog logger)
 {
     _transaction         = transaction;
     _transactionServices = transactionServices;
     _logger = logger;
 }
コード例 #7
0
 public SimulatorOfTrading(IUsersService usersService, IUserTableRepository userRepo, IPortfolioServices portfolio, ITransactionServices transaction)
 {
     this.usersService     = usersService;
     this.userRepo         = userRepo;
     this.portfolioService = portfolio;
     this.transaction      = transaction;
 }
コード例 #8
0
 public CompareController(IConfiguration configuration, ITransactionServices transactionServices, IStringLocalizer <CompareController> localizer, IMapper mapper, ICategoryServices categoryServices)
 {
     _configuration       = configuration;
     _transactionServices = transactionServices;
     _localizer           = localizer;
     _mapper           = mapper;
     _categoryServices = categoryServices;
 }
コード例 #9
0
 public DealController(IUsersService usersService, IUserTableRepository userRepo, IPortfolioServices portfolio, ITransactionServices transaction, IShareServices shareServices)
 {
     this.usersService     = usersService;
     this.userRepo         = userRepo;
     this.portfolioService = portfolio;
     this.transaction      = transaction;
     this.shareServices    = shareServices;
 }
        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;
        }
コード例 #11
0
        public void Setup()
        {
            _transactionBusinessLogic = new Mock <ITransactionBusinessLogic>();
            _transactionBusinessLogic.Setup(x => x.GetAll()).Verifiable();
            _transactionBusinessLogic.Setup(x => x.GetByCriteria(It.IsAny <ITransactionCriteria>())).Verifiable();
            _transactionBusinessLogic.Setup(x => x.Add(It.IsAny <ITransaction>())).Verifiable();

            _transactionServices = new TransactionServices(_transactionBusinessLogic.Object);
        }
 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); 
 }
コード例 #13
0
 public MainPage(Container container, IIOProvider iOProvider, IPhraseProvider phraseProvider)
 {
     this.iOProvider          = iOProvider;
     this.phraseProvider      = phraseProvider;
     this.shareServices       = container.GetInstance <ShareProxy>();
     this.usersService        = container.GetInstance <UsersProxy>();
     this.transactionServices = container.GetInstance <TransactionProxy>();
     this.portfolioServices   = container.GetInstance <PortfolioProxy>();
     this.simulator           = container.GetInstance <SimulatorOfTrading>();
 }
コード例 #14
0
        public void TestClean()
        {
            this.customerRepository    = null;
            this.transactionRepository = null;
            this.accountService        = null;

            this.transactionServices = null;

            this.transactionController = null;
        }
コード例 #15
0
        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();
        }
コード例 #16
0
        public TransactionServicesTests()
        {
            var fileServiceMock = new Mock <IFileService>();

            fileServiceMock
            .Setup(f => f.Read(It.IsAny <string>()))
            .ReturnsAsync(FakerUtils.StringResponseFaker.Generate())
            .Verifiable();

            _transactionServices = new TransactionServices(fileServiceMock.Object);
        }
コード例 #17
0
        public void TestInitialization()
        {
            this.customerRepository    = Substitute.For <ICustomerRepository>();;
            this.transactionRepository = Substitute.For <ITransactionRepository>();;
            this.accountService        = Substitute.For <IAccountService>();

            this.transactionLogger = Substitute.For <ILogger <TransactionController> >();
            this.serviceLogger     = Substitute.For <ILogger <TransactionServices> >();

            this.transactionServices   = new TransactionServices(this.transactionRepository, this.accountService, this.serviceLogger);
            this.transactionController = new TransactionController(this.transactionServices, this.transactionLogger);
        }
コード例 #18
0
        public HomePageViewModel()
        {
            //Initial
            _userService         = new UserService();
            _transactionServices = new TransactionServices();
            Email    = App.Email;
            Greeting = CheckDatetime();
            FullName = App.FirstName + " " + App.LastName;

            //Command
            ScanToPayCommand   = new Command(ScanToPay);
            ScanToTopupCommand = new Command(ScanToTopup);
        }
コード例 #19
0
 public AdminController(IWebHostEnvironment environment, ICardServices cardServices, ICategoryServices categoryServices,
                        IUserServices userServices, IPaymentServices paymentServices, IFeedbackServices feedbackServices,
                        ISubscribleServices emailListServices, ITransactionServices transactionServices)
 {
     _hostingEnvironment  = environment;
     _categoryServices    = categoryServices;
     _cardServices        = cardServices;
     _userServices        = userServices;
     _paymentServices     = paymentServices;
     _feedbackServices    = feedbackServices;
     _emailListServices   = emailListServices;
     _transactionServices = transactionServices;
 }
        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);
        }
コード例 #21
0
 public HomeController(
     IUserManager <User> userManager,
     ITransactionServices transactionServices,
     IUserServices userServices,
     ISlotGamesServices slotGameServices,
     IJsonConverter jsonConverter)
 {
     this.jsonConverter       = jsonConverter;
     this.userManager         = userManager;
     this.userServices        = userServices ?? throw new System.ArgumentNullException(nameof(userServices));
     this.transactionServices = transactionServices;
     this.slotGameServices    = slotGameServices;
 }
コード例 #22
0
        public TopUpViewModel()
        {
            //Initial
            _transactionServices = new TransactionServices();
            GetDetail();

            //Command
            CancelCommand         = new Command(Cancel);
            BackToHomeCommand     = new Command(BackToHome);
            TopUpCommand          = new Command(TopUp);
            FullName              = App.FirstName + " " + App.LastName;
            CustomerAccountNumber = App.Account;
            ToSlip = new Command(PushToTopupSlip);
        }
コード例 #23
0
 public UserController(ICardServices cardServices,
                       IUserServices userServices,
                       IPaymentServices paymentServices,
                       IFeedbackServices feedbackServices,
                       ISubscribleServices emailListServices,
                       ITransactionServices transactionServices)
 {
     _cardServices        = cardServices;
     _userServices        = userServices;
     _paymentServices     = paymentServices;
     _feedbackServices    = feedbackServices;
     _emailListServices   = emailListServices;
     _transactionServices = transactionServices;
 }
コード例 #24
0
 public TransactionController(ITransactionServices transactionServices,
                              IConfiguration configuration,
                              IStringLocalizer <TransactionController> localizer,
                              IMapper mapper,
                              ICategoryServices categoryServices,
                              IFileService fileService)
 {
     _transactionServices = transactionServices;
     _configuration       = configuration;
     _localizer           = localizer;
     _mapper           = mapper;
     _categoryServices = categoryServices;
     _fileService      = fileService;
 }
コード例 #25
0
 public ManageController(
     UserManager <User> userManager,
     SignInManager <User> signinManager,
     ITransactionServices transactionServices,
     IUserServices userServices,
     IBankDetailsServices bankDetailsServices,
     IUserBankDetailsServices userBankDetailsServices)
 {
     this.userBankDetailsServices = userBankDetailsServices;
     this.userManager             = userManager;
     this.signinManager           = signinManager;
     this.userServices            = userServices;
     this.transactionServices     = transactionServices;
     this.bankDetailsServices     = bankDetailsServices;
 }
コード例 #26
0
 public PaymentPageViewModel()
 {
     GetTotalBalance();
     //Initial
     _transactionServices = new TransactionServices();
     CreateDate           = DateTime.Now;
     //Command
     CancelCommand       = new Command(Cancel);
     BackToHomeCommand   = new Command(BackToHome);
     PaymentCommand      = new Command(Payment);
     InputPaymentCommand = new Command(InputPayment);
     ToSlip   = new Command(PushToSlip);
     FullName = App.FirstName + " " + App.LastName;
     CustomerAccountNumber = App.Account;
 }
コード例 #27
0
        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;
        }
        public TransportplanungKomponenteBusinessLogic(TransportplanRepository tp_REPO, ITransactionServices transactionService, IAuftragServicesFürTransportplanung auftragServices, IUnterbeauftragungServicesFürTransportplanung unterbeauftragungServices, ITransportnetzServicesFürTransportplanung transportnetzServices, ITimeServices timeServices)
        {
            Check.Argument(tp_REPO != null, "tp_REPO != 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");
            Check.Argument(timeServices != null, "timeServices != null");

            this.tp_REPO = tp_REPO;
            this.transactionService = transactionService;
            this.auftragServices = auftragServices;
            this.unterbeauftragungServices = unterbeauftragungServices;
            this.transportnetzServices = transportnetzServices;
            this.timeServices = timeServices;
            this.planungsQueue = new BackgroundQueue();
        }
コード例 #29
0
        public ActionResult DeleteConfirm(Journal j)
        {
            ITransactionServices service = ServiceFactory.GetTransactionServices();

            if (j.LedgerId != 0)
            {
                ServiceFactory.GetLedgerServices().Delete(j.LedgerId);
            }

            List <Transaction> tList = (List <Transaction>)ServiceFactory.GetTransactionServices().GetByJournal(j.Id);

            foreach (Transaction t in tList)
            {
                t.JournalId = 0;
                service.Update(t);
            }
            ServiceFactory.GetJournalServices().Delete(j.Id);
            return(RedirectToAction("Index"));
        }
コード例 #30
0
        public AdminTransactionViewModel()
        {
            //Initial
            _transactionService = new TransactionServices();
            Email         = App.Email;
            FullName      = App.AdminName;
            AccountNumber = App.Account;
            CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
            LastestMonth          = DateTime.Now;
            Transactionlist       = new List <TransactionViewModel>();
            FirstTransactionList  = new List <TransactionViewModel>();
            SecondTransactionList = new List <TransactionViewModel>();
            ThridTransactionList  = new List <TransactionViewModel>();


            //Command
            ViewTransactionDetailCommand = new Command <int>(ViewTransactionDetail);
            BackButtonCommand            = new Command(BackButton);
        }
コード例 #31
0
 public BaseController(IUserServices userServices,
                       IAccountServices accountServices,
                       ICategoryServices categoryServices,
                       ITransactionServices transactionServices,
                       IBudgetServices budgetServices,
                       IHttpContextProvider context,
                       ISiteConfiguration config,
                       IUrlHelper urlHelper,
                       IModelCache cache,
                       ICachingHelpers cachingHelpers)
 {
     _userServices = userServices;
     _accountServices = accountServices;
     _categoryServices = categoryServices;
     _transactionServices = transactionServices;
     _budgetServices = budgetServices;
     _context = context;
     _config = config;
     _url = urlHelper;
     _cache = cache;
     _cachingHelpers = cachingHelpers;
 }
コード例 #32
0
        public ActionResult DeleteWithoutRollBack(int id)
        {
            ITransactionServices       transactionService = ServiceFactory.GetTransactionServices();
            ITransactionDetailServices detailService      = ServiceFactory.GetTransactionDetailServices();

            Transaction t = transactionService.Get(id);

            if (t.JournalId != 0)
            {
                ServiceFactory.GetJournalServices().Delete(t.JournalId);
            }

            List <TransactionDetail> detail = (List <TransactionDetail>)detailService.GetAll(t.Id);
            List <int> accId = new List <int>();

            foreach (TransactionDetail d in detail)
            {
                accId.Add(d.AccountId);
                detailService.Delete(d.Id);
            }
            transactionService.Delete(t.Id);
            return(View(accId));
        }
コード例 #33
0
 public CustomerController(
     IMailingHistoryService mailingHistoryService,
     IMciRequestService mciRequestService,
     IClientScopeService clientScopeService,
     ILog logger,
     IPermissionService permissionService,
     IMembershipService membershipService,
     ICustomerDetailsService customerDetailsService,
     ITransactionServices transactionServices,
     ICustomerMatchService customerMatchService,
     ITravelSummaryService travelSummaryService,
     IGmdToAfeService gmdToAfeService,
     IAfeWebApiClient afeWebClient,
     IIndex <GetRequestProcessImplementations, IGetRequestProcess> strategyProcesses,
     IIndex <StrategyWriterPartImplementations, IStrategyWriterPart <MembershipDataInput, int, int, MembershipDetails> > membershipDetailsWriterParts,
     IIndex <StrategyWriterPartImplementations, IStrategyWriterPart <MembershipDataInput, int, int, string> > membershipWriterParts,
     IMapper mapper
     )
 {
     _mailingHistoryService = mailingHistoryService;
     _mciRequestService     = mciRequestService;
     _clientScopeService    = clientScopeService;
     _logger                       = logger;
     _permissionsService           = permissionService;
     _membershipService            = membershipService;
     _customerDetailsService       = customerDetailsService;
     _transactionServices          = transactionServices;
     _customerMatchService         = customerMatchService;
     _travelSummaryService         = travelSummaryService;
     _gmdToAfeService              = gmdToAfeService;
     _logParameterValue            = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableObjectDump"]);
     _strategyProcesses            = strategyProcesses;
     _membershipWriterParts        = membershipWriterParts;
     _membershipDetailsWriterParts = membershipDetailsWriterParts;
     _afeWebClient                 = afeWebClient;
     _mapper                       = mapper;
 }
コード例 #34
0
 public iBankController(ICustomerServices customerServices, ITransactionServices transactionServices, ILogger <iBankController> logger)
 {
     _customerServices    = customerServices;
     _transactionServices = transactionServices;
     _logger = logger;
 }
コード例 #35
0
 public TransactionController(ITransactionServices tranService, ICustomAuthorization customAuth)
 {
     _customAuth  = customAuth;
     _tranService = tranService;
 }
コード例 #36
0
        /// <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
        }
コード例 #37
0
        /// <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;
        }
コード例 #38
0
 public ServicesController(ITransactionServices transactionServices, IBetServices betServices, IRoomServices roomServices)
 {
     _transactionServices = transactionServices;
     _betServices         = betServices;
     _roomServices        = roomServices;
 }
コード例 #39
0
 public TransactionsController(ITransactionServices transactionServices)
 {
     _transactionServices = transactionServices;
 }
コード例 #40
0
 public TransactionController(ITransactionServices transactionService)
 {
     this._transactionService = transactionService;
 }
コード例 #41
0
 public UploadController(IHostingEnvironment env, ITransactionServices transactionService, IMapper mapper)
 {
     _appEnvironment         = env;
     _mapper                 = mapper;
     this.transactionService = transactionService;
 }
コード例 #42
0
 public CachingTransactionServices(ITransactionServices nonCachingTransactionServices, IModelCache cache, ICachingHelpers helpers)
     : base(cache, helpers)
 {
     _transactionServices = nonCachingTransactionServices;
 }