private void dgvOrders_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int      orderNo   = Convert.ToInt32((this.dgvOrderHistory.Rows[e.RowIndex].Cells["OrderNo"].Value).ToString());
            NewOrder showOrder = new NewOrder(0);

            showOrder.Show();
        }
Exemple #2
0
 private void NewOrderButton_Click(object sender, EventArgs e)
 {
     if (newOrderForm == null || newOrderForm.IsDisposed)
     {
         newOrderForm = new NewOrder(0);
     }
     newOrderForm.Show();
     newOrderForm.BringToFront();
 }
 //double click on order cell
 private void dgvOrders_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     //display order info if in data row
     if (e.RowIndex >= 0)
     {
         int orderNo = Convert.ToInt32((this.dgvOrders.Rows[e.RowIndex].Cells["OrderNo"].Value).ToString());
         if (showOrder == null || showOrder.IsDisposed)
         {
             showOrder = new NewOrder(orderNo);
         }
         showOrder.Show();
     }
 }
Exemple #4
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();
            }
        }