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


C# NBrightBuyController.GetList方法代码示例

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


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

示例1: CalcGroupPromo

 public static string CalcGroupPromo(int portalId)
 {
     var objCtrl = new NBrightBuyController();
     var l = objCtrl.GetList(portalId, -1, "CATEGORYPROMO", "", "", 0, 0, 0, 0, Utils.GetCurrentCulture());
     foreach (var p in l)
     {
         CalcGroupPromoItem(p);
     }
     return "OK";
 }
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:10,代码来源:PromoUtils.cs

示例2: 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

示例3: Copy

        public int Copy()
        {
            var objCtrl = new NBrightBuyController();

            //Copy Base record
            var dr = (NBrightInfo)DataRecord.Clone();
            dr.ItemID = -1;
            dr.SetXmlProperty("genxml/importref", Utils.GetUniqueKey());
            var newid = objCtrl.Update(dr);

            // copy all language records
            var l = objCtrl.GetList(_portalId, -1, "PRDLANG", " and NB1.ParentItemId = " + Info.ItemID.ToString(""));
            foreach (var dlr in l)
            {
                dlr.ParentItemId = newid;
                dlr.ItemID = -1;
                objCtrl.Update(dlr);
            }

            // copy CATXREF records
            l = objCtrl.GetList(_portalId, -1, "CATXREF", " and NB1.ParentItemId = " + Info.ItemID.ToString(""));
            foreach (var dr1 in l)
            {
                dr1.ParentItemId = newid;
                dr1.ItemID = -1;
                dr1.GUIDKey = dr1.GUIDKey.Replace("x" + Info.ItemID.ToString(""), "x" + newid.ToString(""));
                objCtrl.Update(dr1);
            }

            // copy CATCASCADE records
            l = objCtrl.GetList(_portalId, -1, "CATCASCADE", " and NB1.ParentItemId = " + Info.ItemID.ToString(""));
            foreach (var dr2 in l)
            {
                dr2.ParentItemId = newid;
                dr2.ItemID = -1;
                dr2.GUIDKey = dr2.GUIDKey.Replace("x" + Info.ItemID.ToString(""), "x" + newid.ToString(""));
                objCtrl.Update(dr2);
            }

            // copy PRDXREF records
            l = objCtrl.GetList(_portalId, -1, "PRDXREF", " and NB1.ParentItemId = " + Info.ItemID.ToString(""));
            foreach (var dr3 in l)
            {
                dr3.ParentItemId = newid;
                dr3.ItemID = -1;
                dr3.GUIDKey = dr3.GUIDKey.Replace("x" + Info.ItemID.ToString(""), "x" + newid.ToString(""));
                objCtrl.Update(dr);
            }

            return newid;
        }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:51,代码来源:ProductData.cs

示例4: AddProperty

 public void AddProperty(String propertyref)
 {
     var objCtrl = new NBrightBuyController();
     var pinfo = objCtrl.GetByGuidKey(_portalId, -1,"CATEGORY",propertyref);
     if (pinfo == null)
     {
         // not using the unique ref, look for the friendly propertyref name.
         var l = objCtrl.GetList(_portalId, -1, "CATEGORY", " and [XMLData].value('(genxml/textbox/propertyref)[1]','nvarchar(max)') = '" + propertyref + "' ", "", 1);
         if (l.Any()) pinfo = l[0];
     }
     if (pinfo != null && Utils.IsNumeric(pinfo.ItemID) && pinfo.ItemID > 0) AddCategory(pinfo.ItemID);
 }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:12,代码来源:ProductData.cs

示例5: Validate

        public int Validate()
        {
            var errorcount = 0;

            var objCtrl = new NBrightBuyController();

            SetGuidKey();
            objCtrl.Update(DataRecord);

            DataRecord.ValidateXmlFormat();
            if (DataLangRecord == null)
            {
                // we have no datalang record for this language, so get an existing one and save it.
                var l = objCtrl.GetList(_portalId, -1, "PRDLANG", " and NB1.ParentItemId = " + Info.ItemID.ToString(""));
                if (l.Count > 0)
                    DataLangRecord = (NBrightInfo) l[0].Clone();
                else
                    DataLangRecord = new NBrightInfo(true);

                DataLangRecord.ItemID = -1;
                DataLangRecord.ValidateXmlFormat();
                DataLangRecord.TypeCode = "PRDLANG";
                DataLangRecord.ParentItemId = Info.ItemID;
                DataLangRecord.Lang = _lang;
                objCtrl.Update(DataLangRecord);
            }

            //Fix image paths
            var lp = 1;
            foreach (var i in Imgs)
            {
                if (!i.GetXmlProperty("genxml/hidden/imageurl").StartsWith(_storeSettings.FolderImages))
                {
                    var iname = Path.GetFileName(i.GetXmlProperty("genxml/hidden/imagepath"));
                    DataRecord.SetXmlProperty("genxml/imgs/genxml[" + lp + "]/hidden/imageurl", _storeSettings.FolderImages.TrimEnd('/') + "/" + iname);
                    errorcount += 1;
                }
                if (!i.GetXmlProperty("genxml/hidden/imagepath").StartsWith(_storeSettings.FolderImagesMapPath))
                {
                    var iname = Path.GetFileName(i.GetXmlProperty("genxml/hidden/imagepath"));
                    DataRecord.SetXmlProperty("genxml/imgs/genxml[" + lp + "]/hidden/imagepath", _storeSettings.FolderImagesMapPath.TrimEnd('\\') + "\\" + iname);
                    errorcount += 1;
                }
                lp += 1;
            }
            //Fix document paths
            lp = 1;
            foreach (var d in Docs)
            {
                if (!d.GetXmlProperty("genxml/hidden/filepath").StartsWith(_storeSettings.FolderDocumentsMapPath))
                {
                    DataRecord.SetXmlProperty("genxml/docs/genxml/hidden/filepath", _storeSettings.FolderDocumentsMapPath.TrimEnd('\\') + "\\" + d.GetXmlProperty("genxml/textbox/txtfilename"));
                    errorcount += 1;
                }
                lp += 1;
            }

            if (errorcount > 0) objCtrl.Update(DataRecord); // update if we find a error

            // fix langauge records
            foreach (var lang in DnnUtils.GetCultureCodeList(_portalId))
            {
                var l = objCtrl.GetList(_portalId, -1, "PRDLANG", " and NB1.ParentItemId = " + Info.ItemID.ToString("") + " and NB1.Lang = '" + lang + "'");
                if (l.Count == 0 && DataLangRecord != null)
                {
                    var nbi = (NBrightInfo)DataLangRecord.Clone();
                    nbi.ItemID = -1;
                    nbi.Lang = lang;
                    objCtrl.Update(nbi);
                    errorcount += 1;
                }
                if (l.Count > 1)
                {
                    // we have more records than shoudl exists, remove any old ones.
                    var l2 = objCtrl.GetList(_portalId, -1, "PRDLANG", " and NB1.ParentItemId = " + Info.ItemID.ToString("") + " and NB1.Lang = '" + lang + "'", "order by Modifieddate desc");
                    var lp2 = 1;
                    foreach (var i in l2)
                    {
                        if (lp2 >= 2) objCtrl.Delete(i.ItemID);
                        lp2 += 1;
                    }
                }
            }

            return errorcount;
        }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:86,代码来源:ProductData.cs

