/// <summary> /// 加载基础数据 /// </summary> private void LoadDefaultData() { tb_wo.Focus(); string C_RES = ""; try { C_RES = "加载 对象[WebServices.tWipTracking] 失败 "; twip = new WebServices.tWipTracking.tWipTracking(); C_RES = "加载 对象[WebServices.tBomKeyPart] 失败 "; bkp = new WebServices.tBomKeyPart.tBomKeyPart(); C_RES = "加载 对象[WebServices.tWoInfo] 失败 "; tWoInfo = new WebServices.tWoInfo.tWoInfo(); C_RES = "加载 对象[WebServices.tLineInfo] 失败 "; tLineInfo = new WebServices.tLineInfo.tLineInfo(); C_RES = "加载 对象[WebServices.tPublicStoredproc] 失败 "; PubStor = new WebServices.tPublicStoredproc.tPublicStoredproc(); C_RES = "加载员工信息失败"; tuser = new WebServices.tUserInfo.tUserInfo(); C_RES = "加载检查版本信息失败"; chkver = new WebServices.Check_Version.Check_Version(); C_RES = "加载线体资料失败"; LoadLineInfo(); SendPrgMsg(mLogMsgType.Incoming, "基础数据加载完成"); SendPrgMsg(mLogMsgType.Incoming, "请选择基础数据后输入权限..."); } catch { SendPrgMsg(mLogMsgType.Error, C_RES); this.Enabled = false; } }
static refWebtWipTracking() { instance = new WebServices.tWipTracking.tWipTracking(); }
private void Calculation_MacPassword(string ESN) { Dictionary <string, string> dicpwd = new Dictionary <string, string>(); List <string> _Allpwd = new List <string>(); if (radNoPWD.Checked) { } else { DataTable dt_wipkeyparts = ReleaseData.arrByteToDataTable(wipkeyparts.GetWipKeyPart(ESN)); if (dt_wipkeyparts.Rows.Count > 0) { string MAC = string.Empty; string woId = string.Empty; foreach (DataRow dr in dt_wipkeyparts.Rows) { if (dr["SNTYPE"].ToString() == "MAC") { MAC = dr["SNVAL"].ToString(); woId = dr["WOID"].ToString(); } } if (!string.IsNullOrEmpty(MAC)) { if (radMAC.Checked) { _Allpwd = macPassword.getMacAllPassword(MAC); dicpwd.Add("DEK", _Allpwd[3]); } if (radMAC2.Checked) { string Mac_Prefix = MAC.Substring(0, 6); int i = Convert.ToInt32(MAC.Substring(6, 6), 16) + 2; string Mac_Suffix = string.Format("{0:X}", i); SendMsg(mLogMsgType.Outgoing, "MAC:" + MAC); SendMsg(mLogMsgType.Outgoing, "PLCMAC:" + Mac_Prefix + Mac_Suffix); _Allpwd = macPassword.getMacAllPassword(Mac_Prefix + Mac_Suffix); dicpwd.Add("DEK", _Allpwd[3]); dicpwd.Add("PLCMAC", Mac_Prefix + Mac_Suffix); } List <Dictionary <string, object> > LsDic = new List <Dictionary <string, object> >(); Dictionary <string, object> dic = null; //List<WebServices.tWipTracking.tWipKeyPartTable> Listwip = new List<WebServices.tWipTracking.tWipKeyPartTable>(); //WebServices.tWipTracking.tWipKeyPartTable twip = null; foreach (KeyValuePair <string, string> item in dicpwd) { dic = new Dictionary <string, object>(); dic.Add("ESN", MAC); dic.Add("WOID", woId); dic.Add("SNTYPE", item.Key); dic.Add("SNVAL", item.Value); dic.Add("STATION", LabRoute.Text); dic.Add("KPNO", "NA"); LsDic.Add(dic); //twip = new WebServices.tWipTracking.tWipKeyPartTable(); //twip.esn = MAC; //twip.woId = woId; //twip.sntype = item.Key; //twip.snval = item.Value; //twip.station = LabRoute.Text; //twip.KPNO = "NA"; //Listwip.Add(twip); } WebServices.tWipTracking.tWipTracking mTracking = new WebServices.tWipTracking.tWipTracking(); string _StrErr = mTracking.InsertWipKeyParts(Newtonsoft.Json.JsonConvert.SerializeObject(LsDic)); if (_StrErr == "OK") { SendMsg(mLogMsgType.Incoming, "Inser KeyParts OK"); } else { SendMsg(mLogMsgType.Error, "Inser KeyParts Err:" + _StrErr); } } } } }