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


C# Common.ExecuteSqlNonQuery方法代码示例

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


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

示例1: CreateContent

 public override void CreateContent(string _ChannelId, string _ContentId, int _CurrentPage)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         _doh.Reset();
         _doh.SqlCmd = "SELECT [PhotoUrl],[FirstPage] FROM [jcms_module_photo] WHERE [ChannelId]=" + _ChannelId + " and [Id]=" + _ContentId;
         DataTable dtContent = _doh.GetDataTable();
         //图片地址分割处理
         string PhotoUrl = dtContent.Rows[0]["PhotoUrl"].ToString().Replace("\r\n", "\r");
         string ContentFirstPage = dtContent.Rows[0]["FirstPage"].ToString();
         dtContent.Clear();
         dtContent.Dispose();
         if (PhotoUrl != "")
         {
             string[] PhotoUrlArr = PhotoUrl.Split(new string[] { "\r" }, StringSplitOptions.RemoveEmptyEntries);
             int pageCount = PhotoUrlArr.Length;
             if (ContentFirstPage.Length == 0)
             {
                 _doh.Reset();
                 _doh.SqlCmd = "UPDATE [jcms_module_photo] SET [FirstPage]='" + Go2View(1, true, _ChannelId, _ContentId, false) + "' WHERE  [ChannelId]=" + _ChannelId + " and [IsPass]=1 and [Id]=" + _ContentId;
                 _doh.ExecuteSqlNonQuery();
             }
             for (int j = 1; j < (pageCount + 1); j++)
             {
                 JumboTCMS.Utils.DirFile.SaveFile(GetContent(_ChannelId, _ContentId, j), Go2View(j, true, _ChannelId, _ContentId, true));
             }
         }
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:29,代码来源:PhotoDAL.cs

示例2: CreateContent

 public virtual void CreateContent(string _ChannelId, string _ContentId, int _CurrentPage)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         _doh.Reset();
         _doh.SqlCmd = "SELECT [Content],[FirstPage] FROM [jcms_module_article] WHERE [ChannelId]=" + _ChannelId + " and [Id]=" + _ContentId;
         DataTable dtContent = _doh.GetDataTable();
         string ArticleContent = dtContent.Rows[0]["Content"].ToString();
         string ContentFirstPage = dtContent.Rows[0]["FirstPage"].ToString();
         dtContent.Clear();
         dtContent.Dispose();
         if (ArticleContent != "")
         {
             int pageCount = 1;
             //处理文章内容分页
             if (ArticleContent.Contains("[Jumbot_PageBreak]"))
             {
                 string[] ContentArr = ArticleContent.Split(new string[] { "[Jumbot_PageBreak]" }, StringSplitOptions.RemoveEmptyEntries);
                 pageCount = ContentArr.Length;
             }
             if (ContentFirstPage.Length == 0)
             {
                 _doh.Reset();
                 _doh.SqlCmd = "UPDATE [jcms_module_article] SET [FirstPage]='" + Go2View(1, true, _ChannelId, _ContentId, false) + "' WHERE [ChannelId]=" + _ChannelId + " and [IsPass]=1 and [Id]=" + _ContentId;
                 _doh.ExecuteSqlNonQuery();
             }
             for (int j = 1; j < (pageCount + 1); j++)
             {
                 JumboTCMS.Utils.DirFile.SaveFile(GetContent(_ChannelId, _ContentId, j), Go2View(j, true, _ChannelId, _ContentId, true));
             }
         }
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:33,代码来源:ArticleDAL.cs

示例3: CreateContent

 public override void CreateContent(string _ChannelId, string _ContentId, int _CurrentPage)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         _doh.Reset();
         _doh.SqlCmd = "SELECT [FirstPage] FROM [jcms_module_soft] WHERE [ChannelId]=" + _ChannelId + " and [Id]=" + _ContentId;
         DataTable dtContent = _doh.GetDataTable();
         string ContentFirstPage = dtContent.Rows[0]["FirstPage"].ToString();
         dtContent.Clear();
         dtContent.Dispose();
         if (ContentFirstPage.Length == 0)
         {
             _doh.Reset();
             _doh.SqlCmd = "UPDATE [jcms_module_soft] SET [FirstPage]='" + Go2View(1, true, _ChannelId, _ContentId, false) + "' WHERE [ChannelId]=" + _ChannelId + " and [IsPass]=1 and [Id]=" + _ContentId;
             _doh.ExecuteSqlNonQuery();
         }
         JumboTCMS.Utils.DirFile.SaveFile(GetContent(_ChannelId, _ContentId, 1), Go2View(1, true, _ChannelId, _ContentId, true));
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:19,代码来源:SoftDAL.cs

