示例#1
0
 private void imbt_SelectLine_Click(object sender, EventArgs e)
 {
     string[] EmpData = Input.InputBox.ShowInputBox("输入权限", string.Empty);
     try
     {
         string UserId = EmpData[0];
         string PWD    = EmpData[1];
         if (!string.IsNullOrEmpty(UserId) && !string.IsNullOrEmpty(PWD))
         {
             string _StrErr = mUserInfo.CHECK_SET_LINE_EMPLOYEE(UserId, PWD);
             if (_StrErr == "OK")
             {
                 SendMsg(mLogMsgType.Incoming, "权限正确");
                 Dictionary <string, object> dic = new Dictionary <string, object>();
                 Frm_Public.Frm_Select       fd  = new Frm_Public.Frm_Select(ReleaseData.arrByteToDataTable(LsLine.GetAllLineInfo()), ref dic);
                 if (fd.ShowDialog() == DialogResult.OK)
                 {
                     LabLine.Text = dic["线别"].ToString();
                     Encoder.ReadIniFile.IniWriteValue("BOX_PRINT", "LINE", Encoder.Encoder.EncryptString(dic["线别"].ToString()), IniFilePath);
                 }
             }
             else
             {
                 SendMsg(mLogMsgType.Error, _StrErr);
             }
         }
     }
     catch (Exception ex)
     {
         SendMsg(mLogMsgType.Error, "权限格式不正确:" + ex.Message);
     }
 }
示例#2
0
 private void tb_wo_KeyDown(object sender, KeyEventArgs e)
 {
     if ((!string.IsNullOrEmpty(tb_wo.Text)) && (e.KeyCode == Keys.Enter))
     {
         try
         {
             DataTable dtwo = ReleaseData.arrByteToDataTable(swoinfo.GetWoInfo(tb_wo.Text, null));
             ProductLine = dtwo.Rows[0]["LINEID"].ToString();
             SendMsg(mLogMsgType.Incoming, string.Format("此工单可在[{0}]线生产", ProductLine));
             sPartNumber   = dtwo.Rows[0][5].ToString();
             sPartColor    = ReleaseData.arrByteToDataTable(sProduct.GetProductByPartNumber(sPartNumber)).Rows[0][3].ToString();
             LabColor.Text = string.Format("颜色:[{0}]  料号:[{1}]", sPartColor, sPartNumber);
             _FwVer        = dtwo.Rows[0]["FW_VER"].ToString();
             SendMsg(mLogMsgType.Incoming, "获取工单信息成功");
             tb_Input.Enabled = true;
             tb_wo.Enabled    = false;
             tb_Input.Focus();
             cb_ListRoute.Items.Clear();
             DataTable dtcraft = ReleaseData.arrByteToDataTable(swoinfo.GetAllCraftInfo(tb_wo.Text));
             foreach (DataRow dr in dtcraft.Rows)
             {
                 cb_ListRoute.Items.Add(dr["CRAFTNAME"].ToString());
             }
         }
         catch
         {
             SendMsg(mLogMsgType.Error, string.Format("获取{0}工单,产品颜色失败", tb_wo.Text));
             tb_Input.Enabled = false;
             tb_wo.Text       = "";
         }
     }
 }
示例#3
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);
        }
示例#4
0
        public void PrintLabel(string sEsn)
        {
            #region 打印标签
            DataTable dt = ReleaseData.arrByteToDataTable(wkp.GetWipKeyPart(sEsn));
            if (dt.Rows.Count > 0)
            {
                string sWO = dt.Rows[0][1].ToString();
                if (sWO != tb_wo.Text)
                {
                    SendMsg(mLogMsgType.Error, "工单不同-->" + sWO);
                    return;
                }

                DataTable dtPrint = new DataTable();
                dtPrint.Columns.Add("Name", Type.GetType("System.String"));
                dtPrint.Columns.Add("val", Type.GetType("System.String"));
                dtPrint.Rows.Add("ESN", sEsn);
                dtPrint.Rows.Add("BLACK", sPartColor);
                dtPrint.Rows.Add("PARTNUMBER", sPartNumber);
                dtPrint.Rows.Add("FWVER", string.IsNullOrEmpty(_FwVer) ? "NA" : _FwVer);
                foreach (DataRow dr in dt.Rows)
                {
                    dtPrint.Rows.Add(dr[2].ToString().ToUpper(), dr[3].ToString().ToUpper());
                }
                //string filepatch = System.IO.Directory.GetCurrentDirectory() + "\\LabelFile\\" + sPartNumber + ".lab";
                //string labfilefullpath = string.Format(@"{0}\{1}\{2}", this.LabDir.IndexOf(":") != -1 ? this.LabDir : this.LabDir, "PACK_BOX", sPartNumber + ".lab");
                //if (!File.Exists(labfilefullpath))
                //{
                //    SendMsg(mLogMsgType.Error, "条码文件不存在:" + labfilefullpath);
                //}
                //else
                //{
                //    SendPrintLabel(dtPrint, labfilefullpath, 1);
                //}
                PrintLabel(dtPrint);
            }
            else
            {
                SendMsg(mLogMsgType.Error, "没有找到信息");
            }
            #endregion
        }
示例#5
0
文件: Frm_RePrint.cs 项目: 88886/SFIS
        private void tb_data_KeyDown(object sender, KeyEventArgs e)
        {
            if (!string.IsNullOrEmpty(tb_data.Text) && e.KeyCode == Keys.Enter)
            {
                string sColnum = string.Empty;
                string StrErr  = string.Empty;

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

                DataTable dt = ReleaseData.arrByteToDataTable(mFrm.tWipTrack.GetQueryWipAllInfo(sColnum, tb_data.Text));
                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["WOID"].ToString() == mFrm.tb_wo.Text)
                    {
                        mFrm.PrintLabel(dt.Rows[0]["ESN"].ToString());
                    }
                    else
                    {
                        MessageBox.Show(string.Format("工单不同{0}≠{1}", dt.Rows[0]["WOID"].ToString(), mFrm.tb_wo.Text));
                    }
                }
                else
                {
                    MessageBox.Show("NO DATA");
                }

                tb_data.Text = "";
            }
        }