예제 #1
0
        private void detailsButton_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedCells.Count <= 0)
            {
                return;
            }
            int row_index = dataGridView1.SelectedCells[0].RowIndex;

            if (this.procedurename == "SearchInBatch")
            {
                Display_Batch f = new Display_Batch((dataGridView1.Rows[row_index].DataBoundItem as DataRowView).Row);
                f.Show();
            }
            else if (this.procedurename == "SearchInCarton")
            {
                Display_Carton f = new Display_Carton((dataGridView1.Rows[row_index].DataBoundItem as DataRowView).Row);
                f.Show();
            }
            else if (this.procedurename == "SearchInCartonProduced")
            {
                Display_Carton_Produced f = new Display_Carton_Produced((dataGridView1.Rows[row_index].DataBoundItem as DataRowView).Row);
                f.Show();
            }
            else if (this.procedurename == "SearchInTray")
            {
                Display_Tray f = new Display_Tray((dataGridView1.Rows[row_index].DataBoundItem as DataRowView).Row);
                f.Show();
            }
        }
예제 #2
0
 private void detailsButton_Click(object sender, EventArgs e)
 {
     //view details form or details
     if (this.dataGridView0.SelectedRows.Count != 0)
     {
         if (this.dgvstates[0] == 1)
         {
             Display_Carton dc = new Display_Carton((dataGridView0.Rows[dataGridView0.SelectedRows[0].Index].DataBoundItem as DataRowView).Row);
             dc.Show();
         }
         else
         {
             dataGridView0.DataSource = this.to_show_details[0];
             this.dgvstates[0]        = 1;
             set_details_column_widths(0);
         }
     }
     else if (this.dataGridView2.SelectedRows.Count != 0)
     {
         if (this.dgvstates[2] == 1)
         {
             Display_Tray dt = new Display_Tray((dataGridView2.Rows[dataGridView2.SelectedRows[0].Index].DataBoundItem as DataRowView).Row);
             dt.Show();
         }
         else
         {
             dataGridView2.DataSource = this.to_show_details[2];
             this.dgvstates[2]        = 1;
             set_details_column_widths(2);
         }
     }
     else if (this.dataGridView3.SelectedRows.Count != 0)
     {
         if (this.dgvstates[3] == 1)
         {
             Display_Batch db = new Display_Batch((dataGridView3.Rows[dataGridView3.SelectedRows[0].Index].DataBoundItem as DataRowView).Row);
             db.Show();
         }
         else
         {
             dataGridView3.DataSource = this.to_show_details[3];
             this.dgvstates[3]        = 1;
             set_details_column_widths(3);
         }
     }
     else if (this.dataGridView4.SelectedRows.Count != 0)
     {
         if (this.dgvstates[4] == 1)
         {
             Display_Batch db = new Display_Batch((dataGridView4.Rows[dataGridView4.SelectedRows[0].Index].DataBoundItem as DataRowView).Row);
             db.Show();
         }
         else
         {
             dataGridView4.DataSource = this.to_show_details[4];
             this.dgvstates[4]        = 1;
             set_details_column_widths(4);
         }
     }
     else if (this.dataGridView5.SelectedRows.Count != 0)
     {
         if (this.dgvstates[5] == 1)
         {
             DataRow row = (dataGridView5.Rows[dataGridView5.SelectedRows[0].Index].DataBoundItem as DataRowView).Row;
             M_V3_cartonProductionForm f = new M_V3_cartonProductionForm(row, false, new M_V_history(1));
             f.deleteButton.Visible = false;
             f.Show();
         }
         else
         {
             dataGridView5.DataSource = this.to_show_details[5];
             set_details_column_widths(5);
             this.dgvstates[5] = 1;
         }
     }
     else if (this.dataGridView6.SelectedRows.Count != 0)
     {
         if (this.dgvstates[6] == 1)
         {
             Display_Carton_Produced dcp = new Display_Carton_Produced((dataGridView6.Rows[dataGridView6.SelectedRows[0].Index].DataBoundItem as DataRowView).Row);
             dcp.Show();
         }
         else
         {
             dataGridView6.DataSource = this.to_show_details[6];
             set_details_column_widths(6);
             this.dgvstates[6] = 1;
         }
     }
 }