示例6: Validate

        public int Validate()
        {
            var errorcount = 0;

            var objCtrl = new NBrightBuyController();

            SetGuidKey();
            objCtrl.Update(DataRecord);

            DataRecord.ValidateXmlFormat();
            if (DataLangRecord == null)
            {
                // we have no datalang record for this language, so get an existing one and save it.
                var l = objCtrl.GetList(_portalId, -1, _typeLangCode, " and NB1.ParentItemId = " + Info.ItemID.ToString(""));
                if (l.Count > 0)
                    DataLangRecord = (NBrightInfo) l[0].Clone();
                else
                    DataLangRecord = new NBrightInfo(true);

                DataLangRecord.ItemID = -1;
                DataLangRecord.ValidateXmlFormat();
                DataLangRecord.TypeCode = _typeLangCode;
                DataLangRecord.ParentItemId = Info.ItemID;
                DataLangRecord.Lang = _lang;
                objCtrl.Update(DataLangRecord);
            }

            //Fix image paths
            var lp = 1;
            foreach (var i in Imgs)
            {
                if (!File.Exists(i.GetXmlProperty("genxml/hidden/imagepath"))) // products shared across portals may have different image path.
                {
                    if (!i.GetXmlProperty("genxml/hidden/imageurl").StartsWith(_storeSettings.FolderImages))
                    {
                        var iname = Path.GetFileName(i.GetXmlProperty("genxml/hidden/imagepath"));
                        DataRecord.SetXmlProperty("genxml/imgs/genxml[" + lp + "]/hidden/imageurl", _storeSettings.FolderImages.TrimEnd('/') + "/" + iname);
                        errorcount += 1;
                    }
                    if (!i.GetXmlProperty("genxml/hidden/imagepath").StartsWith(_storeSettings.FolderImagesMapPath))
                    {
                        var iname = Path.GetFileName(i.GetXmlProperty("genxml/hidden/imagepath"));
                        DataRecord.SetXmlProperty("genxml/imgs/genxml[" + lp + "]/hidden/imagepath", _storeSettings.FolderImagesMapPath.TrimEnd('\\') + "\\" + iname);
                        errorcount += 1;
                    }
                }
                lp += 1;
            }
            //Fix document paths
            lp = 1;
            foreach (var d in Docs)
            {
                if (!File.Exists(d.GetXmlProperty("genxml/hidden/filepath"))) // products shared across portals may have different path.
                {
                    if (!d.GetXmlProperty("genxml/hidden/filepath").StartsWith(_storeSettings.FolderDocumentsMapPath))
                    {
                        var fname = d.GetXmlProperty("genxml/textbox/txtfilename");
                        if (d.GetXmlProperty("genxml/hidden/filerelpath") != "")
                        {
                            fname = Path.GetFileName("D:" + d.GetXmlProperty("genxml/hidden/filerelpath").Replace("/", "\\"));
                        }
                        DataRecord.SetXmlProperty("genxml/docs/genxml/hidden/filepath", _storeSettings.FolderDocumentsMapPath.TrimEnd('\\') + "\\" + fname);
                        errorcount += 1;
                    }
                }
                lp += 1;
            }

            if (errorcount > 0) objCtrl.Update(DataRecord); // update if we find a error

            // fix langauge records
            foreach (var lang in DnnUtils.GetCultureCodeList(_portalId))
            {
                var l = objCtrl.GetList(_portalId, -1, _typeLangCode, " and NB1.ParentItemId = " + Info.ItemID.ToString("") + " and NB1.Lang = '" + lang + "'");
                if (l.Count == 0 && DataLangRecord != null)
                {
                    var nbi = (NBrightInfo)DataLangRecord.Clone();
                    nbi.ItemID = -1;
                    nbi.Lang = lang;
                    objCtrl.Update(nbi);
                    errorcount += 1;
                }
                if (l.Count > 1)
                {
                    // we have more records than should exists, remove any old ones.
                    var l2 = objCtrl.GetList(_portalId, -1, _typeLangCode, " and NB1.ParentItemId = " + Info.ItemID.ToString("") + " and NB1.Lang = '" + lang + "'", "order by Modifieddate desc");
                    var lp2 = 1;
                    foreach (var i in l2)
                    {
                        if (lp2 >= 2) objCtrl.Delete(i.ItemID);
                        errorcount += 1;
                        lp2 += 1;
                    }
                }
            }

            // remove duplicate category xrefs.
            var catlist = GetCategories();
            foreach (var c in catlist)
            {
//.........这里部分代码省略.........
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:101,代码来源:ProductData.cs

示例7: CopyAllCatXref

        private String CopyAllCatXref(HttpContext context,Boolean moverecords = false)
        {
            var strOut = NBrightBuyUtils.GetResxMessage("general_fail");
            try
            {
                var settings = GetAjaxFields(context);
                var strFilter = " and XrefItemId = {Settings:itemid} ";

                strFilter = Utils.ReplaceSettingTokens(strFilter, settings);

                var newcatid = "";
                if (settings.ContainsKey("selectedcatid")) newcatid = settings["selectedcatid"];

                if (Utils.IsNumeric(newcatid) && settings.ContainsKey("itemid"))
                {
                    var objCtrl = new NBrightBuyController();
                    var objList = objCtrl.GetList(PortalSettings.Current.PortalId, -1, "CATXREF", strFilter);

                    foreach (var obj in objList)
                    {
                        var strGuid = newcatid + "x" + obj.ParentItemId.ToString("");
                        var nbi = objCtrl.GetByGuidKey(PortalSettings.Current.PortalId, -1, "CATXREF", strGuid);
                        if (nbi == null)
                        {
                            if (!moverecords) obj.ItemID = -1;
                            obj.XrefItemId = Convert.ToInt32(newcatid);
                            obj.GUIDKey = strGuid;
                            obj.XMLData = null;
                            obj.TextData = null;
                            obj.Lang = null;
                            objCtrl.Update(obj);
                            //add all cascade xref
                            var objGrpCtrl = new GrpCatController(_lang, true);
                            var parentcats = objGrpCtrl.GetCategory(Convert.ToInt32(newcatid));
                            foreach (var p in parentcats.Parents)
                            {
                                strGuid = p.ToString("") + "x" + obj.ParentItemId.ToString("");
                                nbi = objCtrl.GetByGuidKey(PortalSettings.Current.PortalId, -1, "CATCASCADE", strGuid);
                                if (nbi == null)
                                {
                                    obj.XrefItemId = p;
                                    obj.TypeCode = "CATCASCADE";
                                    obj.GUIDKey = strGuid;
                                    objCtrl.Update(obj);
                                }
                            }
                        }
                    }

                    if (moverecords) DeleteAllCatXref(context);

                    strOut = NBrightBuyUtils.GetResxMessage();
                }

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

示例8: GetRelatedCats

        public static string GetRelatedCats(int portalId, string parentItemId, string cultureCode, string templatePrefix, string controlMapPath, Boolean AllowCache = true)
        {
            var strOut = "";
            if (Utils.IsNumeric(parentItemId))
            {
                if (!AllowCache)
                {
                    //Remove any cache for the module -1, we don't want any cache in BO
                    //All xref records are portal wide, hence -1 in cahce key.
                    NBrightBuyUtils.RemoveModCache(-1);
                }

                var objCtrl = new NBrightBuyController();

                var templCtrl = new TemplateController(controlMapPath);

                var hTempl = templCtrl.GetTemplateData(templatePrefix + "_" + ModuleEventCodes.selectedheader + ".html", Utils.GetCurrentCulture());
                var bTempl = templCtrl.GetTemplateData(templatePrefix + "_" + ModuleEventCodes.selectedbody + ".html", Utils.GetCurrentCulture());
                var fTempl = templCtrl.GetTemplateData(templatePrefix + "_" + ModuleEventCodes.selectedfooter + ".html", Utils.GetCurrentCulture());

                // replace Settings tags for ajax to work.
                hTempl = Utils.ReplaceUrlTokens(hTempl);
                bTempl = Utils.ReplaceUrlTokens(bTempl);
                fTempl = Utils.ReplaceUrlTokens(fTempl);

                var strFilter = " and parentitemid = " + parentItemId;
                var strOrderBy = GenXmlFunctions.GetSqlOrderBy(hTempl);
                if (strOrderBy == "")
                {
                    strOrderBy = GenXmlFunctions.GetSqlOrderBy(bTempl);
                }

                var l = objCtrl.GetList(portalId, -1, "CATXREF", strFilter, strOrderBy);
                var objList = new List<NBrightInfo>();

                foreach (var objXref in l)
                {
                    var o = objCtrl.Get(objXref.XrefItemId, "CATEGORYLANG", cultureCode);
                    if (o != null)
                    {
                        if (objXref.GetXmlProperty("genxml/hidden/defaultcat") != "")
                        {
                            // set the default flag in the category, for display in the entry only.
                            o.SetXmlProperty("genxml/hidden/defaultcat", "True");
                        }
                        o.GUIDKey = objXref.ItemID.ToString(); // overwrite with xref itemid for delete ajax action.
                        o.TextData = o.GetXmlProperty("genxml/lang/genxml/textbox/txtname"); // set for sort
                        o.Lang = cultureCode; // set lang so the GenXmlTemplateExt can pickup the edit langauge.
                        objList.Add(o);
                        objList.Sort(delegate(NBrightInfo p1, NBrightInfo p2) { return p1.TextData.CompareTo(p2.TextData); });
                    }
                }

                var obj = new NBrightInfo();
                strOut += GenXmlFunctions.RenderRepeater(obj, hTempl);
                strOut += GenXmlFunctions.RenderRepeater(objList, bTempl);
                strOut += GenXmlFunctions.RenderRepeater(obj, fTempl);

            }

            return strOut;
        }
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:62,代码来源:ProductUtils.cs

示例9: GetData

        private String GetData(HttpContext context,bool clearCache = false)
        {
            try
            {
                var objCtrl = new NBrightBuyController();
                var strOut = "";
                //get uploaded params
                var ajaxInfo = NBrightBuyUtils.GetAjaxFields(context);
                SetContextLangauge(ajaxInfo); // Ajax breaks context with DNN, so reset the context language to match the client.

                var itemid = ajaxInfo.GetXmlProperty("genxml/hidden/itemid");
                var typeCode = ajaxInfo.GetXmlProperty("genxml/hidden/typecode");
                var newitem = ajaxInfo.GetXmlProperty("genxml/hidden/newitem");
                var selecteditemid = ajaxInfo.GetXmlProperty("genxml/hidden/selecteditemid");
                var moduleid = ajaxInfo.GetXmlProperty("genxml/hidden/moduleid");
                var editlang = ajaxInfo.GetXmlProperty("genxml/hidden/editlang");
                if (editlang == "") editlang = _lang;

                if (!Utils.IsNumeric(moduleid)) moduleid = "-2"; // use moduleid -2 for razor

                if (clearCache) NBrightBuyUtils.RemoveModCache(Convert.ToInt32(moduleid));

                if (newitem == "new") selecteditemid = AddNew(moduleid, typeCode);

                var templateControl = "/DesktopModules/NBright/NBrightBuy/Providers/PromoProvider";

                if (Utils.IsNumeric(selecteditemid))
                {
                    // do edit field data if a itemid has been selected
                    var obj = objCtrl.Get(Convert.ToInt32(selecteditemid), "",editlang);
                    strOut = NBrightBuyUtils.RazorTemplRender(typeCode.ToLower() + "fields.cshtml", Convert.ToInt32(moduleid), _lang + itemid + editlang + selecteditemid, obj, templateControl, _lang);
                }
                else
                {
                    // Return list of items
                    var l = objCtrl.GetList(PortalSettings.Current.PortalId, Convert.ToInt32(moduleid), typeCode, "", " order by [XMLData].value('(genxml/textbox/validuntil)[1]','nvarchar(50)'), ModifiedDate desc", 0, 0, 0, 0, editlang);
                    strOut = NBrightBuyUtils.RazorTemplRender(typeCode.ToLower() + "list.cshtml", Convert.ToInt32(moduleid), _lang + editlang, l, templateControl, _lang);
                }

                return strOut;

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

示例10: Validate

        public int Validate()
        {
            var errorcount = 0;
            var objCtrl = new NBrightBuyController();

            // default any undefined group type as category (I think quickcategory v1.0.0 plugin causes this)
            if (DataRecord.GetXmlProperty("genxml/dropdownlist/ddlgrouptype") == "")
            {
                DataRecord.SetXmlProperty("genxml/dropdownlist/ddlgrouptype", "cat");
                objCtrl.Update(DataRecord);
            }

            if (GroupType == "cat")
            {
                // the base category ref cannot have language dependant refs, we therefore just use a unique key
                var catref = DataRecord.GetXmlProperty("genxml/textbox/txtcategoryref");
                if (catref == "" || DataRecord.GUIDKey == "")
                {
                    catref = Utils.GetUniqueKey().ToLower();
                    DataRecord.SetXmlProperty("genxml/textbox/txtcategoryref", catref);
                    DataRecord.GUIDKey = catref;
                    errorcount += 1;
                }

                if (DataRecord.GetXmlProperty("genxml/dropdownlist/ddlparentcatid") != DataRecord.ParentItemId.ToString())
                {
                    DataRecord.SetXmlProperty("genxml/dropdownlist/ddlparentcatid", DataRecord.ParentItemId.ToString());
                }

            }

            DataRecord.ValidateXmlFormat();

            if (DataLangRecord == null)
            {
                // we have no datalang record for this language, so get an existing one and save it.
                var l = objCtrl.GetList(_portalId, -1, "CATEGORYLANG", " and NB1.ParentItemId = " + Info.ItemID.ToString(""));
                if (l.Count > 0)
                {
                    DataLangRecord = (NBrightInfo)l[0].Clone();
                    DataLangRecord.ItemID = -1;
                    DataLangRecord.Lang = _lang;
                    DataLangRecord.ValidateXmlFormat();
                    objCtrl.Update(DataLangRecord);
                }
            }

            // fix image
            var imgpath = DataRecord.GetXmlProperty("genxml/hidden/imagepath");
            var imgurl = DataRecord.GetXmlProperty("genxml/hidden/imageurl");
            var imagefilename = Path.GetFileName(imgpath);
            if (!imgpath.StartsWith(StoreSettings.Current.FolderImagesMapPath))
            {
                    DataRecord.SetXmlProperty("genxml/hidden/imagepath", StoreSettings.Current.FolderImagesMapPath.TrimEnd('\\') + "\\" + imagefilename);
                errorcount += 1;
            }
            if (imagefilename == "")
            {
                DataRecord.SetXmlProperty("genxml/hidden/imagepath", "");
                errorcount += 1;
            }
            if (!imgurl.StartsWith(StoreSettings.Current.FolderImages))
            {
                    DataRecord.SetXmlProperty("genxml/hidden/imageurl", StoreSettings.Current.FolderImages.TrimEnd('/') + "/" + imagefilename);
                errorcount += 1;
            }
            if (imagefilename == "")
            {
                DataRecord.SetXmlProperty("genxml/hidden/imageurl", "");
                errorcount += 1;
            }

            // check guidkey is correct
            if (DataRecord.GUIDKey != CategoryRef)
            {
                DataRecord.GUIDKey = CategoryRef;
                errorcount += 1;
            }

            if (errorcount > 0) objCtrl.Update(DataRecord); // update if we find a error

            // fix langauge records
            foreach (var lang in DnnUtils.GetCultureCodeList(_portalId))
            {
                var l = objCtrl.GetList(_portalId, -1, "CATEGORYLANG", " and NB1.ParentItemId = " + Info.ItemID.ToString("") + " and NB1.Lang = '" + lang + "'");
                if (l.Count == 0 && DataLangRecord != null)
                {
                    var nbi = (NBrightInfo)DataLangRecord.Clone();
                    nbi.ItemID = -1;
                    nbi.Lang = lang;
                    objCtrl.Update(nbi);
                    errorcount += 1;
                }
                if (l.Count > 1)
                {
                    // we have more records than shoudl exists, remove any old ones.
                    var l2 = objCtrl.GetList(_portalId, -1, "CATEGORYLANG", " and NB1.ParentItemId = " + Info.ItemID.ToString("") + " and NB1.Lang = '" + lang + "'", "order by Modifieddate desc");
                    var lp = 1;
                    foreach (var i in l2)
                    {
//.........这里部分代码省略.........
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:101,代码来源:CategoryData.cs

示例11: DoProductIdx

        private String DoProductIdx(DotNetNuke.Entities.Portals.PortalInfo portal, DateTime lastrun, Boolean debug)
        {
            if (debug)
            {
                InternalSearchController.Instance.DeleteAllDocuments(portal.PortalID, SearchHelper.Instance.GetSearchTypeByName("tab").SearchTypeId);
            }
            var searchDocs = new List<SearchDocument>();
            var culturecodeList = DnnUtils.GetCultureCodeList(portal.PortalID);
            var storeSettings = new StoreSettings(portal.PortalID);
            foreach (var lang in culturecodeList)
            {
                var strContent = "";
                // select all products
                var objCtrl = new NBrightBuyController();
                var strFilter = " and NB1.ModifiedDate > convert(datetime,'" + lastrun.ToString("s") + "') ";
                if (debug) strFilter = "";
                var l = objCtrl.GetList(portal.PortalID, -1, "PRD", strFilter);

                foreach (var p in l)
                {
                    var prodData = new ProductData(p.ItemID, lang);

                    strContent = prodData.Info.GetXmlProperty("genxml/textbox/txtproductref") + " : " + prodData.SEODescription + " " + prodData.SEOName + " " + prodData.SEOTagwords + " " + prodData.SEOTitle;

                    if (strContent != "")
                    {
                        var tags = new List<String>();
                        tags.Add("nbsproduct");

                        //Get the description string
                        string strDescription = HtmlUtils.Shorten(HtmlUtils.Clean(strContent, false), 100, "...");
                        var searchDoc = new SearchDocument();
                        // Assigns as a Search key the SearchItems'
                        searchDoc.UniqueKey = prodData.Info.ItemID.ToString("");
                        searchDoc.QueryString = "ref=" + prodData.Info.GetXmlProperty("genxml/textbox/txtproductref");
                        searchDoc.Title = prodData.ProductName;
                        searchDoc.Body = strContent;
                        searchDoc.Description = strDescription;
                        if (debug)
                            searchDoc.ModifiedTimeUtc = DateTime.Now.Date;
                        else
                            searchDoc.ModifiedTimeUtc = prodData.Info.ModifiedDate;
                        searchDoc.AuthorUserId = 1;
                        searchDoc.TabId = storeSettings.ProductDetailTabId;
                        searchDoc.PortalId = portal.PortalID;
                        searchDoc.SearchTypeId = SearchHelper.Instance.GetSearchTypeByName("tab").SearchTypeId;
                        searchDoc.CultureCode = lang;
                        searchDoc.Tags = tags;
                        //Add Module MetaData
                        searchDoc.ModuleDefId = 0;
                        searchDoc.ModuleId = 0;

                        searchDocs.Add(searchDoc);
                    }
                }
            }

            //Index
            InternalSearchController.Instance.AddSearchDocuments(searchDocs);
            InternalSearchController.Instance.Commit();

            return " - NBS-DNNIDX scheduler ACTIVATED ";
        }
开发者ID:DNNMonster,项目名称:NBrightBuyDnnIdx,代码行数:63,代码来源:DnnIdxProvider.cs

示例12: GetDirectChildren

 public List<NBrightInfo> GetDirectChildren()
 {
     var objCtrl = new NBrightBuyController();
     var l = objCtrl.GetList(_portalId, -1, "CATEGORY", " and NB1.ParentItemId = " + Info.ItemID.ToString(""));
     return l;
 }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:6,代码来源:CategoryData.cs

示例13: GetGrpCatListFromDatabase

        private List<GroupCategoryData> GetGrpCatListFromDatabase(String lang = "")
        {
            // this process seems to be creating an error on DB connection after the cache is release.
            //[TODO: re-write this code to stop DB conection failure. For now Module level caching has been increased to 2 days to stop this processing re-running]

            var objCtrl = new NBrightBuyController();
            const string strOrderBy = " order by [XMLData].value('(genxml/hidden/recordsortorder)[1]','decimal(10,2)') ";
            var grpcatList = new List<GroupCategoryData>();

            var l = objCtrl.GetList(PortalSettings.Current.PortalId, -1, "CATEGORY", "", strOrderBy, 0, 0, 0, 0, "", "");
            var lg = objCtrl.GetList(PortalSettings.Current.PortalId, -1, "CATEGORYLANG", "and NB1.lang = '" + lang + "'", "", 0, 0, 0, 0, "", "");
            var lx = objCtrl.GetList(PortalSettings.Current.PortalId, -1, "CATCASCADE", "", "", 0, 0, 0, 0, "", "");
            var lx2 = objCtrl.GetList(PortalSettings.Current.PortalId, -1, "CATXREF", "", "", 0, 0, 0, 0, "", "");
            lx.AddRange(lx2);
            foreach (var i in l)
            {
                var grpcat = new GroupCategoryData();
                grpcat.categoryid = i.ItemID;
                grpcat.recordsortorder = i.GetXmlPropertyDouble("genxml/hidden/recordsortorder");
                grpcat.imageurl = i.GetXmlProperty("genxml/hidden/imageurl");
                grpcat.categoryref = i.GetXmlProperty("genxml/textbox/txtcategoryref");
                grpcat.propertyref = i.GetXmlProperty("genxml/textbox/propertyref");
                grpcat.archived = i.GetXmlPropertyBool("genxml/checkbox/chkarchived");
                grpcat.ishidden = i.GetXmlPropertyBool("genxml/checkbox/chkishidden");
                grpcat.disabled = i.GetXmlPropertyBool("genxml/checkbox/chkdisable");
                grpcat.grouptyperef = i.GetXmlProperty("genxml/dropdownlist/ddlgrouptype");
                grpcat.parentcatid = i.ParentItemId;
                grpcat.entrycount = GetEntryCount(lx, grpcat.categoryid);
                if (GroupsDictionary.ContainsKey(grpcat.grouptyperef)) grpcat.groupname = GroupsDictionary[grpcat.grouptyperef];

                // get the language data
                var langItem =  GetLangData(lg,grpcat.categoryid);
                if (langItem != null)
                {
                    grpcat.categoryname = langItem.GetXmlProperty("genxml/textbox/txtcategoryname");
                    grpcat.categorydesc = langItem.GetXmlProperty("genxml/textbox/txtcategorydesc");
                    grpcat.seoname = langItem.GetXmlProperty("genxml/textbox/txtseoname");
                    if (grpcat.seoname == "") grpcat.seoname = langItem.GetXmlProperty("genxml/textbox/txtcategoryname");
                    grpcat.metadescription = langItem.GetXmlProperty("genxml/textbox/txtmetadescription");
                    grpcat.metakeywords = langItem.GetXmlProperty("genxml/textbox/txtmetakeywords");
                    grpcat.seopagetitle = langItem.GetXmlProperty("genxml/textbox/txtseopagetitle");
                    grpcat.message = langItem.GetXmlProperty("genxml/edt/message");
                    grpcat.categoryrefGUIDKey = langItem.GUIDKey;
                }

                //get parents
                var p = GetParentList(l,grpcat.categoryid);
                foreach (var pi in p)
                    grpcat.Parents.Add(pi.ItemID);

                grpcatList.Add(grpcat);
            }

            // we don;t have the depth number at this point, so use recussive call to calc it.
            CalcCategoryDepthList(grpcatList, 0, 0);

            return grpcatList;
        }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:58,代码来源:GrpCatController.cs

示例14: GetProductCategories

        /// <summary>
        /// Select categories linked to product, by groupref
        /// </summary>
        /// <param name="productid"></param>
        /// <param name="groupref">groupref for select, "" = all, "cat"= Category only, "!cat" = all non-category, "{groupref}"=this group only</param>
        /// <param name="cascade">get all cascade records to get all parent categories</param>
        /// <returns></returns>
        public List<GroupCategoryData> GetProductCategories(int productid, String groupref = "", Boolean cascade = false)
        {
            var objCtrl = new NBrightBuyController();
            var catxrefList = objCtrl.GetList(PortalSettings.Current.PortalId, -1, "CATXREF", " and NB1.[ParentItemId] = " + productid);

            if (cascade)
            {
                var catcascadeList = objCtrl.GetList(PortalSettings.Current.PortalId, -1, "CATCASCADE", " and NB1.[ParentItemId] = " + productid);
                foreach (var c in catcascadeList)
                {
                    catxrefList.Add(c);
                }
            }

            var notcat = "";
            if (groupref == "!cat")
            {
                groupref = "";
                notcat = "cat";
            }

            var joinItems = (from d1 in GrpCategoryList
                             join d2 in catxrefList on d1.categoryid equals d2.XrefItemId
                             where (d1.grouptyperef == groupref || groupref == "") && d1.grouptyperef != notcat
                             select d1).OrderBy(d1 => d1.grouptyperef).ThenBy(d1 => d1.breadcrumb).ToList<GroupCategoryData>();
            return joinItems;
        }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:34,代码来源:GrpCatController.cs

示例15: RemoveCategory

        public void RemoveCategory(int categoryid)
        {
            var objCtrl = new NBrightBuyController();
            if (Utils.IsNumeric(DataRecord.GetXmlProperty("genxml/defaultcatid")) && categoryid == Convert.ToInt32(DataRecord.GetXmlProperty("genxml/defaultcatid")))
            {
                DataRecord.SetXmlProperty("genxml/defaultcatid", "");
                objCtrl.Update(DataRecord);
            }

            var parentitemid = Info.ItemID.ToString("");
            var xrefitemid = categoryid.ToString("");
            var objQual = DotNetNuke.Data.DataProvider.Instance().ObjectQualifier;
            var dbOwner = DotNetNuke.Data.DataProvider.Instance().DatabaseOwner;
            var stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where typecode = 'CATXREF' and XrefItemId = " + xrefitemid + " and parentitemid = " + parentitemid;
            objCtrl.ExecSql(stmt);
            //remove all cascade xref
            var objGrpCtrl = new GrpCatController(_lang, true);
            var parentcats = objGrpCtrl.GetCategory(Convert.ToInt32(xrefitemid));
            if (parentcats != null)
            {
                foreach (var p in parentcats.Parents)
                {
                    var xreflist = objCtrl.GetList(_portalId, -1, "CATXREF", " and NB1.parentitemid = " + parentitemid);
                    if (xreflist != null)
                    {
                        var deleterecord = true;
                        foreach (var xref in xreflist)
                        {
                            var catid = xref.XrefItemId;
                            var xrefparentcats = objGrpCtrl.GetCategory(Convert.ToInt32(catid));
                            if (xrefparentcats != null && xrefparentcats.Parents.Contains(p))
                            {
                                deleterecord = false;
                                break;
                            }
                        }
                        if (deleterecord)
                        {
                            stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where typecode = 'CATCASCADE' and XrefItemId = " + p.ToString("") + " and parentitemid = " + parentitemid;
                            objCtrl.ExecSql(stmt);
                        }

                    }
                }
            }
        }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:46,代码来源:ProductData.cs


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