Esempio n. 1
0
        private void btnNextPage_Click(object sender, EventArgs e)
        {
            try
            {
                if (currlst.SelectedIndex != -1)
                {
                    PNInfo.myTestPlanAddOKFlag = true; //140529_1
                    EquipmentForm myEquip = new EquipmentForm();
                    myEquip.blnAddNew    = blnAddNew;  //140706_1
                    myEquip.TestPlanName = currlst.SelectedItem.ToString();
                    //string filterstring = "Select ID from " + PNInfo.ConstTestPlanTables[1] + " where ItemName='" + myEquip.TestPlanName.Trim() + "' and PID='" + PID + "'";
                    string filterstring = "ItemName='" + myEquip.TestPlanName.Trim() + "' and PID=" + PID + "";
                    myEquip.PID = PNInfo.getNextTablePIDFromDT(PNInfo.TopoToatlDS.Tables[PNInfo.ConstTestPlanTables[1]], filterstring);

                    myEquip.ShowDialog();   //show NextForm...
                }
                else
                {
                    MessageBox.Show("请选择对应项目后再点击按钮!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Esempio n. 2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.PID.ToString().Trim().Length == 0 ||
                    this.cboItemName.Text.ToString().Trim().Length == 0 ||
                    this.cboSWVersion.Text.ToString().Trim().Length == 0 ||
                    this.cboHWVersion.Text.ToString().Trim().Length == 0 ||
                    this.cboUSBPort.Text.ToString().Trim().Length == 0 ||
                    this.cboAuxAttribles.Text.ToString().Trim().Length == 0
                    ) //140606 Add
                {
                    MessageBox.Show("当前部分项目资料为空,请确认后再保存资料!!!");
                    return;
                }

                bool result = EditInfoForDT(PNInfo.TopoToatlDS.Tables[PNInfo.ConstTestPlanTables[1]]);

                if (result)
                {
                    PNInfo.ISNeedUpdateflag = true; //140603_2
                    btnNextPage.Enabled     = true;
                    cboItemName.Enabled     = false;
                    cboItemName.BackColor   = Color.White;  //140709_2

                    if (PNInfo.myTestPlanISNewFlag)
                    {
                        //PNInfo.myTestPlanAddOKFlag = true;
                        EquipmentForm myEquip = new EquipmentForm();
                        myEquip.blnAddNew                = true;
                        PNInfo.myTestEquipAddOKFlag      = false;   //140529_1
                        PNInfo.myTestEquipPrmtrAddOKFlag = false;   //140529_1
                        myEquip.TestPlanName             = currlst.SelectedItem.ToString();
                        //string filterstring = "Select ID from " + PNInfo.ConstTestPlanTables[1] + " where ItemName='" + myEquip.TestPlanName.Trim() + "' and PID='" + PID + "'";
                        string filterstring = "ItemName='" + myEquip.TestPlanName.Trim() + "' and PID=" + PID + "";
                        myEquip.PID = PNInfo.getNextTablePIDFromDT(PNInfo.TopoToatlDS.Tables[PNInfo.ConstTestPlanTables[1]], filterstring);

                        myEquip.ShowDialog();              //show NextForm...
                        blnAddNew = false;
                        PNInfo.myTestPlanAddOKFlag = true; //140530_0
                        this.Close();                      //140530_4
                    }
                    else
                    {
                        PNInfo.myTestPlanAddOKFlag = true; //140530_0
                    }
                }
                else //140604_1
                {
                    btnPreviousPage.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }