Exemplo n.º 1
0
 private void NewCustomerButton_Click(object sender, EventArgs e)
 {
     if (customerInfoForm == null || customerInfoForm.IsDisposed)
     {
         customerInfoForm = new CustomerInformation(0);
     }
     customerInfoForm.Show();
     customerInfoForm.BringToFront();
 }
Exemplo n.º 2
0
 //open new customer form to add a new customer
 private void btnAddNewCustomer_Click(object sender, EventArgs e)
 {
     if (newCustomer == null || newCustomer.IsDisposed)
     {
         newCustomer = new CustomerInformation(0);
     }
     newCustomer.Show();
     newCustomer.BringToFront();
 }
Exemplo n.º 3
0
        //get value of selected entry, used to open a new window to the info based on the search
        private void ViewInfoButton_Click(object sender, EventArgs e)
        {
            //opens to customer info
            if (cUSTOMERDataGridView.Visible == true)
            {
                int row       = cUSTOMERDataGridView.CurrentRow.Index;
                int pCustomer = (int)cUSTOMERDataGridView[0, row].Value;

                if (customerInfoForm == null || IsDisposed)
                {
                    customerInfoForm = new CustomerInformation(pCustomer);
                }
                customerInfoForm.Show();
                customerInfoForm.BringToFront();
            }
            //opens to show info
            else if (sHOWDataGridView.Visible == true)
            {
                int row   = sHOWDataGridView.CurrentRow.Index;
                int pShow = (int)sHOWDataGridView[0, row].Value;

                if (showForm == null || IsDisposed)
                {
                    showForm = new NewShow(pShow);
                }
                showForm.Show();
                showForm.BringToFront();
            }
            //opens to order info unless search was done by customer, which opens customers order history
            else if (oRDERSDataGridView.Visible == true)
            {
                int row = oRDERSDataGridView.CurrentRow.Index;
                if (SearchByComboBox.SelectedIndex == 5)
                {
                    int pCustomer = (int)oRDERSDataGridView[6, row].Value;

                    if (customerPurchases == null || IsDisposed)
                    {
                        customerPurchases = new CustomerPurchases(pCustomer);
                    }
                    customerPurchases.Show();
                    customerPurchases.BringToFront();
                }
                else
                {
                    int pOrder = (int)oRDERSDataGridView[0, row].Value;

                    if (orderForm == null || IsDisposed)
                    {
                        orderForm = new NewOrder(pOrder);
                    }
                    orderForm.Show();
                    orderForm.BringToFront();
                }
            }
            //opens customer info
            else //(receivablesQueryDataGridView.Visible == true)
            {
                int row       = receivablesQueryDataGridView.CurrentRow.Index;
                int pCustomer = (int)receivablesQueryDataGridView[0, row].Value;

                if (customerInfoForm == null || IsDisposed)
                {
                    customerInfoForm = new CustomerInformation(pCustomer);
                }
                customerInfoForm.Show();
                customerInfoForm.BringToFront();
            }
        }