Exemple #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmAddOrder form = new frmAddOrder(null);

            form.Show();

            this.Hide();
        }
        private void btnBack_Click(object sender, EventArgs e)
        {
            formHasLoaded = false;

            frmAddOrder form = new frmAddOrder(clientIDNumber);

            form.Show();

            this.Hide();
        }
Exemple #3
0
        private void btnAddClient_Click(object sender, EventArgs e)
        {
            Address address = null;

            address = new Address(txtCity.Text, txtSuburb.Text, txtStreet.Text, txtPort.Text);

            Client client = new Client();

            if (chkContract.Checked == true)
            {
                string maintenancePlan = null;
                char   priority        = '\0';

                maintenancePlan = cbxMaintenance.Text.ToString();

                if (cbxPriority.Text != string.Empty)
                {
                    priority = char.Parse(cbxPriority.Text);
                }
                else
                {
                    priority = '\0';
                }

                client = new Client(txtID.Text, null, txtName.Text, txtSurname.Text, txtContactNumber.Text, txtEmailAddress.Text, address, maintenancePlan, priority);
            }
            else
            {
                client = new Client(txtID.Text, null, txtName.Text, txtSurname.Text, txtContactNumber.Text, txtEmailAddress.Text, address, null);
            }

            if (_ValidationMethods.isValid)
            {
                if (client.SaveClientToDB())
                {
                    if (FormState.PreviousPage.GetType().ToString() == "SHS.frmAddOrder")
                    {
                        frmAddOrder form = new frmAddOrder(client.ID);
                        form.Show();
                    }
                    else
                    {
                        FormState.PreviousPage.Show();
                    }

                    this.Hide();
                }
            }
        }
        private void btnAddProduct_Click(object sender, EventArgs e)
        {
            if (!alreadyAdded)
            {
                Product product = products[cbxProduct.SelectedIndex];
                product.Components = currentComponents;

                Order.productsToOrder.Add(product);

                formHasLoaded = false;

                frmAddOrder form = new frmAddOrder(clientIDNumber);
                form.Show();

                this.Hide();
            }
        }
        private void btnAddPackage_Click(object sender, EventArgs e)
        {
            if (!alreadyAdded)
            {
                foreach (Product product in productsInPackage)
                {
                    Order.productsToOrder.Add(product);
                }

                formHasLoaded = false;

                frmAddOrder form = new frmAddOrder(clientIDNumber);
                form.Show();

                this.Hide();
            }
        }