/// <summary>
 /// Opens productInfo form
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void nextButton_Click(object sender, EventArgs e)
 {
     if (productInfo == null)
     {
         this.productInfo = new productInfo();
     }
     productInfo.setPrevForm(this);
     productInfo.setComputerInfo(computerInfo);
     productInfo.Show();
     this.Hide();
 }
 /// <summary>
 /// Sets the product info form
 /// </summary>
 /// <param name="productInfo"></param>
 public void setProductInfo(productInfo productInfo)
 {
     this.productInfo = productInfo;
 }
Example #3
0
        /// <summary>
        /// open load file dialog and load a saved order
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void loadButton_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = openFileDialog.ShowDialog();
            if (dialogResult != DialogResult.Cancel)
            {
                try
                {
                    StreamReader fileReader = new StreamReader(
                        openFileDialog.FileName
                    );

                    String fileCheck = fileReader.ReadLine();

                    if (fileCheck.Equals(FILECHECK))
                    {
                        String productID = fileReader.ReadLine();
                        productID = productID.Substring(8);

                        int prodID;
                        if(int.TryParse(productID, out prodID))
                        {
                            if (productInfo == null)
                            {
                                productInfo = new productInfo();
                            }
                            productInfo.setProductID(prodID);
                            productInfo.setPrevForm(this);
                            productInfo.Show();
                            this.Hide();
                        }
                    }
                }
                catch(IOException err)
                {
                    System.Diagnostics.Debug.Write(err.Message);
                }
            }
        }