Ejemplo n.º 1
0
        /// <summary>
        /// 根据图片id删除图片  1删除成功  2失败   3有评论
        /// </summary>
        /// <param name="pId">图片id</param>
        /// <returns></returns>
        public int DeletePhoto(int pId)
        {//查看又没哟评论
            CommentsBLL comB  = new CommentsBLL();
            int         count = comB.IsHasComment(pId);

            if (count > 0)
            {//有评论
                return(3);
            }
            else
            {//没有评论
                if (photoDAl.DeletePhoto(pId) == 1)
                {
                    return(1);
                }
                else
                {
                    return(2);
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 根据图片id删除图片  1删除成功  2失败   3有评论
 /// </summary>
 /// <param name="pId">图片id</param>
 /// <returns></returns>
 public int DeletePhoto(int pId)
 {
     //查看又没哟评论
     CommentsBLL comB = new CommentsBLL();
     int count = comB.IsHasComment(pId);
     if (count>0)
     {//有评论
         return 3;
     }
     else
     {//没有评论
         if (photoDAl.DeletePhoto(pId)==1)
         {
             return 1;
         }
         else
         {
             return 2;
         }
     }
 }