public string GetAgencyDetail(string callType, string xmlMessage) { string result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<" + callType + ">" + "<Result>False</Result>" + "<Description></Description></" + callType + ">"; string logID = Guid.NewGuid().ToString(); try { FileLogger.WriteLog(logID + "|Start:" + xmlMessage, 1, "", callType); if (Helper.CheckAuthCode(callType, xmlMessage)) { ydbAgency h = new ydbAgency(); result = h.GetDetail(xmlMessage); } } catch (Exception err) { result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<" + callType + ">" + "<Result>False</Result>" + "<Description>" + err.Message + "</Description></" + callType + ">"; } FileLogger.WriteLog(logID + "|End:" + result, 1, "", callType); return(result); }
public string DeleteAgency(string callType, string xmlMessage) { string result = "", id = ""; string logID = Guid.NewGuid().ToString(); try { FileLogger.WriteLog(logID + "|Start:" + xmlMessage, 1, "", callType); if (Helper.CheckAuthCode(callType, xmlMessage)) { XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlMessage); XmlNode vNode = doc.SelectSingleNode(callType + "/ID"); if (vNode == null || vNode.InnerText.Trim().Length == 0) { throw new Exception("ID不能为空"); } id = vNode.InnerText.Trim(); ydbAgency h = new ydbAgency(); if (h.Delete(xmlMessage) != "-1") { result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<" + callType + ">" + "<Result>True</Result>" + "<ID>" + id + "</ID>" + "<Description></Description></" + callType + ">"; } else { result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<" + callType + ">" + "<Result>False</Result>" + "<Description></Description></" + callType + ">"; } } } catch (Exception err) { result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<" + callType + ">" + "<Result>False</Result>" + "<Description>" + err.Message + "</Description></" + callType + ">"; } FileLogger.WriteLog(logID + "|End:" + result, 1, "", callType); return(result); }