Ejemplo n.º 1
0
        private DBManufacturerLocalized GetManufacturerLocalizedFromReader(IDataReader dataReader)
        {
            var item = new DBManufacturerLocalized();

            item.ManufacturerLocalizedId = NopSqlDataHelper.GetInt(dataReader, "ManufacturerLocalizedID");
            item.ManufacturerId          = NopSqlDataHelper.GetInt(dataReader, "ManufacturerID");
            item.LanguageId      = NopSqlDataHelper.GetInt(dataReader, "LanguageID");
            item.Name            = NopSqlDataHelper.GetString(dataReader, "Name");
            item.Description     = NopSqlDataHelper.GetString(dataReader, "Description");
            item.MetaKeywords    = NopSqlDataHelper.GetString(dataReader, "MetaKeywords");
            item.MetaDescription = NopSqlDataHelper.GetString(dataReader, "MetaDescription");
            item.MetaTitle       = NopSqlDataHelper.GetString(dataReader, "MetaTitle");
            item.SEName          = NopSqlDataHelper.GetString(dataReader, "SEName");
            return(item);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets localized manufacturer by manufacturer id and language id
        /// </summary>
        /// <param name="manufacturerId">Manufacturer identifier</param>
        /// <param name="languageId">Language identifier</param>
        /// <returns>Manufacturer content</returns>
        public override DBManufacturerLocalized GetManufacturerLocalizedByManufacturerIdAndLanguageId(int manufacturerId, int languageId)
        {
            DBManufacturerLocalized item = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ManufacturerLocalizedLoadByManufacturerIDAndLanguageID");

            db.AddInParameter(dbCommand, "ManufacturerID", DbType.Int32, manufacturerId);
            db.AddInParameter(dbCommand, "LanguageID", DbType.Int32, languageId);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    item = GetManufacturerLocalizedFromReader(dataReader);
                }
            }
            return(item);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Update a localized manufacturer
        /// </summary>
        /// <param name="manufacturerLocalizedId">Localized manufacturer identifier</param>
        /// <param name="manufacturerId">Manufacturer identifier</param>
        /// <param name="languageId">Language identifier</param>
        /// <param name="name">Name text</param>
        /// <param name="description">Description text</param>
        /// <param name="metaKeywords">Meta keywords text</param>
        /// <param name="metaDescription">Meta descriptions text</param>
        /// <param name="metaTitle">Metat title text</param>
        /// <param name="seName">Se name text</param>
        /// <returns>Manufacturer content</returns>
        public override DBManufacturerLocalized UpdateManufacturerLocalized(int manufacturerLocalizedId,
                                                                            int manufacturerId, int languageId, string name, string description,
                                                                            string metaKeywords, string metaDescription, string metaTitle, string seName)
        {
            DBManufacturerLocalized item = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ManufacturerLocalizedUpdate");

            db.AddInParameter(dbCommand, "ManufacturerLocalizedID", DbType.Int32, manufacturerLocalizedId);
            db.AddInParameter(dbCommand, "ManufacturerID", DbType.Int32, manufacturerId);
            db.AddInParameter(dbCommand, "LanguageID", DbType.Int32, languageId);
            db.AddInParameter(dbCommand, "Name", DbType.String, name);
            db.AddInParameter(dbCommand, "Description", DbType.String, description);
            db.AddInParameter(dbCommand, "MetaKeywords", DbType.String, metaKeywords);
            db.AddInParameter(dbCommand, "MetaDescription", DbType.String, metaDescription);
            db.AddInParameter(dbCommand, "MetaTitle", DbType.String, metaTitle);
            db.AddInParameter(dbCommand, "SEName", DbType.String, seName);
            if (db.ExecuteNonQuery(dbCommand) > 0)
            {
                item = GetManufacturerLocalizedById(manufacturerId);
            }

            return(item);
        }