Пример #1
0
        private void dgvTestModel_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                if (dgvTestModel.CurrentRow != null && dgvTestModel.CurrentRow.Index != -1 && e.RowIndex != -1) //140714_0
                {
                    currTestModelIndex = e.RowIndex;                                                            // Convert.ToInt32(dgvTestModel.Rows[e.RowIndex].Cells["id"].Value);

                    myPrmtrPID = PNInfo.getNextPIDFromdgv(dgvTestModel, currTestModelIndex);
                    PNInfo.showTablefilterStrInfo(PNInfo.TopoToatlDS.Tables["TopoTestParameter"], dgvTestPrmtr, "PID=" + this.myPrmtrPID);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Пример #2
0
        private void dgvTestCtrl_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                if (dgvTestCtrl.CurrentRow != null && dgvTestCtrl.CurrentRow.Index != -1 && e.RowIndex != -1)  //140714_0
                {
                    if (!blnAddNewCtrl)
                    {
                        currTestCtrlIndex = e.RowIndex;
                        if (dgvTestCtrl.Rows.Count > 0)
                        {
                            myModelPID = PNInfo.getNextPIDFromdgv(dgvTestCtrl, currTestCtrlIndex);
                            PNInfo.showTablefilterStrInfo(PNInfo.TopoToatlDS.Tables["TopoTestModel"], dgvTestModel, "PID=" + this.myModelPID);
                            crpTestModel.Enabled = true;
                            showBtns(0, true);
                        }
                        else
                        {
                            showBtns(0, false);
                            crpTestModel.Enabled = false;
                            grpTestPrmtr.Enabled = false;
                        }

                        if (dgvTestModel.Rows.Count > 0)
                        {
                            myPrmtrPID = Convert.ToInt64(this.dgvTestModel.Rows[0].Cells["ID"].Value);
                            PNInfo.showTablefilterStrInfo(PNInfo.TopoToatlDS.Tables["TopoTestParameter"], dgvTestPrmtr, "PID=" + this.myPrmtrPID);
                            grpTestPrmtr.Enabled = true;
                            showBtns(1, true);
                            showBtns(2, true);
                            DataGridViewCell cell = dgvTestModel.Rows[0].Cells["SEQ"];
                            dgvTestModel.CurrentCell = cell;
                        }
                        else
                        {
                            grpTestPrmtr.Enabled = false;
                            showBtns(1, false);
                            showBtns(2, false);
                            this.dgvTestPrmtr.DataSource = null;
                        }
                    }
                    else
                    {
                        if (dgvTestCtrl.Rows.Count > 0)
                        {
                            currTestCtrlIndex = dgvTestCtrl.Rows.Count - 1;
                            myModelPID        = PNInfo.getNextPIDFromdgv(dgvTestCtrl, currTestCtrlIndex);
                            PNInfo.showTablefilterStrInfo(PNInfo.TopoToatlDS.Tables["TopoTestModel"], dgvTestModel, "PID=" + this.myModelPID);
                            crpTestModel.Enabled = true;
                            showBtns(0, true);
                        }
                        else
                        {
                            crpTestModel.Enabled = false;
                            grpTestPrmtr.Enabled = false;
                            showBtns(0, false);
                        }

                        if (dgvTestModel.Rows.Count > 0)
                        {
                            myPrmtrPID = PNInfo.mylastIDTestModel + 1;
                            PNInfo.showTablefilterStrInfo(PNInfo.TopoToatlDS.Tables["TopoTestParameter"], dgvTestPrmtr, "PID=" + this.myPrmtrPID);
                            grpTestPrmtr.Enabled = true;
                            showBtns(1, true);
                            showBtns(2, true);
                        }
                        else
                        {
                            grpTestPrmtr.Enabled = false;
                            showBtns(1, false);
                            showBtns(2, false);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }