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


C# NBrightBuyController.GetDataList方法代码示例

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


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

示例1: GetProductListData

        private String GetProductListData(Dictionary<String, String> settings,bool paging = true)
        {
            var strOut = "";

            if (!settings.ContainsKey("header")) settings.Add("header", "");
            if (!settings.ContainsKey("body")) settings.Add("body", "");
            if (!settings.ContainsKey("footer")) settings.Add("footer", "");
            if (!settings.ContainsKey("filter")) settings.Add("filter", "");
            if (!settings.ContainsKey("orderby")) settings.Add("orderby", "");
            if (!settings.ContainsKey("returnlimit")) settings.Add("returnlimit", "0");
            if (!settings.ContainsKey("pagenumber")) settings.Add("pagenumber", "0");
            if (!settings.ContainsKey("pagesize")) settings.Add("pagesize", "0");
            if (!settings.ContainsKey("searchtext")) settings.Add("searchtext", "");
            if (!settings.ContainsKey("searchcategory")) settings.Add("searchcategory", "");
            if (!settings.ContainsKey("cascade")) settings.Add("cascade", "False");

            var header = settings["header"];
            var body = settings["body"];
            var footer = settings["footer"];
            var filter = settings["filter"];
            var orderby = settings["orderby"];
            var returnLimit = Convert.ToInt32(settings["returnlimit"]);
            var pageNumber = Convert.ToInt32(settings["pagenumber"]);
            var pageSize = Convert.ToInt32(settings["pagesize"]);
            var cascade = Convert.ToBoolean(settings["cascade"]);

            var searchText = settings["searchtext"];
            var searchCategory = settings["searchcategory"];

            if (searchText != "") filter += " and (NB3.[ProductName] like '%" + searchText + "%' or NB3.[ProductRef] like '%" + searchText + "%' or NB3.[Summary] like '%" + searchText + "%' ) ";

            if (Utils.IsNumeric(searchCategory))
            {
                if (orderby == "{bycategoryproduct}") orderby += searchCategory;
                var objQual = DataProvider.Instance().ObjectQualifier;
                var dbOwner = DataProvider.Instance().DatabaseOwner;
                if (!cascade)
                    filter += " and NB1.[ItemId] in (select parentitemid from " + dbOwner + "[" + objQual + "NBrightBuy] where typecode = 'CATXREF' and XrefItemId = " + searchCategory + ") ";
                else
                    filter += " and NB1.[ItemId] in (select parentitemid from " + dbOwner + "[" + objQual + "NBrightBuy] where (typecode = 'CATXREF' and XrefItemId = " + searchCategory + ") or (typecode = 'CATCASCADE' and XrefItemId = " + searchCategory + ")) ";
            }
            else
            {
                if (orderby == "{bycategoryproduct}") orderby = " order by NB3.productname ";
            }

            var recordCount = 0;

            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();

            var headerTempl = templCtrl.GetTemplateData(header, _lang, true, true, true, StoreSettings.Current.Settings());
            var bodyTempl = templCtrl.GetTemplateData(body, _lang, true, true, true, StoreSettings.Current.Settings());
            var footerTempl = templCtrl.GetTemplateData(footer, _lang, true, true, true, StoreSettings.Current.Settings());

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

            var obj = new NBrightInfo(true);
            strOut = GenXmlFunctions.RenderRepeater(obj, headerTempl);

            if (paging) // get record count for paging
            {
                if (pageNumber == 0) pageNumber = 1;
                if (pageSize == 0) pageSize = StoreSettings.Current.GetInt("pagesize");
                recordCount = objCtrl.GetListCount(PortalSettings.Current.PortalId, -1, "PRD", filter,"PRDLANG",_lang);
            }

            var objList = objCtrl.GetDataList(PortalSettings.Current.PortalId, -1, "PRD", "PRDLANG", _lang, filter, orderby, StoreSettings.Current.DebugMode,"",returnLimit,pageNumber,pageSize,recordCount);
            strOut += GenXmlFunctions.RenderRepeater(objList, bodyTempl);

            strOut += GenXmlFunctions.RenderRepeater(obj, footerTempl);

            // add paging if needed
            if (paging)
            {
                var pg = new NBrightCore.controls.PagingCtrl();
                strOut += pg.RenderPager(recordCount, pageSize, pageNumber);
            }

            return strOut;
        }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:92,代码来源:XmlConnector.ashx.cs

