当前位置: 首页>>代码示例>>C#>>正文


C# NBrightBuyController.GetSqlxml方法代码示例

本文整理汇总了C#中Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController.GetSqlxml方法的典型用法代码示例。如果您正苦于以下问题:C# NBrightBuyController.GetSqlxml方法的具体用法?C# NBrightBuyController.GetSqlxml怎么用?C# NBrightBuyController.GetSqlxml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController的用法示例。


在下文中一共展示了NBrightBuyController.GetSqlxml方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCateoriesInProductList

        /// <summary>
        /// Return a list of category ids for all the valid categories for a given product list (selected by a categoryid)  
        /// </summary>
        /// <param name="categoryId"></param>
        /// <returns></returns>
        private List<int> GetCateoriesInProductList(int categoryId)
        {
            var objQual = DotNetNuke.Data.DataProvider.Instance().ObjectQualifier;
            var dbOwner = DotNetNuke.Data.DataProvider.Instance().DatabaseOwner;

            var objCtrl = new NBrightBuyController();
            var strXML = objCtrl.GetSqlxml("select distinct XrefItemId from " + dbOwner + "[" + objQual + "NBrightBuy] where (typecode = 'CATCASCADE' or typecode = 'CATXREF') and parentitemid in (select parentitemid from " + dbOwner + "[" + objQual + "NBrightBuy] where (typecode = 'CATCASCADE' or typecode = 'CATXREF') and XrefItemId in (" + categoryId + ")) for xml raw ");
            // get returned XML into generic List
            var xmlDoc = new XmlDocument();
            xmlDoc.LoadXml("<root>" + strXML + "</root>");
            var nList = xmlDoc.SelectNodes("root/row");
            var rtnList = new List<int>();
            foreach (XmlNode n in nList)
            {
                if (n.Attributes["XrefItemId"].Value != null && Utils.IsNumeric(n.Attributes["XrefItemId"].Value))
                {
                    rtnList.Add(Convert.ToInt32(n.Attributes["XrefItemId"].Value));
                }
            }
            return rtnList;
        }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:26,代码来源:GenXmlTemplateExt.cs

示例2: GetReturnData

        private string GetReturnData(HttpContext context)
        {
            try
            {

                var strOut = "";

                var strIn = HttpUtility.UrlDecode(Utils.RequestParam(context, "inputxml"));
                var xmlData = GenXmlFunctions.GetGenXmlByAjax(strIn, "");
                var objInfo = new NBrightInfo();

                objInfo.ItemID = -1;
                objInfo.TypeCode = "AJAXDATA";
                objInfo.XMLData = xmlData;
                var settings = objInfo.ToDictionary();

                var themeFolder = StoreSettings.Current.ThemeFolder;
                if (settings.ContainsKey("themefolder")) themeFolder = settings["themefolder"];
                var templCtrl = NBrightBuyUtils.GetTemplateGetter(themeFolder);

                if (!settings.ContainsKey("portalid")) settings.Add("portalid", PortalSettings.Current.PortalId.ToString("")); // aways make sure we have portalid in settings
                var objCtrl = new NBrightBuyController();

                // run SQL and template to return html
                if (settings.ContainsKey("sqltpl") && settings.ContainsKey("xsltpl"))
                {
                    var strSql = templCtrl.GetTemplateData(settings["sqltpl"], _lang, true, true, true, StoreSettings.Current.Settings());
                    var xslTemp = templCtrl.GetTemplateData(settings["xsltpl"], _lang, true, true, true, StoreSettings.Current.Settings());

                    // replace any settings tokens (This is used to place the form data into the SQL)
                    strSql = Utils.ReplaceSettingTokens(strSql, settings);
                    strSql = Utils.ReplaceUrlTokens(strSql);

                    strSql = GenXmlFunctions.StripSqlCommands(strSql); // don't allow anything to update through here.

                    strOut = objCtrl.GetSqlxml(strSql);
                    if (!strOut.StartsWith("<root>")) strOut = "<root>" + strOut + "</root>"; // always wrap with root node.
                    strOut = XslUtils.XslTransInMemory(strOut, xslTemp);
                }

                return strOut;
            }
            catch (Exception ex)
            {
                return ex.ToString();
            }
        }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:47,代码来源:XmlConnector.ashx.cs

示例3: GetStats

        private NBrightInfo GetStats(int portalId, bool forceRefresh = false)
        {
            var cachekey = "nbrightbuydashboard*" + PortalId.ToString("");
            var statsInfo = (NBrightInfo)Utils.GetCache(cachekey);

            if (statsInfo == null || StoreSettings.Current.DebugMode || forceRefresh)
            {
                var objCtrl = new NBrightBuyController();
                statsInfo = new NBrightInfo(true);

                var objQual = DotNetNuke.Data.DataProvider.Instance().ObjectQualifier;
                var dbOwner = DotNetNuke.Data.DataProvider.Instance().DatabaseOwner;

                var statsXml = objCtrl.GetSqlxml("exec " + dbOwner + objQual + "NBrightBuy_DashboardStats " + portalId);
                statsInfo.XMLData = statsXml;
                Utils.SetCache(cachekey, statsInfo);
            }
            return statsInfo;
        }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:19,代码来源:DashSummary.ascx.cs


注:本文中的Nevoweb.DNN.NBrightBuy.Components.NBrightBuyController.GetSqlxml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。