コード例 #1
0
        private void SelectAnotherProductButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            SelectForm SF = new SelectForm();

            SF.Show();
        }
コード例 #2
0
        private void StartNewOrderButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            SelectForm SF = new SelectForm();

            SF.Show();
        }
コード例 #3
0
        //EVENT HANDLERS-------------------------
        /// <summary>
        /// this method helps users can select product from db
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _clickStartNewOrderButton(object sender, EventArgs e)
        {
            SelectForm select = new SelectForm();

            this.Hide();
            select.Show();
        }
コード例 #4
0
        /// <summary>
        /// Select another product button click event handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SelectButton_Click(object sender, EventArgs e)
        {
            SelectForm mySelectForm = new SelectForm();

            mySelectForm.Show();
            this.Close();
        }
コード例 #5
0
        private void SelectAnotherProductButton_Click(object sender, EventArgs e)
        {
            SelectForm selectForm = new SelectForm();


            selectForm.Show();
            this.Hide();
        }
コード例 #6
0
        //button to start a new order
        private void _NewOrderButton_Click(object sender, EventArgs e)
        {
            SelectForm selectForm = new SelectForm();

            selectForm.PreviousForm = this;
            selectForm.Show();
            this.Hide();
        }
コード例 #7
0
        private void AnotherProductButton_Click(object sender, System.EventArgs e)
        {
            SelectForm form = new SelectForm();

            form.Show();
            form.previousForm = this;
            form.DisplayProduct();
            this.Hide();
        }
コード例 #8
0
        private void StartNewOrderButton_Click(object sender, EventArgs e)
        {
            //opening select form when start button is clicked
            SelectForm selectForm = new SelectForm();

            selectForm.previousForm = this;
            selectForm.Show();
            this.Hide();
        }
コード例 #9
0
        private void ButtonNewOrder_Click(object sender, System.EventArgs e)
        {
            // Switch forms
            SelectForm selectForm = new SelectForm();

            selectForm.previousForm = this;
            selectForm.Show();
            this.Hide();
        }
コード例 #10
0
        private void selectAnotherProductToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SelectForm selectForm = new SelectForm();

            //Save a reference to the current form in a property of the nextForm
            //Show the next Form
            selectForm.Show();
            //Hide this form!
            this.Hide();
        }
コード例 #11
0
        private void Select_button_Click(object sender, EventArgs e)
        {
            SelectForm selectForm = new SelectForm();

            //Save a reference to the current form in a property of the nextForm
            //Show the next Form
            selectForm.Show();
            //Hide this form!
            this.Hide();
        }
コード例 #12
0
        /// <summary>
        /// This method handles all the button clicks and perform their case accordingly
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _buttonClickHandler(object sender, EventArgs e)
        {
            Button ClickHandler = sender as Button;

            switch (ClickHandler.Tag.ToString())
            {
            /// Shows the selection form and hide start form
            case "New":
                // Instantiate an object to the next form
                SelectForm selectForm = new SelectForm();

                // Pass a reference to the current form to the next form
                selectForm.startForm = this;

                // Show the next form
                selectForm.Show();

                // Hide the form
                this.Hide();
                break;

            /// Shows the ProductInfoForm and hide current form
            case "Open":
                // Instantiate an object to the next form
                ProductInfoForm productInfoForm = new ProductInfoForm(null);

                // Pass a reference to the current form to the next form
                productInfoForm.startForm = this;

                // Show the next form
                productInfoForm.Show();

                // Hide the form
                this.Hide();
                break;

            /// Ask confirmation message to exit if OK
            case "Exit":
                // showing up confirm message when cancel button clicked
                DialogResult result = MessageBox.Show("Are You Sure you want to exit?", "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

                // Closes the program if OK clicked
                if (result == DialogResult.OK)
                {
                    Application.Exit();
                }
                break;
            }
        }
コード例 #13
0
        /// <summary>
        /// This event handler handles all button clicks
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _buttonClickHandler(object sender, EventArgs e)
        {
            Button ClickHandler = sender as Button;

            switch (ClickHandler.Tag.ToString())
            {
            case "Another":
                // Instantiate an object to the next form
                SelectForm selectForm = new SelectForm();

                // Pass a reference to the current form to the next form
                selectForm.productInfoForm = this;

                // Show the next form
                selectForm.Show();

                // Hide the form
                this.Hide();
                break;

            case "Cancel":
                // showing up confirm message when cancel button clicked
                DialogResult result = MessageBox.Show("Are You Sure you want to exit?", "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

                // Closes the program if OK clicked
                if (result == DialogResult.OK)
                {
                    Application.Exit();
                }
                break;

            case "Next":
                // Instantiate an object to the next form
                OrderForm orderForm = new OrderForm(_productDetails);

                // Pass a reference to the current form to the next form
                orderForm.productInfoForm = this;

                // Show the next form
                orderForm.Show();

                // Hide the form
                this.Hide();
                break;
            }
        }
コード例 #14
0
        // Click event handler for the buttons on the StartForm
        private void _StartFormButtonClickHandler(Object sender, EventArgs e)
        {
            // cast the sender object to type Button
            Button buttonClicked = sender as Button;

            switch (buttonClicked.Tag.ToString())
            {
            case "new order":
                // create an instance of the SelectForm
                SelectForm selectForm = new SelectForm();

                // hide the StartForm
                this.Hide();

                // show the SelectForm
                selectForm.Show();

                break;

            case "saved order":
                // create an instance of the ProductInfoForm
                ProductInfoForm productInfoForm = new ProductInfoForm(null);

                // hide the StartForm
                this.Hide();

                // show the ProductInfoForm
                productInfoForm.Show();

                break;

            case "exit":
                // exit the application

                // confirm the closure
                DialogResult result = MessageBox.Show("Are you sure you want to exit the application?", "Confirm Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (result == DialogResult.Yes)
                {
                    Application.Exit();
                }

                break;
            }
        }
コード例 #15
0
        // Shared click event handler for Select Another product
        private void _SelectAnotherProduct(Object sender, EventArgs e)
        {
            // if the SelectForm's reference has been defined, i.e., the ProductInfoForm was generated from the SelectForm
            if (selectForm != null)
            {
                // show the previously hidden selectForm
                selectForm.Show();

                // Close this ProductInfoForm, since a new ProductInfoForm will be generated through the SelectForm
                this.Close();
            }
            else
            {
                // else is selectForm == null; therefore the ProductInfoForm was created directly from the StartForm
                // instantiate a new instance of the SelectForm
                selectForm = new SelectForm();

                // show the new select form
                selectForm.Show();

                // Close this ProductInfoForm, since a new ProductInfoForm will be generated through the SelectForm
                this.Close();
            }
        }
コード例 #16
0
 /// <summary>
 /// This method shows selectForm when users click selectanotherproductbutton or menu
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void _clickSelectAnotherProduct(object sender, EventArgs e)
 {
     this.Hide();
     previousForm.Show();
 }
コード例 #17
0
 /// <summary>
 /// Handler for clic start new order button event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void StartButton_Click(object sender, EventArgs e)
 {
     mySelectForm.previousForm = this;
     this.Hide();         // Hide current form
     mySelectForm.Show(); // show next form
 }
コード例 #18
0
 private void BackButton_Click(object sender, EventArgs e)
 {
     previousForm.ComputerSpecs = computerSpecs;
     this.Hide();
     previousForm.Show();
 }