示例2: ResetLanguage

        private void ResetLanguage()
        {
            var pass = GenXmlFunctions.GetField(rpData, "txtclearpass");
            if (pass == StoreSettings.Current.Get("adminpin") && pass != "")
            {
            var languagetoreset = GenXmlFunctions.GetField(rpData, "languagetoreset");
            var languageresetto = GenXmlFunctions.GetField(rpData, "languageresetto");
                if (languagetoreset != "" && languageresetto != languagetoreset)
                {
                    var objCtrl = new NBrightBuyController();

                    var l = objCtrl.GetDataList(PortalId, -1, "PRD", "", Utils.GetCurrentCulture(), "", "");
                    foreach (var i in l)
                    {
                        var prdData = ProductUtils.GetProductData(i.ItemID, languagetoreset);
                        prdData.ResetLanguage(languageresetto);
                    }

                    l = objCtrl.GetDataList(PortalId, -1, "CATEGORY", "", Utils.GetCurrentCulture(), "", "");
                    foreach (var i in l)
                    {
                        var catData = CategoryUtils.GetCategoryData(i.ItemID, languagetoreset);
                        catData.ResetLanguage(languageresetto);
                    }

                    DataCache.ClearCache();

                    NBrightBuyUtils.SetNotfiyMessage(ModuleId, "completed", NotifyCode.ok);

                }
            }
            else
            {
                NBrightBuyUtils.SetNotfiyMessage(ModuleId, "nopin", NotifyCode.fail);
            }
        }
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:36,代码来源:Tools.ascx.cs

示例3: ProductlistDataBind

        private void ProductlistDataBind(object sender, EventArgs e)
        {
            var lc = (Literal)sender;
            var container = (IDataItemContainer)lc.NamingContainer;
            try
            {
                var strOut = "";
                lc.Visible = visibleStatus.DefaultIfEmpty(true).First();
                if (lc.Visible)
                {

                    var param = lc.Text.Split(':');
                    if (param.Count() == 4)
                    {
                        try
                        {

                            var strFilter = "";
                            var templName = param[0];
                            var cascade = param[1];
                            var strOrder = param[2];
                            var filter = param[3];

                            if ((templName != ""))
                            {

                                var nbi = (GroupCategoryData)container.DataItem;
                                var lang = Utils.GetCurrentCulture();

                                var strCacheKey = lang + "*" + nbi.categoryid + "*" + lc.Text;
                                if (!StoreSettings.Current.DebugMode) strOut = (String)Utils.GetCache(strCacheKey);

                                if (String.IsNullOrEmpty(strOut))
                                {
                                    var buyCtrl = new NBrightBuyController();
                                    var rpTempl = buyCtrl.GetTemplateData(-1, templName, lang, _settings, StoreSettings.Current.DebugMode);

                                    //remove templName from template, so we don't get a loop.
                                    if (rpTempl.Contains(templName)) rpTempl = rpTempl.Replace(templName, "");
                                    //build models list

                                    var objQual = DotNetNuke.Data.DataProvider.Instance().ObjectQualifier;
                                    var dbOwner = DotNetNuke.Data.DataProvider.Instance().DatabaseOwner;
                                    if (cascade.ToLower() == "true")
                                    {
                                        strFilter = strFilter + " and NB1.[ItemId] in (select parentitemid from " + dbOwner + "[" + objQual + "NBrightBuy] where (typecode = 'CATCASCADE' or typecode = 'CATXREF') and XrefItemId = " + nbi.categoryid.ToString("") + ") ";
                                    }
                                    else
                                        strFilter = strFilter + " and NB1.[ItemId] in (select parentitemid from " + dbOwner + "[" + objQual + "NBrightBuy] where typecode = 'CATXREF' and XrefItemId = " + nbi.categoryid.ToString("") + ") ";

                                    if (strOrder == "{bycategoryproduct}") strOrder += nbi.categoryid.ToString(""); // do special custom sort in each cateogry

                                    if (filter != "") strFilter += " AND " + filter;

                                    var objL = buyCtrl.GetDataList(PortalSettings.Current.PortalId, -1, "PRD", "PRDLANG", Utils.GetCurrentCulture(), strFilter, strOrder);

                                    // inject the categoryid into the data, so the entryurl can have the correct catid
                                    foreach (var i in objL)
                                    {
                                        i.SetXmlProperty("genxml/categoryid", nbi.categoryid.ToString(""));
                                    }

                                    var itemTemplate = NBrightBuyUtils.GetGenXmlTemplate(rpTempl, _settings, PortalSettings.Current.HomeDirectory,visibleStatus);
                                    strOut = GenXmlFunctions.RenderRepeater(objL, itemTemplate);
                                    if (!StoreSettings.Current.DebugMode) NBrightBuyUtils.SetModCache(-1, strCacheKey, strOut);
                                }

                            }
                        }
                        catch (Exception exc)
                        {
                            strOut = "ERROR: <br/>" + exc;
                        }

                    }

                }
                lc.Text = strOut;

            }
            catch (Exception)
            {
                lc.Text = "";
            }
        }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:85,代码来源:GenXmlTemplateExt.cs

示例4: GetRelatedProducts

 public List<NBrightInfo> GetRelatedProducts()
 {
     var objCtrl = new NBrightBuyController();
     var strSelectedIds = "";
     var arylist = objCtrl.GetList(_portalId, -1, "PRDXREF", " and NB1.parentitemid = " + Info.ItemID.ToString(""));
     foreach (var obj in arylist)
     {
         strSelectedIds += obj.XrefItemId.ToString("") + ",";
     }
     var relList = new List<NBrightInfo>();
     if (strSelectedIds.TrimEnd(',') != "")
     {
         var strFilter = " and NB1.[ItemId] in (" + strSelectedIds.TrimEnd(',') + ") ";
         relList = objCtrl.GetDataList(_portalId, -1, "PRD", "PRDLANG", _lang, strFilter, "");
     }
     return relList;
 }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:17,代码来源:ProductData.cs

示例5: GetCatList

        public static List<NBrightInfo> GetCatList(int parentid = 0, string groupref = "", String lang = "")
        {
            if (lang == "") lang = Utils.GetCurrentCulture();

            var strFilter = "";
            if (groupref == "" || groupref == "0") // Because we've introduced Properties (for non-category groups) we will only display these if cat is not selected.
                strFilter += " and [XMLData].value('(genxml/dropdownlist/ddlgrouptype)[1]','nvarchar(max)') != 'cat' ";
            else
            {
                if (groupref == "cat") strFilter = " and NB1.ParentItemId = " + parentid + " "; // only category have multipel levels.
                strFilter += " and [XMLData].value('(genxml/dropdownlist/ddlgrouptype)[1]','nvarchar(max)') = '" + groupref + "' ";
            }

            var objCtrl = new NBrightBuyController();
            var levelList = objCtrl.GetDataList(PortalSettings.Current.PortalId, -1, "CATEGORY", "CATEGORYLANG", lang, strFilter, " order by [XMLData].value('(genxml/hidden/recordsortorder)[1]','decimal(10,2)') ", true);

            var grpCtrl = new GrpCatController(lang);

            foreach (var c in levelList)
            {
                var g = grpCtrl.GetCategory(c.ItemID);
                if (g != null) c.SetXmlProperty("genxml/entrycount", g.entrycount.ToString(""));
            }

            return levelList;
        }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:26,代码来源:NBrightBuyUtils.cs

示例6: GetCategoryGroups

 public static List<NBrightInfo> GetCategoryGroups(String lang, Boolean debugMode = false)
 {
     var objCtrl = new NBrightBuyController();
     var levelList = objCtrl.GetDataList(PortalSettings.Current.PortalId, -1, "GROUP", "GROUPLANG", lang, "", " order by [XMLData].value('(genxml/hidden/recordsortorder)[1]','decimal(10,2)') ", debugMode);
     return levelList;
 }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:6,代码来源:NBrightBuyUtils.cs

示例7: ValidateStore

        public static int ValidateStore()
        {
            // clear all cache to start.
            DataCache.ClearCache();

            var objCtrl = new NBrightBuyController();
            var errcount = 0;

            // Validate Products
            var prodList = objCtrl.GetList(DotNetNuke.Entities.Portals.PortalSettings.Current.PortalId, -1, "PRD");
            foreach (var p in prodList)
            {
                var prodData = ProductUtils.GetProductData(p.ItemID, StoreSettings.Current.EditLanguage);
                errcount += prodData.Validate();
            }

            // Validate Categories
            var catList = objCtrl.GetList(DotNetNuke.Entities.Portals.PortalSettings.Current.PortalId, -1, "CATEGORY");
            foreach (var c in catList)
            {
                var catData = CategoryUtils.GetCategoryData(c.ItemID, StoreSettings.Current.EditLanguage);
                errcount += catData.Validate();
            }

            // Validate Groups
            var grpList = objCtrl.GetList(DotNetNuke.Entities.Portals.PortalSettings.Current.PortalId, -1, "GROUP");
            foreach (var c in grpList)
            {
                var grpData = new GroupData(c.ItemID, StoreSettings.Current.EditLanguage);
                errcount += grpData.Validate();
            }

            // reset catid from catref
            var l = objCtrl.GetDataList(PortalSettings.Current.PortalId, -1, "SETTINGS", "", Utils.GetCurrentCulture(), " and [XMLdata].value('(genxml/catref)[1]','nvarchar(max)') != ''","");
            foreach (var s in l)
            {
                var info = ModuleSettingsResetCatIdFromRef(s);
                objCtrl.Update(info);
            }

            return errcount;
        }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:42,代码来源:NBrightBuyUtils.cs

示例8: GetCategoryGroups

 public static List<NBrightInfo> GetCategoryGroups(string lang, Boolean debugMode = false, string groupType = "")
 {
     var filter = "";
     if (groupType != "") filter = " and [XMLData].value('(genxml/dropdownlist/grouptype)[1]','nvarchar(max)') = '" + groupType + "' ";
     var objCtrl = new NBrightBuyController();
     var levelList = objCtrl.GetDataList(PortalSettings.Current.PortalId, -1, "GROUP", "GROUPLANG", lang, filter, " order by [XMLData].value('(genxml/hidden/recordsortorder)[1]','decimal(10,2)') ", debugMode);
     return levelList;
 }
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:8,代码来源:NBrightBuyUtils.cs


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