示例#1
0
        bool blnIsAddAux = false;   //140811_1

        private void CtrlInfo_Load(object sender, EventArgs e)
        {
            try
            {
                setAuxshow(false);   //140811_1
                RefreshList();
                ShowMyTip();
                this.txtTestPlanName.Text = TestPlanName;

                //140709_1>>>>>>>>>>
                this.cboDataRate.Items.Clear();
                //140811_2 this.txtAuxAttribles.Items.Clear();
                //140811_2 this.txtAuxAttribles.Items.Add("DUT_Soak_Time= 指定值; ReadTempFromXStream= 指定值"); //140606
                DataRow[] drs = PNInfo.TopoToatlDS.Tables["TopoTestControl"].Select("");

                for (int i = 0; i < drs.Length; i++)
                {
                    if (this.cboDataRate.Items.Contains(drs[i]["DataRate"]) == false)
                    {
                        this.cboDataRate.Items.Add(drs[i]["DataRate"]);
                    }

                    if (this.cboChannel.Items.Contains(drs[i]["Channel"]) == false)
                    {
                        this.cboChannel.Items.Add(drs[i]["Channel"]);
                    }

                    if (this.cboPattent.Items.Contains(drs[i]["Pattent"]) == false)
                    {
                        this.cboPattent.Items.Add(drs[i]["Pattent"]);
                    }

                    if (this.cboTemp.Items.Contains(drs[i]["Temp"]) == false)
                    {
                        this.cboTemp.Items.Add(drs[i]["Temp"]);
                    }

                    if (this.cboVcc.Items.Contains(drs[i]["Vcc"]) == false)
                    {
                        this.cboVcc.Items.Add(drs[i]["Vcc"]);
                    }
                }

                //140709_1<<<<<<<<<<

                if (blnAddNew)
                {
                    mySEQ        = (PNInfo.getMAXColumnsItem(PNInfo.TopoToatlDS.Tables["TopoTestControl"], "SEQ", "PID=" + PID) + 1).ToString();
                    myTestCtrlID = (PNInfo.mylastIDTestCtrl + 1).ToString();

                    PNInfo.myTestCtrlAddOKFlag = false;
                    cboItemName.BackColor      = Color.Yellow;
                    currlst.Enabled            = false;
                    btnOK.Enabled = true;
                    PNInfo.myTestCtrlISNewFlag = true;        //140530_2
                }
                else
                {
                    btnOK.Enabled              = false;
                    btnFinish.Enabled          = true;
                    PNInfo.myTestCtrlISNewFlag = false;        //140530_2
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
示例#2
0
        bool EditInfoForDT(DataTable mydt)
        {
            bool result = false;

            try
            {
                string    filterString = this.cboItemName.Text.ToString();
                DataRow[] myROWS       = mydt.Select("ItemName='" + filterString + "' and PID=" + PID + "");
                if (myROWS.Length == 1)
                {
                    if (this.blnAddNewModel)
                    {
                        MessageBox.Show("新增资料有误!请确认!!! 已有" + myROWS.Length + ("条记录; \n 条件--> ItemName='" + filterString + "' and PID=" + PID + ""));
                        return(result);
                    }
                    //无需编辑信息,固定值!
                    //myROWS[0]["ItemName"] = this.cboItemName.Text.ToString();
                    //myROWS[0]["AppModeID"] = this.cboAppModeID.Text.ToString();
                    myROWS[0]["EquipmentList"] = this.txtEquipLst.Text.ToString();
                    result = true;
                }
                else if (this.blnAddNewModel)
                {
                    string  MyNewSEQ = (PNInfo.getMAXColumnsItem(PNInfo.TopoToatlDS.Tables["TopoTestModel"], "SEQ", "PID=" + PID) + 1).ToString();
                    DataRow myNewRow = mydt.NewRow();
                    myNewRow.BeginEdit();
                    myNewRow["ID"]            = PNInfo.mylastIDTestModel + 1;
                    myNewRow["PID"]           = this.PID.ToString();
                    myNewRow["ItemName"]      = this.cboItemName.Text.ToString();
                    myNewRow["AppModeID"]     = this.cboAppModeID.Text.ToString();
                    myNewRow["EquipmentList"] = this.txtEquipLst.Text.ToString();
                    myNewRow["Seq"]           = MyNewSEQ;

                    mydt.Rows.Add(myNewRow);

                    myNewRow.EndEdit();
                    PNInfo.mylastIDTestModel++;
                    PNInfo.myAddCountTestModel++;

                    //RefreshList();
                    int myNewRowIndex = (currlst.Items.Count - 1);
                    if (!currlst.Enabled) //140529 新增TestModel后需要将其参数维护后才能选择!
                    {
                        currlst.Enabled = true;
                        currlst.Focus();
                        currlst.SelectedIndex = myNewRowIndex;
                    }
                    //blnAddNewModel = false;  //140530_1 //140703_2
                    result = true;
                }
                else
                {
                    MessageBox.Show("资料有误!请确认!!! 共有" + myROWS.Length + ("条记录; \n 条件--> ItemName='" + filterString + "' and PID=" + PID + ""));
                }
                return(result);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                return(result);
            }
        }