// 实时更新设备运行数据 public bool UpdateRunningData(Hashtable data) { bool ret = false; try { XmlDocument xml = WebServiceHelper.QuerySoapWebService(serverIP + "/Process.asmx", "PostRunningData", "data", data); ret = xml.InnerText == "true"; } catch (WebException ex) { } return(ret); }
public void PostConsumableData(List <int> ids, List <int> times) { Hashtable Pars = new Hashtable { { "DeviceID", Convert.ToInt32(m_DeviceID) }, { "ConsumableIDs", ids }, { "UsedTimes", times }, }; try { WebServiceHelper.QuerySoapWebService(m_serverIP + "/Process.asmx", "PostConsumableList", "list", Pars); } catch (WebException ex) { MessageBox.Show(ex.Message); } }
public void PostWarningFixedData(string WarningDataID, string Fixtime, string Result, int FixDuration) { Hashtable Pars = new Hashtable { { "DeviceID", Convert.ToInt32(m_DeviceID) }, { "WarningDataID", Convert.ToInt32(WarningDataID) }, { "FixTime", Convert.ToDateTime(Fixtime) }, { "Treatment", "忽略" }, { "Result", Result }, { "FixDuration", FixDuration } }; try { WebServiceHelper.QuerySoapWebService(m_serverIP + "/Process.asmx", "PostWarningFixedData", "data", Pars); } catch (WebException ex) { } }
public int PostWarningData(int nWarningID) { Hashtable Pars = new Hashtable { { "DeviceID", Convert.ToInt32(m_DeviceID) }, { "WarningID", nWarningID }, { "OccurTime", DateTime.Now } }; int WarningDataID = 0; try { XmlDocument xml = WebServiceHelper.QuerySoapWebService(m_serverIP + "/Process.asmx", "PostWarningData", "data", Pars); WarningDataID = Convert.ToInt32(xml.InnerText); } catch (WebException ex) { } return(WarningDataID); }
public bool PostConsumableReplaceData(string stReplacePeople, int ConsumableID, int UsedTimes, string stReplaceTime) { bool ret = false; Hashtable Pars = new Hashtable { { "DeviceID", Convert.ToInt32(m_DeviceID) }, { "ConsumableID", ConsumableID }, { "UsedTimes", UsedTimes }, { "ReplaceTime", Convert.ToDateTime(stReplaceTime) }, { "ReplacePeople", stReplacePeople } }; try { XmlDocument xml = WebServiceHelper.QuerySoapWebService(m_serverIP + "/Process.asmx", "PostConsumableReplaceData", "data", Pars); ret = xml.InnerText == "true"; } catch (WebException ex) { } return(ret); }
// 通过本地配置文件,初始化服务器连接信息等 public DTSManager(string localConfigFilePath) { PostSever = new PostToSever(localConfigFilePath); XmlDocument xml = new XmlDocument(); xml.Load(localConfigFilePath); XmlElement root = xml.DocumentElement; XmlNodeList serverNodes = root.GetElementsByTagName("Server"); if (serverNodes.Count > 0) { XmlElement serverEle = (XmlElement)serverNodes[0]; serverIP = serverEle.InnerText; } try { XmlDocument alarmInfoConfig = WebServiceHelper.QuerySoapWebService(serverIP + "/Process.asmx", "GetAlarmInfoConfigration"); string EXEPath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase; alarmInfoConfig.Save((EXEPath + "alarmInfoConfig.xml")); } catch (WebException ex) { MessageBox.Show(ex.Message); } try { XmlDocument alarmInfoConfig = WebServiceHelper.QuerySoapWebService(serverIP + "/Process.asmx", "GetConsumableInfoConfigration"); alarmInfoConfig.Save(Application.StartupPath + "\\ConsumableInfoConfig.xml"); } catch (WebException ex) { MessageBox.Show(ex.Message); } }