public string UpdateMessage(string callType, string xmlMessage) { string result = ""; string logID = Guid.NewGuid().ToString(); try { FileLogger.WriteLog(logID + "|Start:" + xmlMessage, 1, "", callType); if (CheckAuthCode(callType, xmlMessage))//数据校验通过 { ydb.BLL.ydbMessage msg = new ydbMessage(); result = msg.Update(xmlMessage); if (result.Length == 36)//成功更新记录 { result = "<?xml version=\"1.0\" encoding=\"utf-8\"?><" + callType + ">" + "<Result>True</Result>" + "<Description></Description>" + "<FMsgID>" + result + "</FMsgID>" + "</" + callType + ">"; } } } catch (Exception err) { result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<" + callType + ">" + "<Result>False</Result>" + "<Description>" + err.Message + "</Description></" + callType + ">"; } FileLogger.WriteLog(callType + " End:" + result); return(result); }
public string GetMessageList(string callType, string xmlMessage) { string result = "", type = "99", receiverId = ""; DateTime bdate = DateTime.Now, expiratoindate = DateTime.Now, edate = DateTime.Now; string logID = Guid.NewGuid().ToString(); try { FileLogger.WriteLog(logID + "|Start:" + xmlMessage, 1, "", callType); if (CheckAuthCode(callType, xmlMessage)) { ydbMessage msg = new ydbMessage(); result = msg.GetListXML(xmlMessage); } } catch (Exception err) { result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<GetMessageList>" + "<Result>False</Result>" + "<Description>" + err.Message + "</Description></GetMessageList>"; } FileLogger.WriteLog(logID + "|End:" + result, 1, "", callType); return(result); }
public string GetMessageDetail(string callType, string xmlMessage) { string result = ""; string logID = Guid.NewGuid().ToString(); try { FileLogger.WriteLog(logID + "|Start:" + xmlMessage, 1, "", callType); if (CheckAuthCode(callType, xmlMessage)) { XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlMessage); XmlNode vNode = doc.SelectSingleNode(callType + "/MessageID"); if (vNode == null || vNode.InnerText.Trim().Length == 0) { throw new Exception("消息ID不能为空"); } ydb.BLL.ydbMessage msg = new ydbMessage(); result = msg.GetDetailXML(vNode.InnerText.Trim()); } } catch (Exception err) { result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<GetMessageDetail>" + "<Result>False</Result>" + "<Description>" + err.Message + "</Description></GetMessageDetail>"; } FileLogger.WriteLog(logID + "|End:" + result, 1, "", callType); return(result); }
public string GetLogList(string callType, string xmlMessage) { string result = "<GetLogList>" + "<Result>False</Result>" + "<Description></Description>" + "</GetLogList>"; try { if (CheckAuthCode(callType, xmlMessage)) { ydbMessage msg = new ydbMessage(); result = msg.GetLogList(xmlMessage); } } catch (Exception err) { result = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<GetLogList>" + "<Result>False</Result>" + "<Description>" + err.Message + "</Description></GetLogList>"; } return(result); }