/// <summary> /// event handler for opening the saved form /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _savedOrderButton_Click(object sender, EventArgs e) { this.Hide(); ProductInfoForm productInfoForm = new ProductInfoForm(); productInfoForm.Show(); }
/// <summary> /// Send the product selected to the Product Info Form /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void NextButton_Click(object sender, EventArgs e) { ProductInfoForm productInfo = new ProductInfoForm(_selectedComputer, this); productInfo.Show(); this.Hide(); }
// Go to the product info form private void btn_loadOrder_Click(object sender, EventArgs e) { this.Hide(); ProductInfoForm productInfoForm = new ProductInfoForm(); productInfoForm.previousForm = this; productInfoForm.Show(); }
//Shows next form private void NextButton_Click(object sender, EventArgs e) { ProductInfoForm info = new ProductInfoForm(); info.previousForm = this; this.Hide(); info.Show(); }
/// <summary> /// when the next button is pressed the select form is hidden and the productinfo form is opened /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _nextButton_Click(object sender, EventArgs e) { // Instantiate the next form ProductInfoForm productInfoForm = new ProductInfoForm(); // pass a reference from the current form to the next form productInfoForm.previousForm = this; productInfoForm.Show(); this.Hide(); }
// open product info form and the open file dialog private void btnOpenSaved_Click(object sender, EventArgs e) { SelectForm selectForm = new SelectForm(); ProductInfoForm productInfoForm = new ProductInfoForm(); productInfoForm.previousForm = selectForm; this.Hide(); productInfoForm.Show(); productInfoForm.OpenFile(btnOpenSaved, e); }
// go to the next form private void btnNext_Click(object sender, EventArgs e) { // instantiate next form ProductInfoForm productInfoForm = new ProductInfoForm(); productInfoForm.previousForm = this; // hide this form and show next form this.Hide(); productInfoForm.Show(); }
/// <summary> /// event handler to generate the next form and close this one /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _nextButton_Click(object sender, EventArgs e) { //1. intantiate ProductInfoForm productInfoForm = new ProductInfoForm(); //2. pass a reference productInfoForm.firstForm = this; _storingValue(); productInfoForm.Show(); this.Hide(); productInfoForm.storedValues(); }
/// <summary> /// Opens a file dialog box for the user to select a previous order /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LoadOrderButton_Click(object sender, EventArgs e) { OpenFileDialog file = new OpenFileDialog(); file.InitialDirectory = Directory.GetCurrentDirectory(); DialogResult result = file.ShowDialog(); if (result != DialogResult.Cancel) { try { StreamReader sr = new StreamReader(file.FileName); ProductInfoForm pif = new ProductInfoForm(toProduct(sr)); pif.Show(); this.Hide(); } catch (Exception) { Debug.WriteLine("File is invalid"); } } }
/// <summary> /// event handler to back to the productInfoForm /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _backButton_Click(object sender, EventArgs e) { secondForm.Show(); this.Hide(); }
// Go back to the product info form private void btn_back_Click(object sender, EventArgs e) { previousForm.Show(); this.Close(); }
/// <summary> /// this method allows the user to go back to the previous form with their previously selected item loaded /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _back_Click(object sender, EventArgs e) { previousForm.Show(); this.Hide(); }
// return to previous form private void Back(object sender, EventArgs e) { this.Hide(); previousForm.Show(); }