internal static void Update(IEntity entity)
{
AJH.CMS.Core.Entities.Attribute attributeEntity = (AJH.CMS.Core.Entities.Attribute)(entity);
using (SqlConnection sqlConnection = new SqlConnection(CMSCoreBase.CMSCoreConnectionString))
{
SqlCommand sqlCommand = new SqlCommand(SN_ATTRIBUTE_UPDATE, sqlConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
SqlParameter sqlParameter = null;
sqlParameter = new SqlParameter(PN_ATTRIBUTE_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = attributeEntity.ID;
sqlCommand.Parameters.Add(sqlParameter);
sqlParameter = new SqlParameter(PN_ATTRIBUTE_GROUP_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = attributeEntity.GroupID;
sqlCommand.Parameters.Add(sqlParameter);
sqlParameter = new SqlParameter(PN_ATTRIBUTE_PORTAL_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = attributeEntity.PortalID;
sqlCommand.Parameters.Add(sqlParameter);
sqlParameter = new SqlParameter(PN_ATTRIBUTE_NAME, System.Data.SqlDbType.NVarChar);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = attributeEntity.Name;
sqlCommand.Parameters.Add(sqlParameter);
sqlParameter = new SqlParameter(ECommerceDataMapperBase.PN_MODULE_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = attributeEntity.ModuleID;
sqlCommand.Parameters.Add(sqlParameter);
sqlParameter = new SqlParameter(ECommerceDataMapperBase.PN_ECO_LAN_LAN_ID, System.Data.SqlDbType.Int);
sqlParameter.Direction = System.Data.ParameterDirection.Input;
sqlParameter.Value = attributeEntity.LanguageID;
sqlCommand.Parameters.Add(sqlParameter);
try
{
sqlCommand.Connection.Open();
sqlCommand.ExecuteNonQuery();
sqlCommand.Connection.Close();
}
catch (Exception ex)
{
throw ex;
}
}
}