Пример #1
0
        private DBShippingStatus GetShippingStatusFromReader(IDataReader dataReader)
        {
            DBShippingStatus shippingStatus = new DBShippingStatus();

            shippingStatus.ShippingStatusID = NopSqlDataHelper.GetInt(dataReader, "ShippingStatusID");
            shippingStatus.Name             = NopSqlDataHelper.GetString(dataReader, "Name");
            return(shippingStatus);
        }
        private DBShippingStatus GetShippingStatusFromReader(IDataReader dataReader)
        {
            var item = new DBShippingStatus();

            item.ShippingStatusId = NopSqlDataHelper.GetInt(dataReader, "ShippingStatusID");
            item.Name             = NopSqlDataHelper.GetString(dataReader, "Name");
            return(item);
        }
        private static ShippingStatus DBMapping(DBShippingStatus dbItem)
        {
            if (dbItem == null)
                return null;

            ShippingStatus item = new ShippingStatus();
            item.ShippingStatusID = dbItem.ShippingStatusID;
            item.Name = dbItem.Name;

            return item;
        }
Пример #4
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);
        }
Пример #5
0
        /// <summary>
        /// Gets a shipping status by ID
        /// </summary>
        /// <param name="ShippingStatusID">Shipping status identifier</param>
        /// <returns>Shipping status</returns>
        public override DBShippingStatus GetShippingStatusByID(int ShippingStatusID)
        {
            DBShippingStatus shippingStatus = null;

            if (ShippingStatusID == 0)
            {
                return(shippingStatus);
            }
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_ShippingStatusLoadByPrimaryKey");

            db.AddInParameter(dbCommand, "ShippingStatusID", DbType.Int32, ShippingStatusID);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    shippingStatus = GetShippingStatusFromReader(dataReader);
                }
            }
            return(shippingStatus);
        }