示例#1
0
        /// <summary>
        /// Startup method for the application.
        /// </summary>
        /// <param name="e">The arguments sent with the event.</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            LogFactory.Configure("cash.log", true);
            IDatabaseInitializer <CashRegisterContext> seed;

            // Empty
            seed = null;

            // Kalle Seed
            // seed = new CashProductInitializer();

            // Lærke Seed
            seed = new FullProductInitializer();

            using (var contex = new CashRegisterContext(seed))
            {
                contex.Database.Initialize(true);
            }

            base.OnStartup(e);
            Window win       = new MainWindow();
            var    salesCtrl = SalesFactory.GuiSalesController;

            win.DataContext = new MainViewModel(salesCtrl);
            win.Show();
        }
示例#2
0
        /// <summary>
        /// Handles the Start event of the application
        /// </summary>
        /// <param name="sender">Sender object</param>
        /// <param name="e">Event arguments</param>
        protected virtual void Application_Start(object sender, EventArgs e)
        {
            // Set the dependency resolver
            IoC.InitializeWith(new DependencyResolverFactory());

            // Register the dependency engines
            this.RegisterDependencyEngines();

            // Initialize the engine context and run the startup tasks
            EngineContext.Initialize(false);

            LogFactory.Configure();

            // Get the current instance of CurrentSession Builder
            ByromSessionBuilderBase builder = this.GetSessionBuilder();

            // Save login framework into Application variable
            HttpContext.Current.Application[WorkContextKeys.SessionBuilderKey] = builder;

            if (SystemSettings.MaintenanceMode)
            {
                SystemApplication fakeSystemApplication = new SystemApplication()
                {
                    ApplicationId = SystemSettings.ApplicationId
                };

                HttpContext.Current.Application[WorkContextKeys.SystemApplicationKey] = fakeSystemApplication;
            }
            else
            {
                HttpContext.Current.Application[WorkContextKeys.SystemApplicationKey] = IoC.Resolve <ISettingService>().Application;
            }
        }
示例#3
0
 static Program()
 {
     LogFactory.Configure("cash.log", true);
 }
示例#4
0
 public void Setup()
 {
     LogFactory.Configure();
 }