private void InitializationInfo() { string C_RES = ""; try { this.Invoke(new EventHandler(delegate { SendMsg(mLogMsgType.Incoming, "正在加载基础数据!"); C_RES = "加载串口DLL失败"; // bzz = new Buzzer.buzzer(); C_RES = "连接串口失败"; // bzz.ConnPort("SFIS_ISCM"); C_RES = "工单类加载失败"; tWoInfo = new WebServices.tWoInfo.tWoInfo(); C_RES = "公共方法PubStor加载失败"; PubStor = new WebServices.tPublicStoredproc.tPublicStoredproc(); C_RES = "绑定关系接口加载失败"; wipkeyparts = new WebServices.tWipKeyPart.tWipKeyPart(); C_RES = "线体信息加载失败"; sLine = new WebServices.tLineInfo.tLineInfo(); DataTable dt = ReleaseData.arrByteToDataTable(sLine.GetAllLineInfo()); DataView dv = dt.DefaultView; dv.Sort = "线别 ASC"; DataTable dTemp = dv.ToTable(); cb_Line.Items.Clear(); foreach (DataRow dr in dTemp.Rows) { cb_Line.Items.Add(dr["线别"].ToString()); } cb_Line.SelectedIndex = 0; C_RES = "加载SFIS_ISCM.ini失败"; string filePath = System.Environment.CurrentDirectory + "\\SFIS_ISCM.ini"; LabDir = ReadIniFile.IniReadValue("TEST_INPUT", "Patch", filePath); LabInput.Text = ""; LabTarget.Text = ""; LabRoute.Text = ""; tb_Input.Focus(); SendMsg(mLogMsgType.Incoming, "基础数据加载完成!"); })); } catch { SendMsg(mLogMsgType.Error, C_RES); } }
private void PrintLabel(string ESN) { WebServices.tWipKeyPart.tWipKeyPart wipkeyparts = new WebServices.tWipKeyPart.tWipKeyPart(); DataTable dt_wipkeyparts = ReleaseData.arrByteToDataTable(wipkeyparts.GetWipKeyPart(ESN)); string labfilefullpath = string.Format(@"{0}\{1}\{2}", this.LabDir.IndexOf(":") != -1 ? this.LabDir : this.LabDir + ":", this.tb_wo.Text, LabRoute.Text + ".lab"); if (!File.Exists(labfilefullpath)) { SendMsg(mLogMsgType.Error, "条码文件不存在:" + labfilefullpath); } else { DataTable dt = new DataTable(); dt.Columns.Add("Colnum", typeof(string)); dt.Columns.Add("DATA", typeof(string)); dt.Rows.Add("ESN", ESN); foreach (DataRow dr in dt_wipkeyparts.Rows) { dt.Rows.Add(dr["SNTYPE"].ToString(), dr["SNVAL"].ToString()); } Call_PrintLabel(dt, labfilefullpath, Convert.ToInt32(numprint.Value)); } }
static refWebtWipKeyPart() { instance = new WebServices.tWipKeyPart.tWipKeyPart(); }