Beispiel #1
0
        //NEW 10-06
        //完成订单 修改状态
        public void FinishOrder(SalesOrder salesOrder, InstallView installView, bool state)
        {
            if (salesOrder.StateVal == "已出库")
            {
                try
                {
                    SQLiteConnection con = new SQLiteConnection(@"Data Source=SQL\GREE.db");

                    con.Open();
                    string sql = "UPDATE main.SalesOrder SET "
                                 + "state='已完成' "
                                 + "WHERE subunitNumber=" + salesOrder.SNVal + ";";

                    SQLiteCommand command = new SQLiteCommand(sql, con);
                    command.ExecuteNonQuery();
                    command.Dispose();
                    con.Close();
                    func.MessageBox_InstallView(installView, state);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                MessageBox.Show("该订单未出库或未选择行,请您核对", "错误提示", MessageBoxButton.OK);
            }
        }
    protected override void Run()
    {
        Dispatcher = Dispatcher.CurrentDispatcher;
        var model   = new BootstrapperApplicationModel(this);
        var command = model.BootstrapperApplication.Command;

        if (command.Action == LaunchAction.Uninstall && (command.Display == Display.None || command.Display == Display.Embedded))
        {
            model.LogMessage("Starting silent uninstaller.");
            var viewModel = new SilentUninstallViewModel(model, Engine);
            Engine.Detect();
        }
        else
        {
            model.LogMessage("Starting installer.");
            var viewModel = new InstallViewModel(model);
            var view      = new InstallView(viewModel);
            view.Closed += (sender, e) => Dispatcher.InvokeShutdown();
            model.SetWindowHandle(view);
            Engine.Detect();
            view.Show();
        }
        Dispatcher.Run();
        Engine.Quit(model.FinalResult);
    }
        protected override void Run()
        {
            Dispatcher = Dispatcher.CurrentDispatcher;
            var model     = new BootstrapperApplicationModel(this);
            var viewModel = new InstallViewModel(model);

            view    = new InstallView(viewModel);
            restreq = new restart();
            model.SetWindowHandle(view);
            this.Engine.Detect();
            view.Show();
            Dispatcher.Run();
            this.Engine.Quit(model.FinalResult);
        }
 void NextButton(object parameter)
 {
     if (parameter == null) return;
     if (Directory.Exists(parameter.ToString()))
     {
         var wnd = new InstallView(null);
         wnd.Show();
         CloseWindow();
     }
     else if (!Directory.Exists(parameter.ToString()) && !string.IsNullOrEmpty(parameter.ToString()))
     {
      Location = Directory.CreateDirectory(parameter.ToString()).FullName;
      var wnd = new InstallView(null);
      wnd.Show();
      CloseWindow();
     }
 }
Beispiel #5
0
        //This is our UI's primary entry point. This method will be called by the Burn engine.
        protected override void Run()
        {
            //Dispatcher object provides a means for sending messages between the UI thread and any backend threads.
            Dispatcher = Dispatcher.CurrentDispatcher;

            //MVVM pattern
            var model     = new BootstrapperApplicationModel(this);
            var viewModel = new InstallViewModel(model);
            var view      = new InstallView(viewModel);

            // Sets the handle for a Windows Presentation Foundation (WPF) window.
            // This handle is used by the Burn engine when performing the install or uninstall.
            model.SetWindowHandle(view);

            //This will start the Burn engine. engine will go-ahead to check if our bundle is already installed.
            this.Engine.Detect();

            //This code is to wait for a second before closing our flash screen. Otherwise the WPF window will load very fast.
            var timer = new DispatcherTimer {
                Interval = TimeSpan.FromSeconds(1)
            };

            timer.Start();
            timer.Tick += (sender, args) =>
            {
                model.LogMessage("Time elapsed.Loading the window");
                timer.Stop();
                view.Show();
            };

            //This event is fired when the window is loaded. Here we are closing the flash screen.
            view.Loaded += (sender, e) =>
            {
                model.LogMessage("FrameworkElement loaded event fired.");
                model.CustomBootstrapperApplication.Engine.CloseSplashScreen();
            };

            //halts execution of this method at that line until the Dispatcher is shut down.
            Dispatcher.Run();

            //shut down the Burn engine
            this.Engine.Quit(model.FinalResult);
        }
        public HiddenView()
        {
            var startupMode = (Application.Current as App).StartupMode;
            ////////////////////////////
            //startupMode = "Update";
            ///////////////////////////
            if (!string.IsNullOrEmpty(startupMode) && startupMode.Equals("Update"))
            {
                var wnd = new InstallView(startupMode);
                wnd.Show();
            }
            else
            {
                var wnd = new PickLocation();
                wnd.Show();
            }

            InitializeComponent();
            this.Close();
        }
Beispiel #7
0
 //InstallView 消息框
 public void MessageBox_InstallView(InstallView install, bool state)
 {
     install.message.IsActive = state;
 }