/// <summary>
 /// 获取交易配置信息
 /// </summary>
 /// <param name="loginId">登录标识</param>
 /// <param name="list">配置信息</param>
 /// <returns></returns>
 public ErrType GetTradeSetInfo(String loginId, ref ObservableCollection <TradeConfigInfo> list)
 {
     try
     {
         TradeSetInfo result = TradeService.GetTradeSetInfo(loginId);
         if (!result.Result)
         {
             return(new ErrType(ERR.SERVICE, result.Desc));
         }
         foreach (TradeSet set in result.TdSetList)
         {
             list.Add(new TradeConfigInfo()
             {
                 ObjName  = set.ObjName,
                 ObjCode  = set.ObjCode,
                 ObjValue = set.ObjValue,
                 Remark   = set.Remark
             });
         }
         return(GeneralErr.Success);
     }
     catch (TimeoutException te)
     {
         FileLog.WriteLog("", Assembly.GetExecutingAssembly().GetName().Name, this.GetType().Name, new StackTrace().GetFrame(0).GetMethod().Name, te.Message); return(new ErrType(ERR.EXEPTION, ErrorText.TimeoutException));
     }
     catch (Exception ex)
     {
         FileLog.WriteLog("", Assembly.GetExecutingAssembly().GetName().Name, this.GetType().Name, new StackTrace().GetFrame(0).GetMethod().Name, ex.Message);
         return(new ErrType(ERR.EXEPTION, ErrorText.GetTradeSetInfo));
     }
 }
Example #2
0
        public String AnalysisXml(string ReqXml)
        {
            string ResXml  = string.Empty;
            string ReqCode = string.Empty;

            try
            {
                System.Xml.XmlDocument xmldoc = new System.Xml.XmlDocument();
                xmldoc.LoadXml(ReqXml);

                //请求指令
                ReqCode = xmldoc.SelectSingleNode("JTW91G/MsgData/ReqHeader/ReqCode").InnerText;

                Trade.CTrade trade = new Trade.CTrade();

                string LoginID = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;

                TradeSetInfo  setinfo = trade.GetTradeSetInfo(LoginID);
                StringBuilder strb    = new StringBuilder();
                foreach (TradeSet st in setinfo.TdSetList)
                {
                    strb.Append("<Configuration>");
                    strb.AppendFormat("<Key>{0}</Key>", st.ObjCode);
                    strb.AppendFormat("<Value>{0}</Value>", st.ObjValue);
                    strb.Append("</Configuration>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><Configurations>{0}</Configurations></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }