コード例 #1
0
        /// <summary>
        /// 根据类型名 查询图片
        /// </summary>
        /// <param name="typeName"></param>
        /// <returns></returns>
        public static List <Img> GetImgbytypeName(string typeName)
        {
            string sql = "select * from Img where IsShow=1 and ImgTypeId=(select ImgTypeId from ImgType where TypeName='" + typeName + "')";

            return(ImgDal.GetImg(sql));
        }
コード例 #2
0
        /// <summary>
        /// 根据图片类型查询图片(datatable)
        /// </summary>
        /// <param name="imgTypeId"></param>
        /// <returns></returns>
        public static DataTable getImgbytypeId(int imgTypeId)
        {
            string sql = "select Img.*,ImgType.TypeName from Img,ImgType where Img.ImgTypeId=ImgType.ImgTypeId and Img.ImgTypeId=" + imgTypeId + " order by Rank desc";

            return(ImgDal.getImg(sql));
        }
コード例 #3
0
 /// <summary>
 /// 修改状态
 /// </summary>
 /// <param name="imgId"></param>
 /// <param name="isShow"></param>
 /// <returns></returns>
 public static int UpdateStatus(int imgId, int isShow)
 {
     return(ImgDal.UpdateStatus(imgId, isShow));
 }
コード例 #4
0
 /// <summary>
 /// 删除图片
 /// </summary>
 /// <param name="imgId"></param>
 /// <returns></returns>
 public static int DeleteImg(int imgId)
 {
     return(ImgDal.DeleteImg(imgId));
 }
コード例 #5
0
 /// <summary>
 /// 修改图片
 /// </summary>
 /// <param name="img"></param>
 /// <returns></returns>
 public static int UpdateImg(Img img)
 {
     return(ImgDal.UpdateImg(img));
 }
コード例 #6
0
        /// <summary>
        /// 根据ID查询图片
        /// </summary>
        /// <param name="imgId"></param>
        /// <returns></returns>
        public static List <Img> GetImgbyId(int imgId)
        {
            string sql = "select * from Img where ImgId=" + imgId;

            return(ImgDal.GetImg(sql));
        }
コード例 #7
0
 /// <summary>
 /// 添加图片
 /// </summary>
 /// <param name="img"></param>
 /// <returns></returns>
 public static int AddImg(Img img)
 {
     return(ImgDal.AddImg(img));
 }
コード例 #8
0
 /// <summary>
 /// 修改图片地址
 /// </summary>
 /// <param name="imgId"></param>
 /// <param name="imgUrl"></param>
 /// <returns></returns>
 public static int UpdateImgUrl(int imgId, string imgUrl)
 {
     return(ImgDal.UpdateImgUrl(imgId, imgUrl));
 }