internal static void Update(CatalogImage entity)
{
CatalogImage CatalogImageEntity = (CatalogImage)(entity);
using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
{
SqlCommand sqlCommand = new SqlCommand(SN_CATALOG_IMAGE_UPDATE, sqlConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
SqlParameter sqlParameter = null;
sqlParameter = new SqlParameter(PN_CATALOG_IMAGE_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = CatalogImageEntity.ID;
sqlCommand.Parameters.Add(sqlParameter);
sqlParameter = new SqlParameter(PN_CATALOG_IMAGE_IS_COVER_IMAGE, System.Data.SqlDbType.Bit);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = CatalogImageEntity.IsCoverImage;
sqlCommand.Parameters.Add(sqlParameter);
sqlParameter = new SqlParameter(PN_CATALOG_IMAGE_NAME, System.Data.SqlDbType.NVarChar);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = CatalogImageEntity.Image;
sqlCommand.Parameters.Add(sqlParameter);
try
{
sqlCommand.Connection.Open();
sqlCommand.ExecuteNonQuery();
sqlCommand.Connection.Close();
}
catch (Exception ex)
{
throw ex;
}
}
}