Example #1
0
        private void btnEditPrmtr_Click(object sender, EventArgs e)
        {
            try
            {
                if (myPrmtrPID != -1)    //140530_3
                {
                    PNInfo.myTestPrmtrISNewFlag = false;
                    TestParameterInfo myTestParameterInfo = new TestParameterInfo();
                    if (myPrmtrPID == -1)
                    {
                        myTestParameterInfo.myPrmtrPID = Convert.ToInt64(this.dgvTestModel.CurrentRow.Cells["ID"].Value);
                    }
                    else
                    {
                        myTestParameterInfo.myPrmtrPID = myPrmtrPID;
                    }

                    myTestParameterInfo.ItemName = PNInfo.getDTColumnInfo(PNInfo.TopoToatlDS.Tables["TopoTestModel"], "ItemName", "ID=" + myPrmtrPID);

                    myTestParameterInfo.ShowDialog();
                }
                else
                {
                    MessageBox.Show("请选择TestModel后再点击按钮!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Example #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                bool result = EditInfoForDT(PNInfo.TopoToatlDS.Tables["TopoTestModel"]);

                if (result)
                {
                    PNInfo.ISNeedUpdateflag     = true;  //140603_2
                    PNInfo.myTestModelISNewFlag = false; //140530_2
                    btnNextPage.Enabled         = true;
                    PNInfo.myTestModelAddOKFlag = true;  //140530_0
                    //if (blnAddNewModel)   //140530_1
                    if (PNInfo.myTestModelAddOKFlag == true)
                    {
                        if (blnAddNewModel) //140703_2 若为新增Model则强制维护TestParameter >>>
                        {
                            TestParameterInfo myTestParameterInfo = new TestParameterInfo();
                            myTestParameterInfo.ItemName   = currlst.SelectedItem.ToString();
                            myTestParameterInfo.myPrmtrPID = Convert.ToInt64(PNInfo.getDTColumnInfo(PNInfo.TopoToatlDS.Tables[3], "ID", "ItemName = '" + currlst.SelectedItem.ToString() + "' and PID=" + this.PID));
                            myPrmtrPID  = myTestParameterInfo.myPrmtrPID;
                            myModelName = myTestParameterInfo.ItemName;
                            myTestParameterInfo.blnAddNew = true;
                            //新增Model 对应的Prmtr的PID部分相互处理 //140529 OK
                            myTestParameterInfo.ShowDialog();

                            if (PNInfo.currPrmtrCountExisted(PNInfo.TopoToatlDS.Tables["TopoTestParameter"], "PID=" + myPrmtrPID)
                                == PNInfo.currPrmtrCountExisted(PNInfo.GlobalTotalDS.Tables["GlobalTestModelParamterList"], "PID=" + myGlobalModelID)
                                )
                            {
                                blnAddNewModel              = false; //140527_00
                                btnAdd.Enabled              = true;
                                currlst.Enabled             = true;
                                PNInfo.myTestPrmtrISNewFlag = false;        //140530_2
                                //this.Close(); //140530_4 //140703_2
                            }
                            else
                            {
                                MessageBox.Show("未发现Topo表中有当前选择Model的参数与Global参数一致,资料丢失!不允许保存! \n 系统将自动删除未完成的TestModel", "注意!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                deleteNewModelONErr(); //140530_3 TBD?
                            }
                        }                              //140703_2 若为新增Model则强制维护TestParameter <<<
                    }
                    //this.Close();   //140530_3 //140703_2
                }
                else
                {
                    btnNextPage.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }