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

            item.LogId       = NopSqlDataHelper.GetInt(dataReader, "LogID");
            item.LogTypeId   = NopSqlDataHelper.GetInt(dataReader, "LogTypeID");
            item.Severity    = NopSqlDataHelper.GetInt(dataReader, "Severity");
            item.Message     = NopSqlDataHelper.GetString(dataReader, "Message");
            item.Exception   = NopSqlDataHelper.GetString(dataReader, "Exception");
            item.IPAddress   = NopSqlDataHelper.GetString(dataReader, "IPAddress");
            item.CustomerId  = NopSqlDataHelper.GetInt(dataReader, "CustomerID");
            item.PageUrl     = NopSqlDataHelper.GetString(dataReader, "PageURL");
            item.ReferrerUrl = NopSqlDataHelper.GetString(dataReader, "ReferrerURL");
            item.CreatedOn   = NopSqlDataHelper.GetUtcDateTime(dataReader, "CreatedOn");
            return(item);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets all tax rates
        /// </summary>
        /// <returns>Tax rate collection</returns>
        public override DBTaxRateCollection GetAllTaxRates()
        {
            var       result    = new DBTaxRateCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_TaxRateLoadAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    var item = GetTaxRateFromReader(dataReader);
                    result.Add(item);
                }
            }
            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Updates the product attribute
        /// </summary>
        /// <param name="productAttributeId">Product attribute identifier</param>
        /// <param name="name">The name</param>
        /// <param name="description">The description</param>
        /// <returns>Product attribute </returns>
        public override DBProductAttribute UpdateProductAttribute(int productAttributeId,
                                                                  string name, string description)
        {
            DBProductAttribute item      = null;
            Database           db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand          dbCommand = db.GetStoredProcCommand("Nop_ProductAttributeUpdate");

            db.AddInParameter(dbCommand, "ProductAttributeID", DbType.Int32, productAttributeId);
            db.AddInParameter(dbCommand, "Name", DbType.String, name);
            db.AddInParameter(dbCommand, "Description", DbType.String, description);
            if (db.ExecuteNonQuery(dbCommand) > 0)
            {
                item = GetProductAttributeById(productAttributeId, 0);
            }
            return(item);
        }
Ejemplo n.º 4
0
        private DBPaymentMethod GetPaymentMethodFromReader(IDataReader dataReader)
        {
            var item = new DBPaymentMethod();

            item.PaymentMethodId       = NopSqlDataHelper.GetInt(dataReader, "PaymentMethodID");
            item.Name                  = NopSqlDataHelper.GetString(dataReader, "Name");
            item.VisibleName           = NopSqlDataHelper.GetString(dataReader, "VisibleName");
            item.Description           = NopSqlDataHelper.GetString(dataReader, "Description");
            item.ConfigureTemplatePath = NopSqlDataHelper.GetString(dataReader, "ConfigureTemplatePath");
            item.UserTemplatePath      = NopSqlDataHelper.GetString(dataReader, "UserTemplatePath");
            item.ClassName             = NopSqlDataHelper.GetString(dataReader, "ClassName");
            item.SystemKeyword         = NopSqlDataHelper.GetString(dataReader, "SystemKeyword");
            item.IsActive              = NopSqlDataHelper.GetBoolean(dataReader, "IsActive");
            item.DisplayOrder          = NopSqlDataHelper.GetInt(dataReader, "DisplayOrder");
            return(item);
        }
        /// <summary>
        /// Gets a locale string resource
        /// </summary>
        /// <param name="localeStringResourceId">Locale string resource identifier</param>
        /// <returns>Locale string resource</returns>
        public override DBLocaleStringResource GetLocaleStringResourceById(int localeStringResourceId)
        {
            DBLocaleStringResource item = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_LocaleStringResourceLoadByPrimaryKey");

            db.AddInParameter(dbCommand, "LocaleStringResourceID", DbType.Int32, localeStringResourceId);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    item = GetLocaleStringResourceFromReader(dataReader);
                }
            }
            return(item);
        }
        /// <summary>
        /// Gets a ShippingByWeightAndCountry
        /// </summary>
        /// <param name="shippingByWeightAndCountryId">ShippingByWeightAndCountry identifier</param>
        /// <returns>ShippingByWeightAndCountry</returns>
        public override DBShippingByWeightAndCountry GetById(int shippingByWeightAndCountryId)
        {
            DBShippingByWeightAndCountry item = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ShippingByWeightAndCountryLoadByPrimaryKey");

            db.AddInParameter(dbCommand, "ShippingByWeightAndCountryID", DbType.Int32, shippingByWeightAndCountryId);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    item = GetShippingByWeightAndCountryFromReader(dataReader);
                }
            }
            return(item);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Gets a measure weight by identifier
        /// </summary>
        /// <param name="MeasureWeightID">Measure weight identifier</param>
        /// <returns>Measure weight</returns>
        public override DBMeasureWeight GetMeasureWeightByID(int MeasureWeightID)
        {
            DBMeasureWeight measureWeight = null;
            Database        db            = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand       dbCommand     = db.GetStoredProcCommand("Nop_MeasureWeightLoadByPrimaryKey");

            db.AddInParameter(dbCommand, "MeasureWeightID", DbType.Int32, MeasureWeightID);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    measureWeight = GetMeasureWeightFromReader(dataReader);
                }
            }
            return(measureWeight);
        }
        /// <summary>
        /// Gets all tax providers
        /// </summary>
        /// <returns>Shipping rate computation method collection</returns>
        public override DBTaxProviderCollection GetAllTaxProviders()
        {
            DBTaxProviderCollection taxProviderCollection = new DBTaxProviderCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_TaxProviderLoadAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBTaxProvider taxProvider = GetTaxProviderFromReader(dataReader);
                    taxProviderCollection.Add(taxProvider);
                }
            }
            return(taxProviderCollection);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Gets a poll
        /// </summary>
        /// <param name="systemKeyword">Poll system keyword</param>
        /// <returns>Poll</returns>
        public override DBPoll GetPollBySystemKeyword(string systemKeyword)
        {
            DBPoll    item      = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_PollLoadBySystemKeyword");

            db.AddInParameter(dbCommand, "SystemKeyword", DbType.String, systemKeyword);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    item = GetPollFromReader(dataReader);
                }
            }
            return(item);
        }
        /// <summary>
        /// Inserts a specification attribute
        /// </summary>
        /// <param name="name">The name</param>
        /// <param name="displayOrder">Display order</param>
        /// <returns>Specification attribute</returns>
        public override DBSpecificationAttribute InsertSpecificationAttribute(string name, int displayOrder)
        {
            DBSpecificationAttribute specificationAttribute = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_SpecificationAttributeInsert");

            db.AddOutParameter(dbCommand, "SpecificationAttributeID", DbType.Int32, 0);
            db.AddInParameter(dbCommand, "Name", DbType.String, name);
            db.AddInParameter(dbCommand, "DisplayOrder", DbType.String, displayOrder);
            if (db.ExecuteNonQuery(dbCommand) > 0)
            {
                int SpecificationAttributeID = Convert.ToInt32(db.GetParameterValue(dbCommand, "@SpecificationAttributeID"));
                specificationAttribute = GetSpecificationAttributeByID(SpecificationAttributeID);
            }
            return(specificationAttribute);
        }
        /// <summary>
        /// Updates the specification attribute
        /// </summary>
        /// <param name="specificationAttributeID">The specification attribute identifier</param>
        /// <param name="name">The name</param>
        /// <param name="displayOrder">Display order</param>
        /// <returns>Specification attribute</returns>
        public override DBSpecificationAttribute UpdateSpecificationAttribute(int specificationAttributeID, string name, int displayOrder)
        {
            DBSpecificationAttribute specificationAttribute = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_SpecificationAttributeUpdate");

            db.AddInParameter(dbCommand, "SpecificationAttributeID", DbType.Int32, specificationAttributeID);
            db.AddInParameter(dbCommand, "Name", DbType.String, name);
            db.AddInParameter(dbCommand, "DisplayOrder", DbType.String, displayOrder);
            if (db.ExecuteNonQuery(dbCommand) > 0)
            {
                specificationAttribute = GetSpecificationAttributeByID(specificationAttributeID);
            }

            return(specificationAttribute);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Gets a news comment
        /// </summary>
        /// <param name="NewsCommentID">News comment identifer</param>
        /// <returns>News comment</returns>
        public override DBNewsComment GetNewsCommentByID(int NewsCommentID)
        {
            DBNewsComment newsComment = null;
            Database      db          = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand     dbCommand   = db.GetStoredProcCommand("Nop_NewsCommentLoadByPrimaryKey");

            db.AddInParameter(dbCommand, "NewsCommentID", DbType.Int32, NewsCommentID);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    newsComment = GetNewsCommentFromReader(dataReader);
                }
            }
            return(newsComment);
        }
Ejemplo n.º 13
0
        private DBCurrency GetCurrencyFromReader(IDataReader dataReader)
        {
            var item = new DBCurrency();

            item.CurrencyId       = NopSqlDataHelper.GetInt(dataReader, "CurrencyID");
            item.Name             = NopSqlDataHelper.GetString(dataReader, "Name");
            item.CurrencyCode     = NopSqlDataHelper.GetString(dataReader, "CurrencyCode");
            item.Rate             = NopSqlDataHelper.GetDecimal(dataReader, "Rate");
            item.DisplayLocale    = NopSqlDataHelper.GetString(dataReader, "DisplayLocale");
            item.CustomFormatting = NopSqlDataHelper.GetString(dataReader, "CustomFormatting");
            item.Published        = NopSqlDataHelper.GetBoolean(dataReader, "Published");
            item.DisplayOrder     = NopSqlDataHelper.GetInt(dataReader, "DisplayOrder");
            item.CreatedOn        = NopSqlDataHelper.GetUtcDateTime(dataReader, "CreatedOn");
            item.UpdatedOn        = NopSqlDataHelper.GetUtcDateTime(dataReader, "UpdatedOn");
            return(item);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Gets all message templates
        /// </summary>
        /// <returns>Message template collection</returns>
        public override DBMessageTemplateCollection GetAllMessageTemplates()
        {
            DBMessageTemplateCollection messageTemplateCollection = new DBMessageTemplateCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_MessageTemplateLoadAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBMessageTemplate messageTemplate = GetMessageTemplateFromReader(dataReader);
                    messageTemplateCollection.Add(messageTemplate);
                }
            }
            return(messageTemplateCollection);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Gets an blog post
        /// </summary>
        /// <param name="blogPostId">Blog post identifier</param>
        /// <returns>Blog post</returns>
        public override DBBlogPost GetBlogPostById(int blogPostId)
        {
            DBBlogPost item      = null;
            Database   db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand  dbCommand = db.GetStoredProcCommand("Nop_BlogPostLoadByPrimaryKey");

            db.AddInParameter(dbCommand, "BlogPostID", DbType.Int32, blogPostId);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    item = GetBlogPostFromReader(dataReader);
                }
            }
            return(item);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Gets a product variant attribute combination
        /// </summary>
        /// <param name="productVariantAttributeCombinationId">Product variant attribute combination identifier</param>
        /// <returns>Product variant attribute combination</returns>
        public override DBProductVariantAttributeCombination GetProductVariantAttributeCombinationById(int productVariantAttributeCombinationId)
        {
            DBProductVariantAttributeCombination item = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ProductVariantAttributeCombinationLoadByPrimaryKey");

            db.AddInParameter(dbCommand, "ProductVariantAttributeCombinationID", DbType.Int32, productVariantAttributeCombinationId);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    item = GetProductVariantAttributeCombinationFromReader(dataReader);
                }
            }
            return(item);
        }
        /// <summary>
        /// Gets an activity log item
        /// </summary>
        /// <param name="activityLogId">Activity log identifier</param>
        /// <returns>Activity log item</returns>
        public override DBActivityLog GetActivityById(int activityLogId)
        {
            DBActivityLog item      = null;
            Database      db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand     dbCommand = db.GetStoredProcCommand("Nop_ActivityLogLoadByPrimaryKey");

            db.AddInParameter(dbCommand, "ActivityLogID", DbType.Int32, activityLogId);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    item = GetActivityLogFromReader(dataReader);
                }
            }
            return(item);
        }
Ejemplo n.º 18
0
        private void BindData()
        {
            //pending
            decimal os_pendingTotalSum = decimal.Zero;
            int     os_pendingCount    = 0;

            using (IDataReader orders_os_pending = OrderManager.GetOrderReport(OrderStatusEnum.Pending, null, null))
            {
                while (orders_os_pending.Read())
                {
                    os_pendingTotalSum = NopSqlDataHelper.GetDecimal(orders_os_pending, "Total");
                    os_pendingCount    = NopSqlDataHelper.GetInt(orders_os_pending, "Count");
                }
                lblTotalIncomplete.Text      = os_pendingCount.ToString();
                lblTotalIncompleteValue.Text = PriceHelper.FormatPrice(os_pendingTotalSum, true, false);
            }

            //not paid
            decimal ps_pendingTotalSum = decimal.Zero;
            int     ps_pendingCount    = 0;

            using (IDataReader orders_ps_pending = OrderManager.GetOrderReport(null, PaymentStatusEnum.Pending, null))
            {
                while (orders_ps_pending.Read())
                {
                    ps_pendingTotalSum = NopSqlDataHelper.GetDecimal(orders_ps_pending, "Total");
                    ps_pendingCount    = NopSqlDataHelper.GetInt(orders_ps_pending, "Count");
                }
                lblTotalUnpaid.Text      = ps_pendingCount.ToString();
                lblTotalUnpaidValue.Text = PriceHelper.FormatPrice(ps_pendingTotalSum, true, false);
            }

            //not shipped
            decimal ss_pendingTotalSum = decimal.Zero;
            int     ss_pendingCount    = 0;

            using (IDataReader orders_ss_pending = OrderManager.GetOrderReport(null, null, ShippingStatusEnum.NotYetShipped))
            {
                while (orders_ss_pending.Read())
                {
                    ss_pendingTotalSum = NopSqlDataHelper.GetDecimal(orders_ss_pending, "Total");
                    ss_pendingCount    = NopSqlDataHelper.GetInt(orders_ss_pending, "Count");
                }
                lblTotalUnshipped.Text      = ss_pendingCount.ToString();
                lblTotalUnshippedValue.Text = PriceHelper.FormatPrice(ss_pendingTotalSum, true, false);
            }
        }
        /// <summary>
        /// Gets all ShippingByWeightAndCountrys
        /// </summary>
        /// <returns>ShippingByWeightAndCountry collection</returns>
        public override DBShippingByWeightAndCountryCollection GetAll()
        {
            DBShippingByWeightAndCountryCollection shippingByWeightAndCountryCollection = new DBShippingByWeightAndCountryCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ShippingByWeightAndCountryLoadAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBShippingByWeightAndCountry shippingByWeightAndCountry = GetShippingByWeightAndCountryFromReader(dataReader);
                    shippingByWeightAndCountryCollection.Add(shippingByWeightAndCountry);
                }
            }

            return(shippingByWeightAndCountryCollection);
        }
        /// <summary>
        /// Gets localized specification attribute option by specification attribute option id and language id
        /// </summary>
        /// <param name="specificationAttributeOptionId">Specification attribute option identifier</param>
        /// <param name="languageId">Language identifier</param>
        /// <returns>Localized specification attribute option</returns>
        public override DBSpecificationAttributeOptionLocalized GetSpecificationAttributeOptionLocalizedBySpecificationAttributeOptionIdAndLanguageId(int specificationAttributeOptionId, int languageId)
        {
            DBSpecificationAttributeOptionLocalized item = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_SpecificationAttributeOptionLocalizedLoadBySpecificationAttributeOptionIDAndLanguageID");

            db.AddInParameter(dbCommand, "SpecificationAttributeOptionID", DbType.Int32, specificationAttributeOptionId);
            db.AddInParameter(dbCommand, "LanguageID", DbType.Int32, languageId);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    item = GetSpecificationAttributeOptionLocalizedFromReader(dataReader);
                }
            }
            return(item);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Gets all payment methods
        /// </summary>
        /// <returns>Payment method collection</returns>
        public override DBPaymentMethodCollection GetAllPaymentMethods(bool showHidden)
        {
            DBPaymentMethodCollection paymentMethodCollection = new DBPaymentMethodCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_PaymentMethodLoadAll");

            db.AddInParameter(dbCommand, "ShowHidden", DbType.Boolean, showHidden);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBPaymentMethod paymentMethod = GetPaymentMethodFromReader(dataReader);
                    paymentMethodCollection.Add(paymentMethod);
                }
            }
            return(paymentMethodCollection);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Gets a setting
        /// </summary>
        /// <param name="SettingID">Setting identifer</param>
        /// <returns>Setting</returns>
        public override DBSetting GetSettingByID(int SettingID)
        {
            DBSetting setting   = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_SettingLoadByPrimaryKey");

            db.AddInParameter(dbCommand, "SettingID", DbType.Int32, SettingID);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    setting = GetSettingFromReader(dataReader);
                }
            }

            return(setting);
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Updates a setting
        /// </summary>
        /// <param name="SettingID">Setting identifier</param>
        /// <param name="Name">The name</param>
        /// <param name="Value">The value</param>
        /// <param name="Description">The description</param>
        /// <returns>Setting</returns>
        public override DBSetting UpdateSetting(int SettingID, string Name, string Value, string Description)
        {
            DBSetting setting   = null;
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_SettingUpdate");

            db.AddInParameter(dbCommand, "SettingID", DbType.Int32, SettingID);
            db.AddInParameter(dbCommand, "Name", DbType.String, Name);
            db.AddInParameter(dbCommand, "Value", DbType.String, Value);
            db.AddInParameter(dbCommand, "Description", DbType.String, Description);
            if (db.ExecuteNonQuery(dbCommand) > 0)
            {
                setting = GetSettingByID(SettingID);
            }

            return(setting);
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Gets all currencies
        /// </summary>
        /// <returns>Currency collection</returns>
        public override DBCurrencyCollection GetAllCurrencies(bool showHidden)
        {
            DBCurrencyCollection currencyCollection = new DBCurrencyCollection();
            Database db = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_CurrencyLoadAll");
            db.AddInParameter(dbCommand, "ShowHidden", DbType.Boolean, showHidden);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBCurrency currency = GetCurrencyFromReader(dataReader);
                    currencyCollection.Add(currency);
                }
            }

            return currencyCollection;
        }
Ejemplo n.º 25
0
 /// <summary>
 /// Gets a currency
 /// </summary>
 /// <param name="CurrencyID">Currency identifier</param>
 /// <returns>Currency</returns>
 public override DBCurrency GetCurrencyByID(int CurrencyID)
 {
     DBCurrency currency = null;
     if (CurrencyID == 0)
         return currency;
     Database db = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
     DbCommand dbCommand = db.GetStoredProcCommand("Nop_CurrencyLoadByPrimaryKey");
     db.AddInParameter(dbCommand, "CurrencyID", DbType.Int32, CurrencyID);
     using (IDataReader dataReader = db.ExecuteReader(dbCommand))
     {
         if (dataReader.Read())
         {
             currency = GetCurrencyFromReader(dataReader);
         }
     }
     return currency;
 }
        /// <summary>
        /// Inserts a shipping method
        /// </summary>
        /// <param name="Name">The name</param>
        /// <param name="Description">The description</param>
        /// <param name="DisplayOrder">The display order</param>
        /// <returns>Shipping method</returns>
        public override DBShippingMethod InsertShippingMethod(string Name, string Description, int DisplayOrder)
        {
            DBShippingMethod shippingMethod = null;
            Database         db             = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand        dbCommand      = db.GetStoredProcCommand("Nop_ShippingMethodInsert");

            db.AddOutParameter(dbCommand, "ShippingMethodID", DbType.Int32, 0);
            db.AddInParameter(dbCommand, "Name", DbType.String, Name);
            db.AddInParameter(dbCommand, "Description", DbType.String, Description);
            db.AddInParameter(dbCommand, "DisplayOrder", DbType.Int32, DisplayOrder);
            if (db.ExecuteNonQuery(dbCommand) > 0)
            {
                int ShippingMethodID = Convert.ToInt32(db.GetParameterValue(dbCommand, "@ShippingMethodID"));
                shippingMethod = GetShippingMethodByID(ShippingMethodID);
            }
            return(shippingMethod);
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Gets all log items
        /// </summary>
        /// <returns>Log item collection</returns>
        public override DBLogCollection GetAllLogs()
        {
            DBLogCollection logCollection = new DBLogCollection();
            Database        db            = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand       dbCommand     = db.GetStoredProcCommand("Nop_LogLoadAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBLog log = GetLogFromReader(dataReader);
                    logCollection.Add(log);
                }
            }

            return(logCollection);
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Gets all languages
        /// </summary>
        /// <param name="showHidden">A value indicating whether to show hidden records</param>
        /// <returns>Language collection</returns>
        public override DBLanguageCollection GetAllLanguages(bool showHidden)
        {
            DBLanguageCollection languageCollection = new DBLanguageCollection();
            Database             db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand            dbCommand = db.GetStoredProcCommand("Nop_LanguageLoadAll");

            db.AddInParameter(dbCommand, "ShowHidden", DbType.Boolean, showHidden);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBLanguage language = GetLanguageFromReader(dataReader);
                    languageCollection.Add(language);
                }
            }
            return(languageCollection);
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Gets all shipping statuses
        /// </summary>
        /// <returns>Shipping status collection</returns>
        public override DBShippingStatusCollection GetAllShippingStatuses()
        {
            DBShippingStatusCollection shippingStatusCollection = new DBShippingStatusCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ShippingStatusLoadAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBShippingStatus shippingStatus = GetShippingStatusFromReader(dataReader);
                    shippingStatusCollection.Add(shippingStatus);
                }
            }

            return(shippingStatusCollection);
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Gets all localized topics
        /// </summary>
        /// <param name="topicName">Topic name</param>
        /// <returns>Localized topic collection</returns>
        public override DBLocalizedTopicCollection GetAllLocalizedTopics(string topicName)
        {
            var       result    = new DBLocalizedTopicCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_TopicLocalizedLoadAllByName");

            db.AddInParameter(dbCommand, "Name", DbType.String, topicName);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    var item = GetLocalizedTopicFromReader(dataReader);
                    result.Add(item);
                }
            }
            return(result);
        }