Esempio n. 1
0
        /// <summary>
        /// Ìí¼ÓͼƬ
        /// </summary>
        /// <param name="picture"></param>
        /// <returns></returns>
        public bool AddPicture(Tz888.Model.Picture.PictureInfo Picture)
        {
            string sql = "insert into PictureInfo(Title,ImgUrl,Target,SourceId,IsRecommend,ShowId,Remarks,TypeId) values(@Title,@ImgUrl,@Target,@SourceId,@IsRecommend,@ShowId,@Remarks,@TypeId)";

            SqlParameter[] Paras = new SqlParameter[] {
                new SqlParameter("@Title", SqlDbType.VarChar, 100),
                new SqlParameter("@ImgUrl", SqlDbType.VarChar, 200),
                new SqlParameter("@Target", SqlDbType.VarChar, 200),
                new SqlParameter("@SourceId", SqlDbType.Int, 4),
                new SqlParameter("@IsRecommend", SqlDbType.Int, 4),
                new SqlParameter("@ShowId", SqlDbType.Int, 4),
                new SqlParameter("@Remarks", SqlDbType.VarChar, 200),
                new SqlParameter("@TypeId", SqlDbType.Int, 4)
            };
            Paras[0].Value = Picture.Title;
            Paras[1].Value = Picture.ImgUrl;
            Paras[2].Value = Picture.Target;
            Paras[3].Value = Picture.SourceId;
            Paras[4].Value = Picture.IsRecommend;
            Paras[5].Value = Picture.ShowId;
            Paras[6].Value = Picture.Remarks;
            Paras[7].Value = Picture.TypeId;

            int row = crm.ExecuteSql(sql, Paras);

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// ÐÞ¸ÄͼƬ
        /// </summary>
        /// <param name="picture"></param>
        /// <returns></returns>
        public bool ModfiyPicture(Tz888.Model.Picture.PictureInfo Picture)
        {
            string sql = "update PictureInfo set Title=@Title,ImgUrl=@ImgUrl,SourceId=@SourceId,IsRecommend=@IsRecommend,ShowId=@ShowId,Remarks=@Remarks,Target=@Target,TypeId=@TypeId where Id=@Id";

            SqlParameter[] Paras = new SqlParameter[] {
                new SqlParameter("@Title", SqlDbType.VarChar, 100),
                new SqlParameter("@ImgUrl", SqlDbType.VarChar, 200),
                new SqlParameter("@SourceId", SqlDbType.Int, 4),
                new SqlParameter("@IsRecommend", SqlDbType.Int, 4),
                new SqlParameter("@ShowId", SqlDbType.Int, 4),
                new SqlParameter("@Id", SqlDbType.Int, 4),
                new SqlParameter("@Target", SqlDbType.VarChar, 200),
                new SqlParameter("@Remarks", SqlDbType.VarChar, 200),
                new SqlParameter("@TypeId", SqlDbType.Int, 4)
            };

            Paras[0].Value = Picture.Title;
            Paras[1].Value = Picture.ImgUrl;
            Paras[2].Value = Picture.SourceId;
            Paras[3].Value = Picture.IsRecommend;
            Paras[4].Value = Picture.ShowId;
            Paras[5].Value = Picture.Id;
            Paras[6].Value = Picture.Target;
            Paras[7].Value = Picture.Remarks;
            Paras[8].Value = Picture.TypeId;

            int row = crm.ExecuteSql(sql, Paras);

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }