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


C# NBrightBuyController.ExecSql方法代码示例

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


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

示例1: PurgeCarts

 private void PurgeCarts()
 {
     var objCtrl = new NBrightBuyController();
     var objQual = DotNetNuke.Data.DataProvider.Instance().ObjectQualifier;
     var dbOwner = DotNetNuke.Data.DataProvider.Instance().DatabaseOwner;
     if (Utils.IsNumeric(GenXmlFunctions.GetField(rpData, "purgecartsdays")))
     {
         var days = Convert.ToInt32(GenXmlFunctions.GetField(rpData, "purgecartsdays"));
         var d = DateTime.Now.AddDays(days * -1);
         var strDate = d.ToString("s");
         var stmt = "";
         stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'CART' and ModifiedDate < '" + strDate + "' ";
         objCtrl.ExecSql(stmt);
     }
 }
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:15,代码来源:Tools.ascx.cs

示例2: DoClearDown

        private void DoClearDown()
        {
            var pass = GenXmlFunctions.GetField(rpData, "txtclearpass");
            if (pass == StoreSettings.Current.Get("adminpin") && pass != "")
            {
                var done = false;
                var objCtrl = new NBrightBuyController();
                var objQual = DotNetNuke.Data.DataProvider.Instance().ObjectQualifier;
                var dbOwner = DotNetNuke.Data.DataProvider.Instance().DatabaseOwner;
                var stmt = "";
                if (GenXmlFunctions.GetField(rpData, "clearproducts") == "True")
                {
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'PRD' ";
                    objCtrl.ExecSql(stmt);
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'PRDLANG' ";
                    objCtrl.ExecSql(stmt);
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'AMY' ";
                    objCtrl.ExecSql(stmt);
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'AMYLANG' ";
                    objCtrl.ExecSql(stmt);
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'PRDXREF' ";
                    objCtrl.ExecSql(stmt);
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'USERPRDXREF' ";
                    objCtrl.ExecSql(stmt);
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'CATCASCADE' ";
                    objCtrl.ExecSql(stmt);
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'CATXREF' ";
                    objCtrl.ExecSql(stmt);
                    done = true;
                }

                if (GenXmlFunctions.GetField(rpData, "clearcategories") == "True")
                {
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'CATEGORY' and [XMLData].value('(genxml/dropdownlist/ddlgrouptype)[1]','nvarchar(max)') = 'cat' ";
                    objCtrl.ExecSql(stmt);
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'CATEGORYLANG' and ParentItemId not in (Select itemid from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'CATEGORY') ";
                    objCtrl.ExecSql(stmt);
                    done = true;
                }

                if (GenXmlFunctions.GetField(rpData, "clearpropertiesonly") == "True")
                {
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'CATEGORY' and [XMLData].value('(genxml/dropdownlist/ddlgrouptype)[1]','nvarchar(max)') != 'cat' ";
                    objCtrl.ExecSql(stmt);
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'CATEGORYLANG' and ParentItemId not in (Select itemid from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'CATEGORY') ";
                    objCtrl.ExecSql(stmt);
                    done = true;
                }


                if (GenXmlFunctions.GetField(rpData, "clearproperties") == "True")
                {
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'CATEGORY' and [XMLData].value('(genxml/dropdownlist/ddlgrouptype)[1]','nvarchar(max)') != 'cat' ";
                    objCtrl.ExecSql(stmt);
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'CATEGORYLANG' and ParentItemId not in (Select itemid from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'CATEGORY') ";
                    objCtrl.ExecSql(stmt);

                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'GROUP' ";
                    objCtrl.ExecSql(stmt);
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'GROUPLANG' ";
                    objCtrl.ExecSql(stmt);

                    done = true;
                }

                if (GenXmlFunctions.GetField(rpData, "clearorders") == "True")
                {
                    stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where PortalId = " + PortalId.ToString("") + " and typecode = 'ORDER' ";
                    objCtrl.ExecSql(stmt);
                    done = true;
                }

                DataCache.ClearCache();

                if (done) NBrightBuyUtils.SetNotfiyMessage(ModuleId, "deletecompleted", NotifyCode.ok);

            }
            else
            {
                NBrightBuyUtils.SetNotfiyMessage(ModuleId, "nopin", NotifyCode.fail);
            }

        }
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:83,代码来源:Tools.ascx.cs

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

示例4: RemoveRelatedProduct

 public void RemoveRelatedProduct(int productid)
 {
     var parentitemid = Info.ItemID.ToString("");
     var xrefitemid = productid.ToString("");
     var objCtrl = new NBrightBuyController();
     var objQual = DotNetNuke.Data.DataProvider.Instance().ObjectQualifier;
     var dbOwner = DotNetNuke.Data.DataProvider.Instance().DatabaseOwner;
     var stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where typecode = 'PRDXREF' and XrefItemId = " + xrefitemid + " and parentitemid = " + parentitemid;
     objCtrl.ExecSql(stmt);
 }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:10,代码来源:ProductData.cs

示例5: RemoveClient

 public void RemoveClient(int userid)
 {
     var parentitemid = Info.ItemID.ToString("");
     var objCtrl = new NBrightBuyController();
     var objQual = DotNetNuke.Data.DataProvider.Instance().ObjectQualifier;
     var dbOwner = DotNetNuke.Data.DataProvider.Instance().DatabaseOwner;
     var stmt = "delete from " + dbOwner + "[" + objQual + "NBrightBuy] where typecode = 'USERPRDXREF' and UserId = " + userid.ToString("") + " and parentitemid = " + parentitemid;
     objCtrl.ExecSql(stmt);
 }
开发者ID:DNNMonster,项目名称:NBrightBuy,代码行数:9,代码来源:ProductData.cs


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