Esempio n. 1
0
        /// <summary>
        /// BackGroundWorker Do Work
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void startBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            this.UpperText = "Connecting";
            this.LowerText = "Database";
            Thread.Sleep(1000);
            using (SqlConnection testConnection = new SqlConnection(Properties.Settings.Default.Cafeteria_Vernier_dbConnectionString))
            {
                try
                {
                    testConnection.Open();
                }
                catch
                {
                    this.UpperText = "Connection";
                    this.LowerText = "Fault";
                    Thread.Sleep(1000);
                    new InstallWindow().Show();
                    this.Close();
                    return;
                }
            }
            this.UpperText = "Connecting";
            this.LowerText = "Service";
            Thread.Sleep(2000);
            //Check connection Named pipe service
            this.UpperText = "Retrieving";
            this.LowerText = "Necessary Information";
            Thread.Sleep(2000);
            MiraculousMethods miraculousMethod = new MiraculousMethods();

            miraculousMethod.CheckCashDate();
            this.Dispatcher.BeginInvoke(new Action(() =>
            {
                serverWindow = new MainWindow();

                serverWindow.BillConfigInfo = miraculousMethod.LoadBillConfig();
            }), DispatcherPriority.Normal);

            //
            //
            //miraculousMethod.MinimumRequirement();
        }