//Double click on show data cell
 private void dgvShows_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     //if in a data cell
     if (e.RowIndex >= 0)
     {
         //get show information
         int      showNo   = Convert.ToInt32((this.dgvShows.Rows[e.RowIndex].Cells["ShowNo"].Value).ToString());
         string   showName = (this.dgvShows.Rows[e.RowIndex].Cells["ShowName"].Value).ToString();
         DateTime showDate = Convert.ToDateTime((this.dgvShows.Rows[e.RowIndex].Cells["ShowDate"].Value).ToString());
         //if from new order, pass in show info to new order parent
         if (parent.GetType() == typeof(NewOrder))
         {
             ((NewOrder)parent).getShow(showNo, showName, showDate);
             this.Close();
         }
         //display show info form
         else
         {
             if (showShow == null || showShow.IsDisposed)
             {
                 showShow = new NewShow(showNo);
             }
             showShow.Show();
         }
     }
 }
示例#2
0
 // this is acutallynew show named wrong fix later
 private void NewShowButton_Click(object sender, EventArgs e)
 {
     if (newShowForm == null || newShowForm.IsDisposed)
     {
         newShowForm = new NewShow(0);
     }
     newShowForm.Show();
     newShowForm.BringToFront();
 }
示例#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();
            }
        }