Beispiel #1
0
        //删除文章/商品
        private void DeleteArticleById()
        {
            long       Id = Convert.ToInt64(HttpContext.Current.Request["ArticleId"]);
            ArticleDal db = new ArticleDal();

            if (db.Delete(Id))
            {
                result = "OK";
            }
            else
            {
                result = "NO";
            }
        }
 /// <summary>
 /// 在dbo.Article中删除一条记录,支持数据库事务
 /// </summary>
 /// <param name="id">主键</param>
 /// <param name="trans">事务参数,没有请填null</param>
 /// <returns>所影响的行数</returns>
 public int Delete(int id, SqlTransaction trans)
 {
     return(dal.Delete(id, trans));
 }
Beispiel #3
0
 public void Delete([FromRoute] int id)
 {
     articleDal.Delete(id);
 }