private DBSpecificationAttributeLocalized GetSpecificationAttributeLocalizedFromReader(IDataReader dataReader)
        {
            var item = new DBSpecificationAttributeLocalized();

            item.SpecificationAttributeLocalizedId = NopSqlDataHelper.GetInt(dataReader, "SpecificationAttributeLocalizedID");
            item.SpecificationAttributeId          = NopSqlDataHelper.GetInt(dataReader, "SpecificationAttributeID");
            item.LanguageId = NopSqlDataHelper.GetInt(dataReader, "LanguageID");
            item.Name       = NopSqlDataHelper.GetString(dataReader, "Name");
            return(item);
        }
        /// <summary>
        /// Gets localized specification attribute by specification attribute id and language id
        /// </summary>
        /// <param name="specificationAttributeId">Specification attribute identifier</param>
        /// <param name="languageId">Language identifier</param>
        /// <returns>Specification attribute content</returns>
        public override DBSpecificationAttributeLocalized GetSpecificationAttributeLocalizedBySpecificationAttributeIdAndLanguageId(int specificationAttributeId, int languageId)
        {
            DBSpecificationAttributeLocalized item = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_SpecificationAttributeLocalizedLoadBySpecificationAttributeIDAndLanguageID");

            db.AddInParameter(dbCommand, "SpecificationAttributeID", DbType.Int32, specificationAttributeId);
            db.AddInParameter(dbCommand, "LanguageID", DbType.Int32, languageId);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    item = GetSpecificationAttributeLocalizedFromReader(dataReader);
                }
            }
            return(item);
        }
        /// <summary>
        /// Update a localized specification attribute
        /// </summary>
        /// <param name="specificationAttributeLocalizedId">Localized specification attribute identifier</param>
        /// <param name="specificationAttributeId">Specification attribute identifier</param>
        /// <param name="languageId">Language identifier</param>
        /// <param name="name">Name text</param>
        /// <returns>Specification attribute content</returns>
        public override DBSpecificationAttributeLocalized UpdateSpecificationAttributeLocalized(int specificationAttributeLocalizedId,
                                                                                                int specificationAttributeId, int languageId, string name)
        {
            DBSpecificationAttributeLocalized item = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_SpecificationAttributeLocalizedUpdate");

            db.AddInParameter(dbCommand, "SpecificationAttributeLocalizedID", DbType.Int32, specificationAttributeLocalizedId);
            db.AddInParameter(dbCommand, "SpecificationAttributeID", DbType.Int32, specificationAttributeId);
            db.AddInParameter(dbCommand, "LanguageID", DbType.Int32, languageId);
            db.AddInParameter(dbCommand, "Name", DbType.String, name);
            if (db.ExecuteNonQuery(dbCommand) > 0)
            {
                item = GetSpecificationAttributeLocalizedById(specificationAttributeLocalizedId);
            }

            return(item);
        }