示例#1
0
        public BannerInfo BannerInfoIDataReader(IDataReader dr)
        {
            BannerInfo obj = new BannerInfo();

            obj.BannerID    = (dr["BannerID"] is DBNull) ? string.Empty : dr["BannerID"].ToString();
            obj.BannerType  = (dr["BannerType"] is DBNull) ? string.Empty : dr["BannerType"].ToString();
            obj.Size        = (dr["Size"] is DBNull) ? string.Empty : dr["Size"].ToString();
            obj.Description = (dr["Description"] is DBNull) ? string.Empty : dr["Description"].ToString();
            obj.Images      = (dr["Images"] is DBNull) ? string.Empty : dr["Images"].ToString(); return(obj);
        }
 public bool BannerInfo_Update(BannerInfo data)
 {
     using (SqlCommand dbCmd = new SqlCommand("Banner_Update", GetConnection()))
     {
         dbCmd.CommandType = CommandType.StoredProcedure;
         dbCmd.Parameters.Add(new SqlParameter("@BannerID", data.BannerID));
         dbCmd.Parameters.Add(new SqlParameter("@BannerType", data.BannerType));
         dbCmd.Parameters.Add(new SqlParameter("@Size", data.Size));
         dbCmd.Parameters.Add(new SqlParameter("@Description", data.Description));
         dbCmd.Parameters.Add(new SqlParameter("@Images", data.Images));
         dbCmd.ExecuteNonQuery();
     }
     //Clear cache
     System.Web.HttpContext.Current.Cache.Remove("BannerInfo");
     return(true);
 }