示例#1
0
        public bool getXmlData(XmlNode config, ref XmlDocument doc, ref XmlDocument xmlschemaDoc, ref string msg, XmlNode condition = null)
        {
            string strDefaultName = "DataTable1";
            string strRootName    = "NewDataSet";
            string ret            = "";
            string strName        = XmlUtil.GetSubNodeText(config, "module/@name");
            string strReqJson     = null;

            XmlNode xmlreq = config.SelectSingleNode("req");

            if (condition == null)
            {
                if (xmlreq != null)
                {
                    condition = xmlreq;
                }
            }
            Assembly assem = Assembly.GetExecutingAssembly();

            try
            {
                List <int> list = JdUnion_GlbObject.getElites();
                Dictionary <string, string> cols = null;
                Type t = assem.GetType(string.Format("{0}.{1}", assem.FullName.Split(',')[0], strName));
                if (t == null)
                {
                    msg = "无法识别的外部访问类";
                    return(false);
                }

                JdUnion_Bussiness_Class jgl = JdUnion_GlbObject.CreateBusinessClass(t) as JdUnion_Bussiness_Class;
                JdUnion_ModuleClass     jm  = JdUnion_GlbObject.modules.Modules.FindLast(a => a.ClassName == strName);
                if (jm == null)
                {
                    msg = "未配置正确的模块信息!";
                    return(false);
                }
                jgl.InitClass(jm);
                bool succ = jgl.getBusynessXmlData(condition, ref doc, ref xmlschemaDoc, ref msg);
                return(succ);
            }
            catch (Exception e)
            {
                msg = e.Message;
                return(false);
            }
            return(true);
        }
示例#2
0
        public string getMyUrl(string subid = null)
        {
            string dicsid = subid;

            if (subid == null)
            {
                dicsid = "";
            }
            if (string.IsNullOrEmpty(this.materialUrl))
            {
                return(null);
            }
            lock (JdGoodsQueryClass.glbUrls)
            {
                Dictionary <string, string> dicurl = new Dictionary <string, string>();

                if (JdGoodsQueryClass.glbUrls.ContainsKey(this.skuId))
                {
                    dicurl = JdGoodsQueryClass.glbUrls[this.skuId];
                }
                if (dicurl.ContainsKey(dicsid))
                {
                    return(dicurl[dicsid]);
                }


                JdUnion_Goods_Link jgl = JdUnion_GlbObject.CreateBusinessClass(typeof(JdUnion_Goods_Link)) as JdUnion_Goods_Link;
                //jgl.InitClass(jgl.Module);//必须初始化,获取到json设置才能用。
                XmlDocument xmldoc             = null;
                string      url                = this.materialUrl;
                string      strPath_SiteId     = string.Format("promotionCodeReq/siteId");
                string      strPath_MaterialId = string.Format("promotionCodeReq/materialId");
                string      strPath_CouponUrl  = string.Format("promotionCodeReq/couponUrl");
                string      strPath_PositionId = string.Format("promotionCodeReq/positionId");
                string      strChainType       = "promotionCodeReq/chainType";
                jgl.setBussiessItems(strPath_SiteId, jgl.siteId);
                jgl.setBussiessItems(strPath_MaterialId, url);

                if (!string.IsNullOrEmpty(this.couponLink))
                {
                    url = this.couponLink;
                    jgl.setBussiessItems(strPath_CouponUrl, url);
                }
                if (!string.IsNullOrEmpty(subid))
                {
                    jgl.setBussiessItems(strPath_PositionId, subid);
                }
                jgl.setBussiessItems(strChainType, "1");
                jgl.sign = null;
                XmlDocument xmlschema = null;
                string      msg       = null;
                bool        succ      = jgl.getXmlData(ref xmldoc, ref xmlschema, ref msg, false);
                if (succ == false)
                {
                    if (msg != null)
                    {
                    }
                    return(null);
                }
                string urlRet = XmlUtil.GetSubNodeText(xmldoc, "NewDataSet/getResult/url");

                if (!dicurl.ContainsKey(dicsid))
                {
                    dicurl.Add(dicsid, urlRet);
                }
                JdGoodsQueryClass.glbUrls[this.skuId] = dicurl;

                return(urlRet);
            }
        }