示例4: DeleteContent

        /// <summary>
        /// 删除内容页
        /// </summary>
        /// <param name="_ChannelId"></param>
        /// <param name="_ContentId"></param>
        public void DeleteContent(string _ChannelId, string _ContentId)
        {
            JumboTCMS.Entity.Normal_Channel _Channel = new JumboTCMS.DAL.Normal_ChannelDAL().GetEntity(_ChannelId);

            using (DbOperHandler _doh = new Common().Doh())
            {
                _doh.Reset();
                _doh.ConditionExpress = "[ChannelId]=" + _ChannelId + " AND [Id]=" + _ContentId;
                object[] _value = _doh.GetFields("jcms_module_" + _Channel.Type, "AddDate,FirstPage");
                string _date = _value[0].ToString();
                string _firstpage = _value[1].ToString();
                if (_firstpage.Length > 0 && _Channel.IsHtml)
                {
                    string _folderName = String.Format("/{0}{1}/{2}",
                        DateTime.Parse(_date).ToString("yyyy"),
                        DateTime.Parse(_date).ToString("MM"),
                        DateTime.Parse(_date).ToString("dd")
                        );
                    if (System.IO.Directory.Exists(HttpContext.Current.Server.MapPath(site.Dir + _Channel.Dir + _folderName)))
                    {
                        string htmFile = HttpContext.Current.Server.MapPath(Go2View(1, true, _ChannelId, _ContentId, true));
                        if (System.IO.File.Exists(htmFile))
                            System.IO.File.Delete(htmFile);
                        string[] htmFiles = System.IO.Directory.GetFiles(HttpContext.Current.Server.MapPath(site.Dir + _Channel.Dir + _folderName), _ContentId + "_*" + site.StaticExt);
                        foreach (string fileName in htmFiles)
                        {
                            if (System.IO.File.Exists(fileName))
                                System.IO.File.Delete(fileName);
                        }
                    }
                    _doh.Reset();
                    _doh.SqlCmd = "UPDATE [jcms_module_" + _Channel.Type + "] SET [FirstPage]='' WHERE [ChannelId]=" + _ChannelId + " AND [Id]=" + _ContentId;
                    _doh.ExecuteSqlNonQuery();
                }
            }
        }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:41,代码来源:ArticleDAL.cs

示例5: NewOrder

 /// <summary>
 /// 新增订单信息
 /// </summary>
 /// <param name="_uid"></param>
 /// <param name="_truename"></param>
 /// <param name="_address"></param>
 /// <param name="_zipcode"></param>
 /// <param name="_mobiletel"></param>
 /// <returns></returns>
 public bool NewOrder(string _uid, string _truename, string _address, string _zipcode, string _mobiletel)
 {
     using (DbOperHandler _doh = new Common().Doh())
     {
         string _ordernum = GetProductOrderNum();//订单号
         int page = 1;
         int PSize = 1000;
         int countNum = 0;
         string sqlStr = "";
         string joinStr = "A.[ProductId]=B.Id";
         string whereStr1 = "A.State=0 AND A.UserId=" + _uid;
         string whereStr2 = "State=0 AND UserId=" + _uid;
         _doh.Reset();
         _doh.ConditionExpress = whereStr2;
         countNum = _doh.Count("jcms_normal_user_cart");
         sqlStr = JumboTCMS.Utils.SqlHelp.GetSql("A.*,b.points as unitprice,(b.points*a.buycount) as totalprice,b.id as productid,b.title as productname,b.img as productimg", "jcms_normal_user_cart", "jcms_module_product", "Id", PSize, page, "desc", joinStr, whereStr1, whereStr2);
         _doh.Reset();
         _doh.SqlCmd = sqlStr;
         DataTable dt = _doh.GetDataTable();
         if (dt.Rows.Count == 0)
             return false;
         float _money = 0;
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             JumboTCMS.Entity.Normal_UserGoods _goods = new JumboTCMS.Entity.Normal_UserGoods();
             _goods.UserId = Str2Int(_uid);
             _goods.OrderNum = _ordernum;
             _goods.ProductId = Str2Int(dt.Rows[i]["ProductId"].ToString());
             _goods.ProductName = dt.Rows[i]["ProductName"].ToString();
             _goods.ProductImg = dt.Rows[i]["ProductImg"].ToString();
             _goods.ProductLink = dt.Rows[i]["ProductLink"].ToString();
             _goods.UnitPrice = Convert.ToSingle(dt.Rows[i]["UnitPrice"].ToString());
             _goods.BuyCount = Str2Int(dt.Rows[i]["BuyCount"].ToString());
             _goods.TotalPrice = Convert.ToSingle(dt.Rows[i]["TotalPrice"].ToString());
             new JumboTCMS.DAL.Normal_UserGoodsDAL().NewGoods(_goods);
             _money += _goods.TotalPrice;
         }
         dt.Clear();
         dt.Dispose();
         _doh.Reset();
         _doh.AddFieldItem("UserId", _uid);
         _doh.AddFieldItem("OrderNum", _ordernum);
         _doh.AddFieldItem("TrueName", _truename);
         _doh.AddFieldItem("Address", _address);
         _doh.AddFieldItem("ZipCode", _zipcode);
         _doh.AddFieldItem("MobileTel", _mobiletel);
         _doh.AddFieldItem("Money", _money);
         _doh.AddFieldItem("State", 0);
         _doh.AddFieldItem("OrderTime", DateTime.Now.ToString());
         _doh.AddFieldItem("OrderIP", IPHelp.ClientIP);
         _doh.Insert("jcms_normal_user_order");
         _doh.Reset();
         _doh.SqlCmd = string.Format("UPDATE [jcms_normal_user_cart] SET [State]=1 WHERE UserId={0}", _uid);
         _doh.ExecuteSqlNonQuery();
         return true;
     }
 }
开发者ID:WZDotCMS,项目名称:WZDotCMS,代码行数:66,代码来源:UserOrderDAL.cs


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