Exemplo n.º 1
0
        private void submitBtn_Click(object sender, EventArgs e)
        {
            //The "Submit" button will create a Container and Item object for each Item the user wants to store. Each Item object is
            //stored within the associated Container object.
            Container container;
            Item      item;

            container = new Container(double.Parse(widthText.Text), double.Parse(lengthText.Text), double.Parse(heightText.Text));
            item      = new Item(nameText.Text, int.Parse(quantityText.Text), double.Parse(weightText.Text));
            container.addItem(item);
            contList.Add(container);
            itemList.Add(item);

            //Flag variable for the number of Items the user wishes to enter.
            numOfItems--;

            //If the number of items left to enter is more than zero, create a new version of the same Form and prompt the
            //user for the information for their next Item.
            if (numOfItems != 0)
            {
                newCustItemForm newForm = new newCustItemForm(numOfItems, contList, itemList, customer);
                newForm.Show();
                this.Hide();
            }
            else
            {
                //If all Items have been entered, pass all applicable information and create the Main Customer Portal Form.
                mainCustScreen mainScreen = new mainCustScreen(customer, contList, itemList);
                mainScreen.Show();
                this.Hide();
            }
        }
Exemplo n.º 2
0
        private void submitBtn_Click(object sender, EventArgs e)
        {
            Container container = new Container();

            for (int i = 0; i < int.Parse(quantityText.Text); i++)
            {
                Item item = new Item(nameText.Text, int.Parse(lengthText.Text), int.Parse(widthText.Text), int.Parse(heightText.Text), int.Parse(quantityText.Text), double.Parse(weightText.Text));
                container.addItem(item);
            }

            contList.Add(container);

            itemList = container.getItemList();

            for (int i = 0; i < itemList.Count(); i++)
            {
                MessageBox.Show(itemList[i].ToString());
            }

            numOfItems--;

            if (numOfItems != 0)
            {
                newCustItemForm newForm = new newCustItemForm(numOfItems, itemList, contList, customer);
                newForm.Show();
                this.Close();
            }
            else
            {
                mainCustScreen mainScreen = new mainCustScreen(customer, contList);
                mainScreen.Show();
                this.Close();
            }
        }
Exemplo n.º 3
0
        private void backBtn_Click(object sender, EventArgs e)
        {
            //The "Back" button takes the user back to the Main Customer Portal screen.

            mainCustScreen mainScreen = new mainCustScreen(customer);

            mainScreen.Show();
            this.Hide();
        }
Exemplo n.º 4
0
        private void submitBtn_Click(object sender, EventArgs e)
        {
            if (!fNameText.Text.Equals("") || !lNameText.Text.Equals(""))
            {
                string firstName = fNameText.Text;
                string lastName  = lNameText.Text;

                new DBConnect(out connection);
                DBQueries dbQ = new DBQueries();

                Customer cus = dbQ.getCustomer(connection, firstName, lastName);

                mainCustScreen mainScreen = new mainCustScreen(cus);
                mainScreen.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Error: please fill out the fields with correct information.");
            }
        }