Exemple #1
0
        private void GetStationList()
        {
            this.Invoke(new EventHandler(delegate
            {
                Dictionary <string, object> dic = new Dictionary <string, object>();

                DataTable dt  = ReleaseData.arrByteToDataTable(craft.Get_Craft_Info(MapListConverter.DictionaryToJson(dic)));
                DataView dv   = dt.DefaultView;
                dv.Sort       = "craftname Asc";
                DataTable dt2 = dv.ToTable();

                foreach (DataRow dr in dt2.Rows)
                {
                    if (dr["TESTFLAG"].ToString() == "0" || dr["TESTFLAG"].ToString() == "3")
                    {
                        cbroute.Items.Add(dr["craftname"].ToString());
                    }
                }
                if (cbroute.Items.Count > 0)
                {
                    cbroute.SelectedIndex = 0;
                }
            }));
        }
Exemple #2
0
        private void tbInputData_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                tbInputData.SelectAll();
                if (!string.IsNullOrEmpty(tbInputData.Text))
                {
                    InputData = tbInputData.Text.Trim().ToUpper();
                    if (chkimei.Checked)
                    {
                        DataTable dtImei = ReleaseData.arrByteToDataTable(twip.GetQueryWipAllInfo("IMEI", InputData));
                        if (dtImei.Rows.Count > 0)
                        {
                            InputData = dtImei.Rows[0]["ESN"].ToString();
                        }
                        else
                        {
                            ShowMessage("没有IMEI信息", "", "");
                            return;
                        }
                    }
                }

                if (InputData == "UNDO")
                {
                    cbline.Text  = "";
                    cbroute.Text = "";
                    // cbwo.Text = "";
                    cbprocedures.Text = "";
                    PalConfig.Visible = true;
                    tbMessage.Size    = new Size(380, this.PalData.Size.Height - 60);
                    ExeSp             = 1;
                    btsetup.Enabled   = false;
                }
                else
                if (InputData == "CLEAR")
                {
                    for (int i = 0; i < SysAllData.Rows.Count; i++)
                    {
                        if (SysAllData.Rows[i]["InRam"].ToString() != "1")
                        {
                            SysAllData.Rows[i]["data"] = "NA";
                        }
                    }
                }
                else
                {
                    if (PalConfig.Visible)
                    {
                        tbMessage.Text = "请先设置选项";
                        return;
                    }

                    SendRS232 = null;
                    InputDataExecuteSp(InputData);
                    ExeSp++;
                    ShowMessage(SpRes, getNewTable(dtSp, string.Format("StoredprocIdx='{0}'", ExeSp)).Rows[0][11].ToString() + "?", InputData + "  " + SpRes);//PARAM
                    if (!string.IsNullOrEmpty(SendRS232))
                    {
                        SendMsgToCom(SendRS232);
                    }
                    tbInputData.Text = "";
                }
            }
        }