Example #1
0
        private string CHECK_SN(string DATA, out string ESN)
        {
            string sColnum = string.Empty;
            string StrErr  = string.Empty;

            ESN = string.Empty;
            if (rdesn.Checked)
            {
                sColnum = "ESN";
            }
            if (rdIMEI.Checked)
            {
                sColnum = "IMEI";
            }

            DataTable dt = ReleaseData.arrByteToDataTable(tWipTrack.GetQueryWipAllInfo(sColnum, DATA));

            if (dt.Rows.Count > 0)
            {
                if (tb_wo.Text == dt.Rows[0]["WOID"].ToString())
                {
                    if (dt.Rows[0]["ERRFLAG"].ToString() != "0")
                    {
                        StrErr = "SN IN REPAIR";
                    }
                    else
                    {
                        if (dt.Rows[0]["SCRAPFLAG"].ToString() != "0")
                        {
                            StrErr = "SN HAS SCRAP";
                        }
                        else
                        {
                            StrErr = "OK";
                            ESN    = dt.Rows[0]["ESN"].ToString();
                        }
                    }
                }
                else
                {
                    StrErr = "WO Different";
                }
            }
            else
            {
                StrErr = "NO SN";
            }

            SendMsg(StrErr == "OK" ? mLogMsgType.Normal : mLogMsgType.Error, string.Format("SN : {0}", StrErr));
            return(StrErr);
        }
Example #2
0
        private void tb_sn_KeyDown(object sender, KeyEventArgs e)
        {
            if ((!string.IsNullOrEmpty(tb_sn.Text)) && (e.KeyCode == Keys.Enter))
            {
                try
                {
                    if (string.IsNullOrEmpty(EmpNo))
                    {
                        string Msg = "Emp Format Error";
                        try
                        {
                            string PWD = tb_sn.Text.Split('-')[1];
                            Msg = "Emp No Data";
                            DataTable dt = ReleaseData.arrByteToDataTable(tuser.GetUserInfoByUserId(tb_sn.Text.Split('-')[0]));
                            if (dt.Rows.Count != 0)
                            {
                                if (PWD != dt.Rows[0]["pwd"].ToString())
                                {
                                    SendPrgMsg(mLogMsgType.Error, "NO EMP");
                                }
                                else
                                {
                                    SendPrgMsg(mLogMsgType.Incoming, "EMP OK");
                                    EmpNo = tb_sn.Text.Split('-')[0];
                                }
                            }
                            else
                            {
                                SendPrgMsg(mLogMsgType.Error, "NO USER EMP");
                            }
                        }
                        catch
                        {
                            SendPrgMsg(mLogMsgType.Error, "人员权限格式错误--" + Msg);
                        }
                    }
                    else
                    {
                        string InputData = tb_sn.Text.Trim();
                        if (InputData == "UNDO")
                        {
                            tb_wo.Enabled        = true;
                            imbt_ChgLine.Visible = true;
                            tb_wo.Text           = "";
                            tb_Partnumber.Text   = "";
                            tb_Inputqty.Text     = "0";
                            tb_TargetQty.Text    = "0";
                            EmpNo   = string.Empty;
                            sSQLMAC = string.Empty;
                            sSQLSN  = string.Empty;
                            SendPrgMsg(mLogMsgType.Normal, "清除完成,切换工单.....");
                        }
                        else
                        {
                            if (chkimei.Checked)
                            {
                                DataTable dtImei = ReleaseData.arrByteToDataTable(twip.GetQueryWipAllInfo("IMEI", InputData));
                                if (dtImei.Rows.Count > 0)
                                {
                                    InputData = dtImei.Rows[0]["ESN"].ToString();
                                }
                                else
                                {
                                    SendPrgMsg(mLogMsgType.Error, "IMEI 没有找到");
                                    return;
                                }
                            }

                            #region 增加存储过程参数
                            if (!CHECK_PRODUCT_LINE())
                            {
                                return;
                            }

                            string flag = "0";
                            if (radmobile.Checked)
                            {
                                flag = "1";
                            }
                            Dictionary <string, object> dic = new Dictionary <string, object>();
                            dic.Add("DATA", InputData);
                            dic.Add("EMP", EmpNo);
                            dic.Add("MODEL", tb_Partnumber.Text.Trim());
                            dic.Add("WO", tb_wo.Text.Trim());
                            dic.Add("LINE", LabLine.Text);
                            dic.Add("FLAG", flag);
                            string sMsg = PubStor.ExecuteProcedure("PRO_TEST_REWORK_INPUT", GenericUtil.MapListConverter.DictionaryToJson(dic));
                            #endregion

                            if (sMsg == "OK")
                            {
                                SendPrgMsg(mLogMsgType.Incoming, string.Format("SN: [{0}] {1}", InputData, sMsg));
                                tb_Inputqty.Text = (int.Parse(tb_Inputqty.Text) + 1).ToString();
                            }
                            else
                            {
                                SendPrgMsg(mLogMsgType.Error, string.Format("SN: [{0}] {1}", InputData, sMsg));
                            }
                            sSQLMAC = string.Empty;
                            sSQLSN  = string.Empty;
                        }
                    }
                }
                catch (Exception ex)
                {
                    SendPrgMsg(mLogMsgType.Error, "程序异常-->" + ex.Message);
                }
                finally
                {
                    tb_sn.Text = "";
                }
            }
        }
Example #3
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 = "";
                }
            }
        }