コード例 #1
0
        private void ExitBtn_Click(object sender, EventArgs e)
        {
            HomeScreen HS = new HomeScreen();

            HS.Show();
            this.Close();
        }
コード例 #2
0
        private void tmProgress_Tick(object sender, EventArgs e)
        {
            I += 5;

            try
            {
                if (I >= 100)
                {
                    mSys_System.Set_blnLoginOk(true);
                    tmProgress.Stop();
                    this.Hide();
                    frmHome.lblUsername.Caption     = mSys_System.pUserName;
                    frmHome.lblBranch_SName.Caption = mSys_System.pBranch_SName;
                    frmHome.Show();
                }

                // pBar.Value = I;

                if (I >= 100)
                {
                    tmProgress.Stop();
                }
            }
            catch (Exception ex)
            {
                tmProgress.Stop();
                this.Hide();
                XtraMessageBox.Show("The application is unable to load. Please start application again.........................", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
        private void USCancelBtn_Click(object sender, EventArgs e)
        {
            Form Home = new HomeScreen();

            Home.Show();
            this.Close();
        }
コード例 #4
0
        private void showHomeScreen()
        {
            var homeScreen = new HomeScreen();

            this.MainWindow = homeScreen;
            homeScreen.Show();
            //var SearchScreen = new Search_Temp();
            //SearchScreen.Show();
        }
コード例 #5
0
        public void ShowHome(Window window)
        {
            HomeScreen homeScreen = new HomeScreen();

            homeScreen.Show();
            if (window != null)
            {
                window.Close();
            }
        }
コード例 #6
0
        public void OpenJobRequestWindow()
        {
            MainWindow mainWindow = new MainWindow();

            mainWindow.Hide();
            HomeScreen homescreen = new HomeScreen();

            homescreen.Closed += (s, args) => mainWindow.Close();
            homescreen.Show();
        }
コード例 #7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var value            = ConfigurationManager.AppSettings["ShowSplashScreen"];
            var showSplashScreen = bool.Parse(value);

            if (showSplashScreen == false)
            {
                var homeScreen = new HomeScreen();
                this.MainWindow = homeScreen;
                homeScreen.Show();
            }
            else
            {
                //initialize the splash screen and set it as the application main window
                var splashScreen = new GUI.SplashScreen();
                this.MainWindow = splashScreen;
                splashScreen.Show();

                //in order to ensure the UI stays responsive, we need to
                //do the work on a different thread
                Task.Factory.StartNew(() =>
                {
                    //we need to do the work in batches so that we can report progress
                    for (var i = 1; i <= 100; i++)
                    {
                        //simulate a part of work being done
                        System.Threading.Thread.Sleep(30);

                        //because we're not on the UI thread, we need to use the Dispatcher
                        //associated with the splash screen to update the progress bar
                        splashScreen.Dispatcher.Invoke(() => splashScreen.Progress = i);
                    }

                    //once we're done we need to use the Dispatcher
                    //to create and show the main window
                    this.Dispatcher.Invoke(() =>
                    {
                        //initialize the main window, set it as the application main window
                        //and close the splash screen
                        var homeScreen  = new HomeScreen();
                        this.MainWindow = homeScreen;
                        homeScreen.Show();
                        splashScreen.Close();
                    });
                });
            }
        }
コード例 #8
0
        private void LoginAction()
        {
            ConnectionClass.ConnectToDB();
            ConnectionClass cc     = new ConnectionClass(iU.Text, iP.Password);
            bool            isNext = cc.Login();
            HomeScreen      g      = new HomeScreen(iU.Text);

            g.onThisClose += G_onThisClose;
            if (isNext)
            {
                g.Show();
                Visibility = Visibility.Hidden;
                iU.Text    = ""; iP.Password = "";
            }
        }
コード例 #9
0
        private void PlayBtn_Click(object sender, EventArgs e)
        {
            if (TrackResultsLbx.SelectedIndex != -1)
            {
                Track selected_track = searchResults.ElementAt(TrackResultsLbx.SelectedIndex);
                Session.NowPlaying    = selected_track;
                Session.isTrackLoaded = true;

                HomeScreen HS = new HomeScreen();
                HS.Show();
                this.Close();
                MEF.loadMusic();
            }
            else
            {
                MessageBox.Show("No track selected.", "Error");
            }
        }
コード例 #10
0
        private void continue_Click(object sender, RoutedEventArgs e)
        {
            Properties.Settings.Default.projectDiameter    = false;
            Properties.Settings.Default.projectWeb         = false;
            Properties.Settings.Default.projectTension     = false;
            Properties.Settings.Default.projectTransmitter = false;
            Properties.Settings.Default.Save();


            if (diameter.IsChecked == true)
            {
                Properties.Settings.Default.projectDiameter = true;
                MainPage mainPage = new MainPage();
                mainPage.Show();
            }
            else if (web.IsChecked == true)
            {
                HomeScreen homeScreen = new HomeScreen();
                homeScreen.Show();
            }
            else if (tension.IsChecked == true)
            {
                Properties.Settings.Default.projectTension = true;
                MainWindow mainWindow = new MainWindow();
                mainWindow.Show();
            }
            else if (transmitter.IsChecked == true)
            {
                Properties.Settings.Default.projectTransmitter = true;
                WindowMain mainWindow = new WindowMain();
                mainWindow.Show();
            }

            Properties.Settings.Default.signedIn      = true;
            Properties.Settings.Default.userFirstTime = false;
            Properties.Settings.Default.Save();
            this.Close();
        }
コード例 #11
0
        /// <summary>
        /// Defines the method to be called when the command is invoked.
        /// </summary>
        /// <param name="parameter">Data used by the command.  If the command does not require data to be passed, this object can be set to null.</param>
        public void Execute(object parameter)
        {
            MainWindowViewModel viewModel = parameter as MainWindowViewModel;

            if (viewModel == null)
            {
                return;
            }

            if (viewModel.Name == "ep" && viewModel.Password == "pass")
            {
                MessageBox.Show("namd and Pw accepted");

                //open new page
                var HomeScreen = new HomeScreen();
                HomeScreen.Show();
            }
            else
            {
                //deny access
                MessageBox.Show("Incorrect username and password");
            }
        }
コード例 #12
0
 private void openSelectedProject()
 {
     if (Properties.Settings.Default.projectDiameter)
     {
         MainPage mainPage = new MainPage();
         mainPage.Show();
     }
     else if (Properties.Settings.Default.projectWeb)
     {
         HomeScreen homeScreen = new HomeScreen();
         homeScreen.Show();
     }
     else if (Properties.Settings.Default.projectTension)
     {
         MainWindow mainWindow = new MainWindow();
         mainWindow.Show();
     }
     else if (Properties.Settings.Default.projectTransmitter)
     {
         WindowMain mainWindow = new WindowMain();
         mainWindow.Show();
     }
     welcomeScreen.Close();
 }
コード例 #13
0
        private void Login(object obj)
        {
            try
            {
                con = new OracleConnection(connectionString);
                con.Open();
                OracleDataReader reader;
                cmd    = new OracleCommand($"Select *from Customer where Customer_ID='{Convert.ToInt32(Customer_ID)}' and Password='******'", con);
                reader = cmd.ExecuteReader();
                if (reader.Read())
                {
                    //MessageBox.Show(Convert.ToInt32(reader.GetValue(0)) + " , " + reader.GetString(1));
                    Application.Current.Properties["Cust_Name"] = reader.GetValue(2);

                    MessageBox.Show("Login Successful");
                    //It should be xaml not view model
                    HomeScreen          hs   = new HomeScreen();
                    HomeScreenViewModel hsvm = new HomeScreenViewModel(reader.GetValue(2).ToString(), Customer_ID);
                    hs.DataContext = hsvm;
                    hs.Show();
                }
                else
                {
                    MessageBox.Show("Invalid Id or Password");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            finally
            {
                con.Close();
                con.Dispose();
            }
        }
コード例 #14
0
 private void OnWelcomeScreenClosed()
 {
     Home.Show();
 }
コード例 #15
0
        private void btnLogIn_Click(object sender, EventArgs e)
        {
            var HomeScreen = new HomeScreen();

            HomeScreen.Show();
        }