Example #1
0
        /// <summary>
        /// Inserts a row in the mp_RedirectList table. Returns rows affected count.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="siteID"> siteID </param>
        /// <param name="oldUrl"> oldUrl </param>
        /// <param name="newUrl"> newUrl </param>
        /// <param name="createdUtc"> createdUtc </param>
        /// <param name="expireUtc"> expireUtc </param>
        /// <returns>int</returns>
        public int Create(
            Guid rowGuid,
            Guid siteGuid,
            int siteID,
            string oldUrl,
            string newUrl,
            DateTime createdUtc,
            DateTime expireUtc)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_RedirectList_Insert", 
                7);

            sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteID);
            sph.DefineSqlParameter("@OldUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, oldUrl);
            sph.DefineSqlParameter("@NewUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, newUrl);
            sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
            sph.DefineSqlParameter("@ExpireUtc", SqlDbType.DateTime, ParameterDirection.Input, expireUtc);
            int rowsAffected = sph.ExecuteNonQuery();
            return rowsAffected;

        }
Example #2
0
        /// <summary>
        /// Updates a row in the mp_BannedIPAddresses table. Returns true if row updated.
        /// </summary>
        /// <param name="rowID"> rowID </param>
        /// <param name="bannedIP"> bannedIP </param>
        /// <param name="bannedUTC"> bannedUTC </param>
        /// <param name="bannedReason"> bannedReason </param>
        /// <returns>bool</returns>
        public bool Update(
            int rowId,
            string bannedIP,
            DateTime bannedUtc,
            string bannedReason)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_BannedIPAddresses_Update", 
                4);

            sph.DefineSqlParameter("@RowID", SqlDbType.Int, ParameterDirection.Input, rowId);
            sph.DefineSqlParameter("@BannedIP", SqlDbType.NVarChar, 50, ParameterDirection.Input, bannedIP);
            sph.DefineSqlParameter("@BannedUTC", SqlDbType.DateTime, ParameterDirection.Input, bannedUtc);
            sph.DefineSqlParameter("@BannedReason", SqlDbType.NVarChar, 255, ParameterDirection.Input, bannedReason);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);
        }
Example #3
0
        private bool UpdateStatus(
            Guid guid,
            DateTime lastStatusUpdateUTC,
            double completeRatio,
            string status)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString,
                "mp_TaskQueue_UpdateStatus",
                4);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@LastStatusUpdateUTC", SqlDbType.DateTime, ParameterDirection.Input, lastStatusUpdateUTC);
            sph.DefineSqlParameter("@CompleteRatio", SqlDbType.Float, ParameterDirection.Input, completeRatio);
            sph.DefineSqlParameter("@Status", SqlDbType.NVarChar, 255, ParameterDirection.Input, status);

            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #4
0
        public static bool Update(
            int customFieldID,
            int siteID,
            string name,
            string displayName,
            int dataType,
            int fieldType,
            int filterType,
            bool isEnabled,
            bool isRequired,
            string validationExpression,
            string invalidMessage,
            bool allowComparing,
            int displayOrder,
            Guid featureGuid,
            Guid guid,
            int options)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "gb_CustomField_Update", 16);

            sph.DefineSqlParameter("@CustomFieldID", SqlDbType.Int, ParameterDirection.Input, customFieldID);
            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteID);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name);
            sph.DefineSqlParameter("@DisplayName", SqlDbType.NVarChar, 255, ParameterDirection.Input, displayName);
            sph.DefineSqlParameter("@DataType", SqlDbType.Int, ParameterDirection.Input, dataType);
            sph.DefineSqlParameter("@FieldType", SqlDbType.Int, ParameterDirection.Input, fieldType);
            sph.DefineSqlParameter("@FilterType", SqlDbType.Int, ParameterDirection.Input, filterType);
            sph.DefineSqlParameter("@IsEnabled", SqlDbType.Bit, ParameterDirection.Input, isEnabled);
            sph.DefineSqlParameter("@IsRequired", SqlDbType.Bit, ParameterDirection.Input, isRequired);
            sph.DefineSqlParameter("@ValidationExpression", SqlDbType.NVarChar, -1, ParameterDirection.Input, validationExpression);
            sph.DefineSqlParameter("@InvalidMessage", SqlDbType.NVarChar, 255, ParameterDirection.Input, invalidMessage);
            sph.DefineSqlParameter("@AllowComparing", SqlDbType.Bit, ParameterDirection.Input, allowComparing);
            sph.DefineSqlParameter("@DisplayOrder", SqlDbType.Int, ParameterDirection.Input, displayOrder);
            sph.DefineSqlParameter("@FeatureGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, featureGuid);
            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@Options", SqlDbType.Int, ParameterDirection.Input, options);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
        public static bool Update(
            Guid productGuid,
            string fileName,
            byte[] fileImage,
            string serverFileName,
            int byteLength,
            DateTime created,
            Guid createdBy)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_ProductFile_Update", 7);

            sph.DefineSqlParameter("@ProductGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, productGuid);
            sph.DefineSqlParameter("@FileName", SqlDbType.NVarChar, 255, ParameterDirection.Input, fileName);
            sph.DefineSqlParameter("@FileImage", SqlDbType.Image, ParameterDirection.Input, fileImage);
            sph.DefineSqlParameter("@ServerFileName", SqlDbType.NVarChar, 255, ParameterDirection.Input, serverFileName);
            sph.DefineSqlParameter("@ByteLength", SqlDbType.Int, ParameterDirection.Input, byteLength);
            sph.DefineSqlParameter("@Created", SqlDbType.DateTime, ParameterDirection.Input, created);
            sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
        public static bool Update(
            Guid guid,
            Guid orderGuid,
            Guid offerGuid,
            Guid productGuid,
            byte fullfillType,
            Guid fullfillTermsGuid,
            DateTime created)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_OrderOfferProduct_Update", 7);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@OrderGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, orderGuid);
            sph.DefineSqlParameter("@OfferGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, offerGuid);
            sph.DefineSqlParameter("@ProductGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, productGuid);
            sph.DefineSqlParameter("@FullfillType", SqlDbType.TinyInt, ParameterDirection.Input, fullfillType);
            sph.DefineSqlParameter("@FullfillTermsGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, fullfillTermsGuid);
            sph.DefineSqlParameter("@Created", SqlDbType.DateTime, ParameterDirection.Input, created);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
        /// <summary>
        /// Inserts a row in the i7_sflexi_values table. Returns rows affected count.
        /// </summary>
        /// <param name="valueGuid"> valueGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="featureGuid"> featureGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="itemGuid"> itemGuid </param>
        /// <param name="fieldGuid"> fieldGuid </param>
        /// <param name="fieldValue"> fieldValue </param>
        /// <returns>int</returns>
        public static int Create(
            Guid valueGuid,
            Guid siteGuid,
            Guid featureGuid,
            Guid moduleGuid,
            Guid itemGuid,
            Guid fieldGuid,
            string fieldValue)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "i7_sflexi_values_Insert", 7);

            sph.DefineSqlParameter("@ValueGuid", MyMySqlDbType.Guid, ParameterDirection.Input, valueGuid);
            sph.DefineSqlParameter("@SiteGuid", MyMySqlDbType.Guid, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@FeatureGuid", MyMySqlDbType.Guid, ParameterDirection.Input, featureGuid);
            sph.DefineSqlParameter("@ModuleGuid", MyMySqlDbType.Guid, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@ItemGuid", MyMySqlDbType.Guid, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@FieldGuid", MyMySqlDbType.Guid, ParameterDirection.Input, fieldGuid);
            sph.DefineSqlParameter("@FieldValue", MySqlDbType.Text, ParameterDirection.Input, fieldValue);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected);
        }
Example #8
0
        /// <summary> Updates a row in the mp_Reservation table. Returns true if row updated. </summary>
        /// <param name="itemId"> The item identifier. </param>
        /// <param name="ItemGuid"> The item unique identifier. </param>
        /// <param name="moduleId"> The module identifier. </param>
        /// <param name="moduleGuid"> The module unique identifier. </param>
        /// <param name="title"> title </param>
        /// <param name="description"> description </param>
        /// <param name="imageName"> imageName </param>
        /// <param name="startDate"> startDate </param>
        /// <param name="endDate"> endDate </param>
        /// <param name="location"> location </param>
        /// <param name="latitude"> The latitude. </param>
        /// <param name="longitude"> The longitude. </param>
        /// <param name="lastModUserId"> The last mod user identifier. </param>
        /// <param name="lastModUserGuid"> lastModUserGuid </param>
        /// <param name="lastModUtc"> The last mod UTC. </param>
        /// <returns> bool </returns>
        public static bool UpdateReservation(
            int itemId,
            Guid ItemGuid,
            int moduleId,
            Guid moduleGuid,
            string title,
            string description,
            string imageName,
            DateTime startDate,
            DateTime endDate,
            string location,
            string latitude,
            string longitude,
            int lastModUserId,
            Guid lastModUserGuid,
            DateTime lastModUtc)
        {
            var sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Reservation_Update", 15);

            sph.DefineSqlParameter("@ItemID", SqlDbType.Int, ParameterDirection.Input, itemId);
            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, ItemGuid);
            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, ParameterDirection.Input, title);
            sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
            sph.DefineSqlParameter("@ImageName", SqlDbType.NVarChar, ParameterDirection.Input, imageName);
            sph.DefineSqlParameter("@StartDate", SqlDbType.DateTime, ParameterDirection.Input, startDate);
            sph.DefineSqlParameter("@EndDate", SqlDbType.SmallDateTime, ParameterDirection.Input, endDate);
            sph.DefineSqlParameter("@Location", SqlDbType.NVarChar, -1, ParameterDirection.Input, location);
            sph.DefineSqlParameter("@Latitude", SqlDbType.NVarChar, -1, ParameterDirection.Input, latitude);
            sph.DefineSqlParameter("@Longitude", SqlDbType.NVarChar, -1, ParameterDirection.Input, longitude);
            sph.DefineSqlParameter("@LastModUserId", SqlDbType.Int, ParameterDirection.Input, lastModUserId);
            sph.DefineSqlParameter("@LastModUserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModUserGuid);
            sph.DefineSqlParameter("@LastModUtc", SqlDbType.DateTime, ParameterDirection.Input, lastModUtc);

            var rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
Example #9
0
        public static bool Update(
            Guid itemGuid,
            Guid orderGuid,
            Guid offerGuid,
            Guid taxClassGuid,
            decimal offerPrice,
            DateTime addedToCart,
            int quantity)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_OrderOffers_Update", 7);

            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@OrderGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, orderGuid);
            sph.DefineSqlParameter("@OfferGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, offerGuid);
            sph.DefineSqlParameter("@TaxClassGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, taxClassGuid);
            sph.DefineSqlParameter("@OfferPrice", SqlDbType.Decimal, ParameterDirection.Input, offerPrice);
            sph.DefineSqlParameter("@AddedToCart", SqlDbType.DateTime, ParameterDirection.Input, addedToCart);
            sph.DefineSqlParameter("@Quantity", SqlDbType.Int, ParameterDirection.Input, quantity);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #10
0
        public static bool Update(
            Guid guid,
            int productID,
            int customFieldID,
            int customFieldOptionID,
            string customValue,
            int stockQuantity,
            decimal overriddenPrice)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "gb_ProductProperties_Update", 7);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@ProductID", SqlDbType.Int, ParameterDirection.Input, productID);
            sph.DefineSqlParameter("@CustomFieldID", SqlDbType.Int, ParameterDirection.Input, customFieldID);
            sph.DefineSqlParameter("@CustomFieldOptionID", SqlDbType.Int, ParameterDirection.Input, customFieldOptionID);
            sph.DefineSqlParameter("@CustomValue", SqlDbType.NVarChar, -1, ParameterDirection.Input, customValue);
            sph.DefineSqlParameter("@StockQuantity", SqlDbType.Int, ParameterDirection.Input, stockQuantity);
            sph.DefineSqlParameter("@OverriddenPrice", SqlDbType.Decimal, ParameterDirection.Input, overriddenPrice);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #11
0
        /// <summary>
        /// Updates a row in the i7_sflexi_values table. Returns true if row updated.
        /// </summary>
        /// <param name="valueGuid"> valueGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="featureGuid"> featureGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="itemGuid"> itemGuid </param>
        /// <param name="fieldGuid"> fieldGuid </param>
        /// <param name="fieldValue"> fieldValue </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid valueGuid,
            Guid siteGuid,
            Guid featureGuid,
            Guid moduleGuid,
            Guid itemGuid,
            Guid fieldGuid,
            string fieldValue)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "i7_sflexi_values_Update", 7);

            sph.DefineSqlParameter("@ValueGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, valueGuid);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@FeatureGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, featureGuid);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@FieldGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, fieldGuid);
            sph.DefineSqlParameter("@FieldValue", SqlDbType.NVarChar, -1, ParameterDirection.Input, fieldValue);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #12
0
        /// <summary>
        /// Updates a row in the doan_MediaTracks table.
        /// </summary>
        /// <param name="trackID">The ID of the track.</param>
        /// <param name="playerID">The ID of the player instance.</param>
        /// <param name="trackType">The type of the track.</param>
        /// <param name="trackOrder">The order position of the Media Track.</param>
        /// <param name="name">The name of the Media Track.</param>
        /// <param name="artist">The artist of the Media Track.</param>
        /// <param name="userGuid">The Guid of the user who added the Media Track.</param>
        /// <returns>True if the row is successfully updated.</returns>
        public static bool Update(
            int trackId,
            int playerId,
            string trackType,
            int trackOrder,
            string name,
            string artist,
            Guid userGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_MediaTrack_Update", 7);

            sph.DefineSqlParameter("@TrackID", SqlDbType.Int, ParameterDirection.Input, trackId);
            sph.DefineSqlParameter("@PlayerID", SqlDbType.Int, ParameterDirection.Input, playerId);
            sph.DefineSqlParameter("@TrackType", SqlDbType.NVarChar, 10, ParameterDirection.Input, trackType);
            sph.DefineSqlParameter("@TrackOrder", SqlDbType.Int, ParameterDirection.Input, trackOrder);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 100, ParameterDirection.Input, name);
            sph.DefineSqlParameter("@Artist", SqlDbType.NVarChar, 100, ParameterDirection.Input, artist);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #13
0
        public static bool Update(
            Guid questionGuid,
            Guid surveyPageGuid,
            string questionText,
            int questionTypeId,
            bool answerIsRequired,
            int questionOrder,
            string validationMessage)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SurveyQuestions_Update", 7);

            sph.DefineSqlParameter("@QuestionGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, questionGuid);
            sph.DefineSqlParameter("@PageGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, surveyPageGuid);
            sph.DefineSqlParameter("@QuestionText", SqlDbType.NVarChar, -1, ParameterDirection.Input, questionText);
            sph.DefineSqlParameter("@QuestionTypeId", SqlDbType.Int, ParameterDirection.Input, questionTypeId);
            sph.DefineSqlParameter("@AnswerIsRequired", SqlDbType.Bit, ParameterDirection.Input, answerIsRequired);
            sph.DefineSqlParameter("@QuestionOrder", SqlDbType.Int, ParameterDirection.Input, questionOrder);
            sph.DefineSqlParameter("@ValidationMessage", SqlDbType.NVarChar, 255, ParameterDirection.Input, validationMessage);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
Example #14
0
        public bool Delete(int userId)
        {
            bool isDeleted = false;
            var  sp        = new SqlParameterHelper(StoredProcedure.DeleteUser, StoredProcedure.DeleteUserParameters);

            sp.DefineSqlParameter("@user_id", SqlDbType.Int, ParameterDirection.Input, userId);

            try
            {
                int affectedRows = sp.ExecuteNonQuery();
                if (affectedRows > 0)
                {
                    isDeleted = true;
                }
            }
            catch (SqlException exception)
            {
                _logger.Error("ERROR IN CLASS =>> USERDAO, METHOD =>> Delete, EXCEPTION MESSAGE =>> " + exception.Message);
                throw  new Exception(exception.Message);
            }
            return(isDeleted);
        }
Example #15
0
        public static int AddCart(
            Guid cartGuid,
            Guid storeGuid,
            Guid userGuid,
            decimal subTotal,
            decimal shippingTotal,
            decimal taxTotal,
            decimal orderTotal,
            DateTime created,
            string createdFromIP,
            DateTime lastModified,
            DateTime lastUserActivity,
            decimal discount,
            string discountCodesCsv,
            string customData,
            Guid clerkGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_Cart_Insert", 15);

            sph.DefineSqlParameter("@CartGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, cartGuid);
            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@SubTotal", SqlDbType.Decimal, ParameterDirection.Input, subTotal);
            sph.DefineSqlParameter("@ShippingTotal", SqlDbType.Decimal, ParameterDirection.Input, shippingTotal);
            sph.DefineSqlParameter("@TaxTotal", SqlDbType.Decimal, ParameterDirection.Input, taxTotal);
            sph.DefineSqlParameter("@OrderTotal", SqlDbType.Decimal, ParameterDirection.Input, orderTotal);
            sph.DefineSqlParameter("@Created", SqlDbType.DateTime, ParameterDirection.Input, created);
            sph.DefineSqlParameter("@CreatedFromIP", SqlDbType.NVarChar, 255, ParameterDirection.Input, createdFromIP);
            sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified);
            sph.DefineSqlParameter("@LastUserActivity", SqlDbType.DateTime, ParameterDirection.Input, lastUserActivity);
            sph.DefineSqlParameter("@CustomData", SqlDbType.NVarChar, -1, ParameterDirection.Input, customData);
            sph.DefineSqlParameter("@DiscountCodesCsv", SqlDbType.NVarChar, -1, ParameterDirection.Input, discountCodesCsv);
            sph.DefineSqlParameter("@Discount", SqlDbType.Decimal, ParameterDirection.Input, discount);
            sph.DefineSqlParameter("@ClerkGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, clerkGuid);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected);
        }
Example #16
0
        public bool SaveExpandoProperty(
            int siteId,
            Guid siteGuid,
            string groupName,
            string keyName,
            string keyValue)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_SiteSettingsEx_Save", 
                5);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@KeyName", SqlDbType.NVarChar, 128, ParameterDirection.Input, keyName);
            sph.DefineSqlParameter("@KeyValue", SqlDbType.NVarChar, -1, ParameterDirection.Input, keyValue);
            sph.DefineSqlParameter("@GroupName", SqlDbType.NVarChar, 255, ParameterDirection.Input, keyName);

            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);

        }
Example #17
0
        public bool SaveExpandoProperty(
            int siteId,
            Guid siteGuid,
            string groupName,
            string keyName,
            string keyValue)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString,
                "mp_SiteSettingsEx_Save",
                5);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@KeyName", SqlDbType.NVarChar, 128, ParameterDirection.Input, keyName);
            sph.DefineSqlParameter("@KeyValue", SqlDbType.NVarChar, -1, ParameterDirection.Input, keyValue);
            sph.DefineSqlParameter("@GroupName", SqlDbType.NVarChar, 255, ParameterDirection.Input, keyName);

            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
Example #18
0
        public bool SetUserVerified(String username)
        {
            bool isUpdated = false;
            var  sp        = new SqlParameterHelper(StoredProcedure.SetUserVerified,
                                                    StoredProcedure.SetUSerVerifiedPara);

            sp.DefineSqlParameter("@username", SqlDbType.VarChar, ParameterDirection.Input, username);

            try
            {
                int affectedRows = sp.ExecuteNonQuery();
                if (affectedRows > 0)
                {
                    isUpdated = true;
                }
            }
            catch (Exception exception)
            {
                _logger.Error("ERROR IN CLASS =>> USERDAO, METHOD =>> SaveVerificationCode, EXCEPTION MESSAGE =>> " + exception.Message);
            }

            return(isUpdated);
        }
Example #19
0
        public bool UpdateExtendedProperties(
            int siteId,
            bool allowPasswordRetrieval,
            bool allowPasswordReset,
            bool requiresQuestionAndAnswer,
            int maxInvalidPasswordAttempts,
            int passwordAttemptWindowMinutes,
            bool requiresUniqueEmail,
            int passwordFormat,
            int minRequiredPasswordLength,
            int minRequiredNonAlphanumericCharacters,
            string passwordStrengthRegularExpression,
            string defaultEmailFromAddress
            )
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString,
                "mp_Sites_UpdateExtendedProperties",
                12);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@AllowPasswordRetrieval", SqlDbType.Bit, ParameterDirection.Input, allowPasswordRetrieval);
            sph.DefineSqlParameter("@AllowPasswordReset", SqlDbType.Bit, ParameterDirection.Input, allowPasswordReset);
            sph.DefineSqlParameter("@RequiresQuestionAndAnswer", SqlDbType.Bit, ParameterDirection.Input, requiresQuestionAndAnswer);
            sph.DefineSqlParameter("@MaxInvalidPasswordAttempts", SqlDbType.Int, ParameterDirection.Input, maxInvalidPasswordAttempts);
            sph.DefineSqlParameter("@PasswordAttemptWindowMinutes", SqlDbType.Int, ParameterDirection.Input, passwordAttemptWindowMinutes);
            sph.DefineSqlParameter("@RequiresUniqueEmail", SqlDbType.Bit, ParameterDirection.Input, requiresUniqueEmail);
            sph.DefineSqlParameter("@PasswordFormat", SqlDbType.Int, ParameterDirection.Input, passwordFormat);
            sph.DefineSqlParameter("@MinRequiredPasswordLength", SqlDbType.Int, ParameterDirection.Input, minRequiredPasswordLength);
            sph.DefineSqlParameter("@MinRequiredNonAlphanumericCharacters", SqlDbType.Int, ParameterDirection.Input, minRequiredNonAlphanumericCharacters);
            sph.DefineSqlParameter("@PasswordStrengthRegularExpression", SqlDbType.NVarChar, -1, ParameterDirection.Input, passwordStrengthRegularExpression);
            sph.DefineSqlParameter("@DefaultEmailFromAddress", SqlDbType.NVarChar, 100, ParameterDirection.Input, defaultEmailFromAddress);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
Example #20
0
        public static int Add(
            Guid guid,
            Guid referenceGuid,
            Guid storeGuid,
            string imageUrl,
            int displayOrder,
            string alt,
            string title)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_Images_Insert", 7);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@ReferenceGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, referenceGuid);
            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
            sph.DefineSqlParameter("@ImageUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, imageUrl);
            sph.DefineSqlParameter("@DisplayOrder", SqlDbType.Int, ParameterDirection.Input, displayOrder);
            sph.DefineSqlParameter("@Alt", SqlDbType.NVarChar, 255, ParameterDirection.Input, alt);
            sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title);


            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected);
        }
Example #21
0
        /// <summary>
        /// Updates a row in the KLBook table. Returns true if row updated.
        /// </summary>
        /// <param name="bookID"> bookID </param>
        /// <param name="authorID"> authorID </param>
        /// <param name="title"> title </param>
        /// <param name="image"> image </param>
        /// <param name="url"> url </param>
        /// <param name="description"> description </param>
        /// <param name="isPublish"> isPublish </param>
        /// <param name="isDelected"> isDelected </param>
        /// <returns>bool</returns>
        public static bool Update(
            int bookID,
            int authorID,
            string title,
            string image,
            string url,
            string description,
            bool isPublish,
            bool isDelected)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "gb_KLBook_Update", 8);

            sph.DefineSqlParameter("@BookID", SqlDbType.Int, ParameterDirection.Input, bookID);
            sph.DefineSqlParameter("@AuthorID", SqlDbType.Int, ParameterDirection.Input, authorID);
            sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title);
            sph.DefineSqlParameter("@Image", SqlDbType.NVarChar, 255, ParameterDirection.Input, image);
            sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, 255, ParameterDirection.Input, url);
            sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
            sph.DefineSqlParameter("@IsPublish", SqlDbType.Bit, ParameterDirection.Input, isPublish);
            sph.DefineSqlParameter("@IsDelected", SqlDbType.Bit, ParameterDirection.Input, isDelected);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #22
0
        public static bool Update(
            int tagID,
            Guid siteGuid,
            Guid featureGuid,
            string tag,
            int itemCount,
            Guid guid,
            DateTime createdUtc,
            Guid createdBy)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "gb_Tag_Update", 8);

            sph.DefineSqlParameter("@TagID", SqlDbType.Int, ParameterDirection.Input, tagID);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@FeatureGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, featureGuid);
            sph.DefineSqlParameter("@Tag", SqlDbType.NVarChar, 255, ParameterDirection.Input, tag);
            sph.DefineSqlParameter("@ItemCount", SqlDbType.Int, ParameterDirection.Input, itemCount);
            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
            sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #23
0
        public static bool Update(
            int shippingTableRateID,
            int shippingMethodID,
            Guid geoZoneGuid,
            decimal fromValue,
            decimal shippingFee,
            decimal additionalValue,
            decimal additionalFee,
            decimal freeShippingOverXValue)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "gb_ShippingTableRate_Update", 8);

            sph.DefineSqlParameter("@ShippingTableRateID", SqlDbType.Int, ParameterDirection.Input, shippingTableRateID);
            sph.DefineSqlParameter("@ShippingMethodID", SqlDbType.Int, ParameterDirection.Input, shippingMethodID);
            sph.DefineSqlParameter("@GeoZoneGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, geoZoneGuid);
            sph.DefineSqlParameter("@FromValue", SqlDbType.Decimal, ParameterDirection.Input, fromValue);
            sph.DefineSqlParameter("@ShippingFee", SqlDbType.Decimal, ParameterDirection.Input, shippingFee);
            sph.DefineSqlParameter("@AdditionalValue", SqlDbType.Decimal, ParameterDirection.Input, additionalValue);
            sph.DefineSqlParameter("@AdditionalFee", SqlDbType.Decimal, ParameterDirection.Input, additionalFee);
            sph.DefineSqlParameter("@FreeShippingOverXValue", SqlDbType.Decimal, ParameterDirection.Input, freeShippingOverXValue);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #24
0
        public bool UpdateToken(string token, string username)
        {
            bool status = false;
            var  sp     = new SqlParameterHelper(StoredProcedure.UpdateToken, StoredProcedure.UpdateTokenPara);

            sp.DefineSqlParameter("@token", SqlDbType.VarChar, ParameterDirection.Input, token);
            sp.DefineSqlParameter("@username", SqlDbType.VarChar, ParameterDirection.Input, username);


            try
            {
                int affectedRows = sp.ExecuteNonQuery();
                if (affectedRows > 0)
                {
                    status = true;
                }
            }
            catch (Exception exception)
            {
                _logger.Error("ERROR IN CLASS =>> USERDAO, METHOD =>> UpdateToken, EXCEPTION MESSAGE =>> " + exception.Message);
                throw new Exception();
            }
            return(status);
        }
Example #25
0
        public static bool Update(
            Guid guid,
            byte fullfillType,
            Guid fullFillTermsGuid,
            int quantity,
            int sortOrder,
            DateTime lastModified,
            Guid lastModifiedBy,
            string lastModifiedFromIP)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_OfferProduct_Update", 8);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@FullfillType", SqlDbType.TinyInt, ParameterDirection.Input, fullfillType);
            sph.DefineSqlParameter("@FullFillTermsGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, fullFillTermsGuid);
            sph.DefineSqlParameter("@Quantity", SqlDbType.Int, ParameterDirection.Input, quantity);
            sph.DefineSqlParameter("@SortOrder", SqlDbType.Int, ParameterDirection.Input, sortOrder);
            sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified);
            sph.DefineSqlParameter("@LastModifiedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModifiedBy);
            sph.DefineSqlParameter("@LastModifiedFromIP", SqlDbType.NVarChar, 255, ParameterDirection.Input, lastModifiedFromIP);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #26
0
        public bool UpdateSchemaVersion(
            Guid applicationId,
            string applicationName,
            int major,
            int minor,
            int build,
            int revision)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString,
                "mp_SchemaVersion_Update",
                6);

            sph.DefineSqlParameter("@ApplicationID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, applicationId);
            sph.DefineSqlParameter("@ApplicationName", SqlDbType.NVarChar, ParameterDirection.Input, applicationName);
            sph.DefineSqlParameter("@Major", SqlDbType.Int, ParameterDirection.Input, major);
            sph.DefineSqlParameter("@Minor", SqlDbType.Int, ParameterDirection.Input, minor);
            sph.DefineSqlParameter("@Build", SqlDbType.Int, ParameterDirection.Input, build);
            sph.DefineSqlParameter("@Revision", SqlDbType.Int, ParameterDirection.Input, revision);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #27
0
        /// <summary>
        /// Updates a row in the mp_Surveys table. Returns true if row updated.
        /// </summary>
        /// <param name="surveyGuid"> surveyGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="surveyName"> surveyName </param>
        /// <param name="creationDate"> creationDate </param>
        /// <param name="startPageText"> startPageText </param>
        /// <param name="endPageText"> endPageText </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid surveyGuid,
            Guid siteGuid,
            string surveyName,
            DateTime creationDate,
            string startPageText,
            string endPageText,
            int submissionLimit
            )
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Survey_Update", 7);

            sph.DefineSqlParameter("@SurveyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, surveyGuid);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@SurveyName", SqlDbType.NVarChar, 255, ParameterDirection.Input, surveyName);
            sph.DefineSqlParameter("@CreationDate", SqlDbType.DateTime, ParameterDirection.Input, creationDate);
            sph.DefineSqlParameter("@StartPageText", SqlDbType.NVarChar, -1, ParameterDirection.Input, startPageText);
            sph.DefineSqlParameter("@EndPageText", SqlDbType.NVarChar, -1, ParameterDirection.Input, endPageText);
            sph.DefineSqlParameter("@SubmissionLimit", SqlDbType.Int, ParameterDirection.Input, submissionLimit);

            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #28
0
        /// <summary>
        /// Updates a row in the gb_KLNotify table. Returns true if row updated.
        /// </summary>
        /// <param name="notifyid"> notifyid </param>
        /// <param name="userName_Action"> userName_Action </param>
        /// <param name="authorID"> authorID </param>
        /// <param name="notifyType"> notifyType </param>
        /// <param name="notify"> notify </param>
        /// <param name="notifyLink"> notifyLink </param>
        /// <param name="viewed"> viewed </param>
        /// <param name="dateCreate"> dateCreate </param>
        /// <returns>bool</returns>
        public static bool Update(
            int notifyid,
            string userName_Action,
            int authorID,
            string notifyType,
            string notify,
            string notifyLink,
            bool viewed,
            DateTime dateCreate)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "gb_KLNotify_Update", 8);

            sph.DefineSqlParameter("@Notifyid", SqlDbType.Int, ParameterDirection.Input, notifyid);
            sph.DefineSqlParameter("@UserName_Action", SqlDbType.NVarChar, 100, ParameterDirection.Input, userName_Action);
            sph.DefineSqlParameter("@AuthorID", SqlDbType.Int, ParameterDirection.Input, authorID);
            sph.DefineSqlParameter("@NotifyType", SqlDbType.NVarChar, 50, ParameterDirection.Input, notifyType);
            sph.DefineSqlParameter("@Notify", SqlDbType.NVarChar, 255, ParameterDirection.Input, notify);
            sph.DefineSqlParameter("@NotifyLink", SqlDbType.NVarChar, 255, ParameterDirection.Input, notifyLink);
            sph.DefineSqlParameter("@viewed", SqlDbType.Bit, ParameterDirection.Input, viewed);
            sph.DefineSqlParameter("@DateCreate", SqlDbType.DateTime, ParameterDirection.Input, dateCreate);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #29
0
        public bool DecrementTotalPosts(int userId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_Users_DecrementTotalPosts", 
                1);

            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);
        }
Example #30
0
        public bool SetRegistrationConfirmationGuid(Guid userGuid, Guid registrationConfirmationGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_Users_SetRegistrationConfirmationGuid", 
                2);

            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@RegisterConfirmGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, registrationConfirmationGuid);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);
        }
Example #31
0
        public bool UpdateFailedPasswordAnswerAttemptStartWindow(
            Guid userGuid,
            DateTime windowStartTime)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_Users_SetFailedPasswordAnswerAttemptStartWindow", 
                2);

            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@WindowStartTime", SqlDbType.DateTime, ParameterDirection.Input, windowStartTime);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);
        }
Example #32
0
        public bool UpdateSchemaVersion(
            Guid applicationId,
            string applicationName,
            int major,
            int minor,
            int build,
            int revision)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString,
                "mp_SchemaVersion_Update",
                6);

            sph.DefineSqlParameter("@ApplicationID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, applicationId);
            sph.DefineSqlParameter("@ApplicationName", SqlDbType.NVarChar, ParameterDirection.Input, applicationName);
            sph.DefineSqlParameter("@Major", SqlDbType.Int, ParameterDirection.Input, major);
            sph.DefineSqlParameter("@Minor", SqlDbType.Int, ParameterDirection.Input, minor);
            sph.DefineSqlParameter("@Build", SqlDbType.Int, ParameterDirection.Input, build);
            sph.DefineSqlParameter("@Revision", SqlDbType.Int, ParameterDirection.Input, revision);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);
        }
        public bool UpdateRelatedSites(
            int siteId,
            bool allowNewRegistration,
            bool useSecureRegistration,
            bool useLdapAuth,
            bool autoCreateLdapUserOnFirstLogin,
            string ldapServer,
            string ldapDomain,
            int ldapPort,
            string ldapRootDN,
            string ldapUserDNKey,
            bool allowUserFullNameChange,
            bool useEmailForLogin,
            bool allowOpenIdAuth,
            bool allowWindowsLiveAuth,
            bool allowPasswordRetrieval,
            bool allowPasswordReset,
            bool requiresQuestionAndAnswer,
            int maxInvalidPasswordAttempts,
            int passwordAttemptWindowMinutes,
            bool requiresUniqueEmail,
            int passwordFormat,
            int minRequiredPasswordLength,
            int minReqNonAlphaChars,
            string pwdStrengthRegex
            )
        {

            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_Sites_UpdateRelatedSiteSecurity", 
                24);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@AllowNewRegistration", SqlDbType.Bit, ParameterDirection.Input, allowNewRegistration);
            sph.DefineSqlParameter("@UseSecureRegistration", SqlDbType.Bit, ParameterDirection.Input, useSecureRegistration);
            sph.DefineSqlParameter("@UseLdapAuth", SqlDbType.Bit, ParameterDirection.Input, useLdapAuth);
            sph.DefineSqlParameter("@AutoCreateLDAPUserOnFirstLogin", SqlDbType.Bit, ParameterDirection.Input, autoCreateLdapUserOnFirstLogin);
            sph.DefineSqlParameter("@LdapServer", SqlDbType.NVarChar, 255, ParameterDirection.Input, ldapServer);
            sph.DefineSqlParameter("@LdapDomain", SqlDbType.NVarChar, 255, ParameterDirection.Input, ldapDomain);
            sph.DefineSqlParameter("@LdapPort", SqlDbType.Int, ParameterDirection.Input, ldapPort);
            sph.DefineSqlParameter("@LdapRootDN", SqlDbType.NVarChar, 255, ParameterDirection.Input, ldapRootDN);
            sph.DefineSqlParameter("@LdapUserDNKey", SqlDbType.NVarChar, 10, ParameterDirection.Input, ldapUserDNKey);
            sph.DefineSqlParameter("@AllowUserFullNameChange", SqlDbType.Bit, ParameterDirection.Input, allowUserFullNameChange);
            sph.DefineSqlParameter("@UseEmailForLogin", SqlDbType.Bit, ParameterDirection.Input, useEmailForLogin);
            sph.DefineSqlParameter("@AllowOpenIDAuth", SqlDbType.Bit, ParameterDirection.Input, allowOpenIdAuth);
            sph.DefineSqlParameter("@AllowWindowsLiveAuth", SqlDbType.Bit, ParameterDirection.Input, allowWindowsLiveAuth);
            sph.DefineSqlParameter("@AllowPasswordRetrieval", SqlDbType.Bit, ParameterDirection.Input, allowPasswordRetrieval);
            sph.DefineSqlParameter("@AllowPasswordReset", SqlDbType.Bit, ParameterDirection.Input, allowPasswordReset);
            sph.DefineSqlParameter("@RequiresQuestionAndAnswer", SqlDbType.Bit, ParameterDirection.Input, requiresQuestionAndAnswer);
            sph.DefineSqlParameter("@MaxInvalidPasswordAttempts", SqlDbType.Int, ParameterDirection.Input, maxInvalidPasswordAttempts);
            sph.DefineSqlParameter("@PasswordAttemptWindowMinutes", SqlDbType.Int, ParameterDirection.Input, passwordAttemptWindowMinutes);
            sph.DefineSqlParameter("@RequiresUniqueEmail", SqlDbType.Bit, ParameterDirection.Input, requiresUniqueEmail);
            sph.DefineSqlParameter("@PasswordFormat", SqlDbType.Int, ParameterDirection.Input, passwordFormat);
            sph.DefineSqlParameter("@MinRequiredPasswordLength", SqlDbType.Int, ParameterDirection.Input, minRequiredPasswordLength);
            sph.DefineSqlParameter("@MinReqNonAlphaChars", SqlDbType.Int, ParameterDirection.Input, minReqNonAlphaChars);
            sph.DefineSqlParameter("@PwdStrengthRegex", SqlDbType.NVarChar, -1, ParameterDirection.Input, pwdStrengthRegex);

            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);
        }
Example #34
0
        /// <summary>
        /// Deletes a row from the mp_BannedIPAddresses table. Returns true if row deleted.
        /// </summary>
        /// <param name="rowID"> rowID </param>
        /// <returns>bool</returns>
        public bool Delete(int rowId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_BannedIPAddresses_Delete", 
                1);

            sph.DefineSqlParameter("@RowID", SqlDbType.Int, ParameterDirection.Input, rowId);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);

        }
Example #35
0
        private bool UpdateStatus(
            Guid guid,
            DateTime lastStatusUpdateUTC,
            double completeRatio,
            string status)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_TaskQueue_UpdateStatus", 
                4);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@LastStatusUpdateUTC", SqlDbType.DateTime, ParameterDirection.Input, lastStatusUpdateUTC);
            sph.DefineSqlParameter("@CompleteRatio", SqlDbType.Float, ParameterDirection.Input, completeRatio);
            sph.DefineSqlParameter("@Status", SqlDbType.NVarChar, 255, ParameterDirection.Input, status);

            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);


        }
Example #36
0
        /// <summary>
        /// Inserts a row in the mp_TaskQueue table. Returns rows affected count.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="queuedBy"> queuedBy </param>
        /// <param name="taskName"> taskName </param>
        /// <param name="notifyOnCompletion"> notifyOnCompletion </param>
        /// <param name="notificationToEmail"> notificationToEmail </param>
        /// <param name="notificationFromEmail"> notificationFromEmail </param>
        /// <param name="notificationSubject"> notificationSubject </param>
        /// <param name="taskCompleteMessage"> taskCompleteMessage </param>
        /// <param name="canStop"> canStop </param>
        /// <param name="canResume"> canResume </param>
        /// <param name="updateFrequency"> updateFrequency </param>
        /// <param name="queuedUTC"> queuedUTC </param>
        /// <param name="completeRatio"> completeRatio </param>
        /// <param name="status"> status </param>
        /// <param name="serializedTaskObject"> serializedTaskObject </param>
        /// <param name="serializedTaskType"> serializedTaskType </param>
        /// <returns>int</returns>
        public int Create(
            Guid guid,
            Guid siteGuid,
            Guid queuedBy,
            string taskName,
            bool notifyOnCompletion,
            string notificationToEmail,
            string notificationFromEmail,
            string notificationSubject,
            string taskCompleteMessage,
            bool canStop,
            bool canResume,
            int updateFrequency,
            DateTime queuedUTC,
            double completeRatio,
            string status,
            string serializedTaskObject,
            string serializedTaskType)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_TaskQueue_Insert", 
                17);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@QueuedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, queuedBy);
            sph.DefineSqlParameter("@TaskName", SqlDbType.NVarChar, 255, ParameterDirection.Input, taskName);
            sph.DefineSqlParameter("@NotifyOnCompletion", SqlDbType.Bit, ParameterDirection.Input, notifyOnCompletion);
            sph.DefineSqlParameter("@NotificationToEmail", SqlDbType.NVarChar, 255, ParameterDirection.Input, notificationToEmail);
            sph.DefineSqlParameter("@NotificationFromEmail", SqlDbType.NVarChar, 255, ParameterDirection.Input, notificationFromEmail);
            sph.DefineSqlParameter("@NotificationSubject", SqlDbType.NVarChar, 255, ParameterDirection.Input, notificationSubject);
            sph.DefineSqlParameter("@TaskCompleteMessage", SqlDbType.NVarChar, -1, ParameterDirection.Input, taskCompleteMessage);
            sph.DefineSqlParameter("@CanStop", SqlDbType.Bit, ParameterDirection.Input, canStop);
            sph.DefineSqlParameter("@CanResume", SqlDbType.Bit, ParameterDirection.Input, canResume);
            sph.DefineSqlParameter("@UpdateFrequency", SqlDbType.Int, ParameterDirection.Input, updateFrequency);
            sph.DefineSqlParameter("@QueuedUTC", SqlDbType.DateTime, ParameterDirection.Input, queuedUTC);
            sph.DefineSqlParameter("@CompleteRatio", SqlDbType.Float, ParameterDirection.Input, completeRatio);
            sph.DefineSqlParameter("@Status", SqlDbType.NVarChar, 255, ParameterDirection.Input, status);
            sph.DefineSqlParameter("@SerializedTaskObject", SqlDbType.NVarChar, -1, ParameterDirection.Input, serializedTaskObject);
            sph.DefineSqlParameter("@SerializedTaskType", SqlDbType.NVarChar, 255, ParameterDirection.Input, serializedTaskType);
            int rowsAffected = sph.ExecuteNonQuery();
            return rowsAffected;
        }
Example #37
0
        public bool UpdatePasswordAndSalt(
            int userId,
            int pwdFormat,
            string password,
            string passwordSalt)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_Users_UpdatePasswordAndSalt", 
                4);

            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
            sph.DefineSqlParameter("@Password", SqlDbType.NVarChar, 1000, ParameterDirection.Input, password);
            sph.DefineSqlParameter("@PasswordSalt", SqlDbType.NVarChar, 128, ParameterDirection.Input, passwordSalt);
            sph.DefineSqlParameter("@PwdFormat", SqlDbType.Int, ParameterDirection.Input, pwdFormat);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);
        }
Example #38
0
        public bool UpdateRelatedSites(
            int siteId,
            bool allowNewRegistration,
            bool useSecureRegistration,
            bool useLdapAuth,
            bool autoCreateLdapUserOnFirstLogin,
            string ldapServer,
            string ldapDomain,
            int ldapPort,
            string ldapRootDN,
            string ldapUserDNKey,
            bool allowUserFullNameChange,
            bool useEmailForLogin,
            bool allowOpenIdAuth,
            bool allowWindowsLiveAuth,
            bool allowPasswordRetrieval,
            bool allowPasswordReset,
            bool requiresQuestionAndAnswer,
            int maxInvalidPasswordAttempts,
            int passwordAttemptWindowMinutes,
            bool requiresUniqueEmail,
            int passwordFormat,
            int minRequiredPasswordLength,
            int minReqNonAlphaChars,
            string pwdStrengthRegex
            )
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString,
                "mp_Sites_UpdateRelatedSiteSecurity",
                24);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@AllowNewRegistration", SqlDbType.Bit, ParameterDirection.Input, allowNewRegistration);
            sph.DefineSqlParameter("@UseSecureRegistration", SqlDbType.Bit, ParameterDirection.Input, useSecureRegistration);
            sph.DefineSqlParameter("@UseLdapAuth", SqlDbType.Bit, ParameterDirection.Input, useLdapAuth);
            sph.DefineSqlParameter("@AutoCreateLDAPUserOnFirstLogin", SqlDbType.Bit, ParameterDirection.Input, autoCreateLdapUserOnFirstLogin);
            sph.DefineSqlParameter("@LdapServer", SqlDbType.NVarChar, 255, ParameterDirection.Input, ldapServer);
            sph.DefineSqlParameter("@LdapDomain", SqlDbType.NVarChar, 255, ParameterDirection.Input, ldapDomain);
            sph.DefineSqlParameter("@LdapPort", SqlDbType.Int, ParameterDirection.Input, ldapPort);
            sph.DefineSqlParameter("@LdapRootDN", SqlDbType.NVarChar, 255, ParameterDirection.Input, ldapRootDN);
            sph.DefineSqlParameter("@LdapUserDNKey", SqlDbType.NVarChar, 10, ParameterDirection.Input, ldapUserDNKey);
            sph.DefineSqlParameter("@AllowUserFullNameChange", SqlDbType.Bit, ParameterDirection.Input, allowUserFullNameChange);
            sph.DefineSqlParameter("@UseEmailForLogin", SqlDbType.Bit, ParameterDirection.Input, useEmailForLogin);
            sph.DefineSqlParameter("@AllowOpenIDAuth", SqlDbType.Bit, ParameterDirection.Input, allowOpenIdAuth);
            sph.DefineSqlParameter("@AllowWindowsLiveAuth", SqlDbType.Bit, ParameterDirection.Input, allowWindowsLiveAuth);
            sph.DefineSqlParameter("@AllowPasswordRetrieval", SqlDbType.Bit, ParameterDirection.Input, allowPasswordRetrieval);
            sph.DefineSqlParameter("@AllowPasswordReset", SqlDbType.Bit, ParameterDirection.Input, allowPasswordReset);
            sph.DefineSqlParameter("@RequiresQuestionAndAnswer", SqlDbType.Bit, ParameterDirection.Input, requiresQuestionAndAnswer);
            sph.DefineSqlParameter("@MaxInvalidPasswordAttempts", SqlDbType.Int, ParameterDirection.Input, maxInvalidPasswordAttempts);
            sph.DefineSqlParameter("@PasswordAttemptWindowMinutes", SqlDbType.Int, ParameterDirection.Input, passwordAttemptWindowMinutes);
            sph.DefineSqlParameter("@RequiresUniqueEmail", SqlDbType.Bit, ParameterDirection.Input, requiresUniqueEmail);
            sph.DefineSqlParameter("@PasswordFormat", SqlDbType.Int, ParameterDirection.Input, passwordFormat);
            sph.DefineSqlParameter("@MinRequiredPasswordLength", SqlDbType.Int, ParameterDirection.Input, minRequiredPasswordLength);
            sph.DefineSqlParameter("@MinReqNonAlphaChars", SqlDbType.Int, ParameterDirection.Input, minReqNonAlphaChars);
            sph.DefineSqlParameter("@PwdStrengthRegex", SqlDbType.NVarChar, -1, ParameterDirection.Input, pwdStrengthRegex);

            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
Example #39
0
        /// <summary>
        /// Updates a row in the mp_RedirectList table. Returns true if row updated.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        /// <param name="oldUrl"> oldUrl </param>
        /// <param name="newUrl"> newUrl </param>
        /// <param name="expireUtc"> expireUtc </param>
        /// <returns>bool</returns>
        public bool Update(
            Guid rowGuid,
            string oldUrl,
            string newUrl,
            DateTime expireUtc)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_RedirectList_Update", 
                4);

            sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid);
            sph.DefineSqlParameter("@OldUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, oldUrl);
            sph.DefineSqlParameter("@NewUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, newUrl);
            sph.DefineSqlParameter("@ExpireUtc", SqlDbType.DateTime, ParameterDirection.Input, expireUtc);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);

        }
Example #40
0
        public bool DeleteByType(string taskType)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_TaskQueue_DeleteByType", 
                1);

            sph.DefineSqlParameter("@TaskType", SqlDbType.NVarChar, 255, ParameterDirection.Input, taskType);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);

        }
Example #41
0
        /// <summary>
        /// Deletes a row from the mp_TaskQueue table. Returns true if row deleted.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <returns>bool</returns>
        public bool Delete(Guid guid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_TaskQueue_Delete", 
                1);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);

        }
Example #42
0
        public static int Add(
            Guid guid,
            Guid storeGuid,
            Guid taxClassGuid,
            string modelNumber,
            byte status,
            byte fullfillmentType,
            decimal weight,
            int quantityOnHand,
            string imageFileName,
            byte[] imageFileBytes,
            DateTime created,
            Guid createdBy,
            DateTime lastModified,
            Guid lastModifedBy,
            string url,
            string name,
            string description,
            string teaser,
            bool showInProductList,
            bool enableRating,
            string metaDescription,
            string metaKeywords,
            int sortRank1,
            int sortRank2,
            string teaserFile,
            string teaserFileLink,
            string compiledMeta,
            decimal shippingAmount)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_Product_Insert", 28);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
            sph.DefineSqlParameter("@TaxClassGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, taxClassGuid);
            sph.DefineSqlParameter("@ModelNumber", SqlDbType.NVarChar, 255, ParameterDirection.Input, modelNumber);
            sph.DefineSqlParameter("@Status", SqlDbType.TinyInt, ParameterDirection.Input, status);
            sph.DefineSqlParameter("@FullfillmentType", SqlDbType.TinyInt, ParameterDirection.Input, fullfillmentType);
            sph.DefineSqlParameter("@Weight", SqlDbType.Decimal, ParameterDirection.Input, weight);
            sph.DefineSqlParameter("@QuantityOnHand", SqlDbType.Int, ParameterDirection.Input, quantityOnHand);
            sph.DefineSqlParameter("@ImageFileName", SqlDbType.NVarChar, 255, ParameterDirection.Input, imageFileName);
            sph.DefineSqlParameter("@ImageFileBytes", SqlDbType.Image, ParameterDirection.Input, imageFileBytes);
            sph.DefineSqlParameter("@Created", SqlDbType.DateTime, ParameterDirection.Input, created);
            sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
            sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified);
            sph.DefineSqlParameter("@LastModifedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModifedBy);
            sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, 255, ParameterDirection.Input, url);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name);
            sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
            sph.DefineSqlParameter("@Abstract", SqlDbType.NVarChar, -1, ParameterDirection.Input, teaser);
            sph.DefineSqlParameter("@ShowInProductList", SqlDbType.Bit, ParameterDirection.Input, showInProductList);
            sph.DefineSqlParameter("@EnableRating", SqlDbType.Bit, ParameterDirection.Input, enableRating);
            sph.DefineSqlParameter("@MetaDescription", SqlDbType.NVarChar, 255, ParameterDirection.Input, metaDescription);
            sph.DefineSqlParameter("@MetaKeywords", SqlDbType.NVarChar, 255, ParameterDirection.Input, metaKeywords);
            sph.DefineSqlParameter("@SortRank1", SqlDbType.Int, ParameterDirection.Input, sortRank1);
            sph.DefineSqlParameter("@SortRank2", SqlDbType.Int, ParameterDirection.Input, sortRank2);
            sph.DefineSqlParameter("@TeaserFile", SqlDbType.NVarChar, 255, ParameterDirection.Input, teaserFile);
            sph.DefineSqlParameter("@TeaserFileLink", SqlDbType.NVarChar, 255, ParameterDirection.Input, teaserFileLink);
            sph.DefineSqlParameter("@CompiledMeta", SqlDbType.NVarChar, -1, ParameterDirection.Input, compiledMeta);
            sph.DefineSqlParameter("@ShippingAmount", SqlDbType.Decimal, ParameterDirection.Input, shippingAmount);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected);
        }
Example #43
0
        public string Login(int siteId, string loginName, string password)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString, 
                "mp_Users_Login", 
                4);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@LoginName", SqlDbType.NVarChar, 50, ParameterDirection.Input, loginName);
            sph.DefineSqlParameter("@Password", SqlDbType.NVarChar, 1000, ParameterDirection.Input, password);
            sph.DefineSqlParameter("@UserName", SqlDbType.NVarChar, 100, ParameterDirection.InputOutput, null);
            sph.ExecuteNonQuery();


            if (sph.Parameters[3] != null)
            {
                return sph.Parameters[3].Value.ToString();
            }
            else
            {
                return string.Empty;
            }

        }
        public bool UpdateExtendedProperties(
            int siteId,
            bool allowPasswordRetrieval,
            bool allowPasswordReset,
            bool requiresQuestionAndAnswer,
            int maxInvalidPasswordAttempts,
            int passwordAttemptWindowMinutes,
            bool requiresUniqueEmail,
            int passwordFormat,
            int minRequiredPasswordLength,
            int minRequiredNonAlphanumericCharacters,
            String passwordStrengthRegularExpression,
            String defaultEmailFromAddress
            )
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_Sites_UpdateExtendedProperties", 
                12);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@AllowPasswordRetrieval", SqlDbType.Bit, ParameterDirection.Input, allowPasswordRetrieval);
            sph.DefineSqlParameter("@AllowPasswordReset", SqlDbType.Bit, ParameterDirection.Input, allowPasswordReset);
            sph.DefineSqlParameter("@RequiresQuestionAndAnswer", SqlDbType.Bit, ParameterDirection.Input, requiresQuestionAndAnswer);
            sph.DefineSqlParameter("@MaxInvalidPasswordAttempts", SqlDbType.Int, ParameterDirection.Input, maxInvalidPasswordAttempts);
            sph.DefineSqlParameter("@PasswordAttemptWindowMinutes", SqlDbType.Int, ParameterDirection.Input, passwordAttemptWindowMinutes);
            sph.DefineSqlParameter("@RequiresUniqueEmail", SqlDbType.Bit, ParameterDirection.Input, requiresUniqueEmail);
            sph.DefineSqlParameter("@PasswordFormat", SqlDbType.Int, ParameterDirection.Input, passwordFormat);
            sph.DefineSqlParameter("@MinRequiredPasswordLength", SqlDbType.Int, ParameterDirection.Input, minRequiredPasswordLength);
            sph.DefineSqlParameter("@MinRequiredNonAlphanumericCharacters", SqlDbType.Int, ParameterDirection.Input, minRequiredNonAlphanumericCharacters);
            sph.DefineSqlParameter("@PasswordStrengthRegularExpression", SqlDbType.NVarChar, -1, ParameterDirection.Input, passwordStrengthRegularExpression);
            sph.DefineSqlParameter("@DefaultEmailFromAddress", SqlDbType.NVarChar, 100, ParameterDirection.Input, defaultEmailFromAddress);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);
        }
Example #45
0
        public bool DeletePropertiesByUser(Guid userGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_UserProperties_DeleteByUser", 
                1);

            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);
        }
        public bool UpdateRelatedSitesWindowsLive(
            int siteId,
            string windowsLiveAppId,
            string windowsLiveKey
            )
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_Sites_SyncRelatedSitesWinLive", 
                3);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@WindowsLiveAppID", SqlDbType.NVarChar, 255, ParameterDirection.Input, windowsLiveAppId);
            sph.DefineSqlParameter("@WindowsLiveKey", SqlDbType.NVarChar, 255, ParameterDirection.Input, windowsLiveKey);

            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);
        }
Example #47
0
        /// <summary>
        /// Deletes a row from the mp_UserLocation table. Returns true if row deleted.
        /// </summary>
        /// <param name="rowID"> rowID </param>
        /// <returns>bool</returns>
        public bool Delete(Guid rowID)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_UserLocation_Delete", 
                1);

            sph.DefineSqlParameter("@RowID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowID);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);

        }
Example #48
0
        public void UpdateProperty(
            Guid userGuid,
            String propertyName,
            String propertyValue,
            byte[] propertyValueBinary,
            DateTime lastUpdateDate,
            bool isLazyLoaded)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_UserProperties_Update", 
                6);

            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@PropertyName", SqlDbType.NVarChar, 255, ParameterDirection.Input, propertyName);
            sph.DefineSqlParameter("@PropertyValueString", SqlDbType.NVarChar, -1, ParameterDirection.Input, propertyValue);
            sph.DefineSqlParameter("@PropertyValueBinary", SqlDbType.VarBinary, -1, ParameterDirection.Input, propertyValueBinary);
            sph.DefineSqlParameter("@LastUpdatedDate", SqlDbType.DateTime, ParameterDirection.Input, lastUpdateDate);
            sph.DefineSqlParameter("@isLazyLoaded", SqlDbType.Bit, ParameterDirection.Input, isLazyLoaded);
            sph.ExecuteNonQuery();
        }
Example #49
0
        public bool UpdateNotification(
            Guid guid,
            DateTime notificationSentUtc)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_TaskQueue_UpdateNotification", 
                2);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@NotificationSentUTC", SqlDbType.DateTime, ParameterDirection.Input, notificationSentUtc);

            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);


        }
Example #50
0
        public bool UpdateLastPasswordChangeTime(Guid userGuid, DateTime lastPasswordChangeTime)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_Users_UpdateLastPasswordChangeTime", 
                2);

            sph.DefineSqlParameter("@UserID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@PasswordChangeTime", SqlDbType.DateTime, ParameterDirection.Input, lastPasswordChangeTime);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);
        }
Example #51
0
        public bool UpdateRelatedSitesProperty(
            int siteId,
            string keyName,
            string keyValue)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_SiteSettingsEx_UpdateRelated", 
                3);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@KeyName", SqlDbType.NVarChar, 128, ParameterDirection.Input, keyName);
            sph.DefineSqlParameter("@KeyValue", SqlDbType.NVarChar, -1, ParameterDirection.Input, keyValue);


            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);

        }
Example #52
0
        public bool UpdateFailedPasswordAnswerAttemptCount(
            Guid userGuid,
            int attemptCount)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_Users_SetFailedPasswordAnswerAttemptCount", 
                2);

            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@AttemptCount", SqlDbType.Int, ParameterDirection.Input, attemptCount);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);
        }
Example #53
0
        /// <summary>
        /// Inserts a row in the i7_sflexi_fields table. Returns rows affected count.
        /// </summary>
        /// <returns>int</returns>
        public static int Create(
            Guid siteGuid,
            Guid featureGuid,
            Guid definitionGuid,
            Guid fieldGuid,
            string definitionName,
            string name,
            string label,
            string defaultValue,
            string controlType,
            string controlSrc,
            int sortOrder,
            string helpKey,
            bool required,
            string requiredMessageFormat,
            string regex,
            string regexMessageFormat,
            string token,
            string preTokenString,
            string postTokenString,
            bool searchable,
            string editPageControlWrapperCssClass,
            string editPageLabelCssClass,
            string editPageControlCssClass,
            bool datePickerIncludeTimeForDate,
            bool datePickerShowMonthList,
            bool datePickerShowYearList,
            string datePickerYearRange,
            string imageBrowserEmptyUrl,
            string options,
            bool checkBoxReturnBool,
            string checkBoxReturnValueWhenTrue,
            string checkBoxReturnValueWhenFalse,
            string dateFormat,
            string textBoxMode,
            string attributes,
            bool isGlobal)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "i7_sflexi_fields_Insert", 36);

            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@FeatureGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, featureGuid);
            sph.DefineSqlParameter("@DefinitionGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, definitionGuid);
            sph.DefineSqlParameter("@FieldGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, fieldGuid);
            sph.DefineSqlParameter("@DefinitionName", SqlDbType.NVarChar, 50, ParameterDirection.Input, definitionName);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 50, ParameterDirection.Input, name);
            sph.DefineSqlParameter("@Label", SqlDbType.NVarChar, 255, ParameterDirection.Input, label);
            sph.DefineSqlParameter("@DefaultValue", SqlDbType.NVarChar, -1, ParameterDirection.Input, defaultValue);
            sph.DefineSqlParameter("@ControlType", SqlDbType.NVarChar, 25, ParameterDirection.Input, controlType);
            sph.DefineSqlParameter("@ControlSrc", SqlDbType.NVarChar, -1, ParameterDirection.Input, controlSrc);
            sph.DefineSqlParameter("@SortOrder", SqlDbType.Int, ParameterDirection.Input, sortOrder);
            sph.DefineSqlParameter("@HelpKey", SqlDbType.NVarChar, 255, ParameterDirection.Input, helpKey);
            sph.DefineSqlParameter("@Required", SqlDbType.Bit, ParameterDirection.Input, required);
            sph.DefineSqlParameter("@RequiredMessageFormat", SqlDbType.NVarChar, -1, ParameterDirection.Input, requiredMessageFormat);
            sph.DefineSqlParameter("@Regex", SqlDbType.NVarChar, -1, ParameterDirection.Input, regex);
            sph.DefineSqlParameter("@RegexMessageFormat", SqlDbType.NVarChar, -1, ParameterDirection.Input, regexMessageFormat);
            sph.DefineSqlParameter("@Token", SqlDbType.NVarChar, -1, ParameterDirection.Input, token);
            sph.DefineSqlParameter("@PreTokenString", SqlDbType.NVarChar, -1, ParameterDirection.Input, preTokenString);
            sph.DefineSqlParameter("@PostTokenString", SqlDbType.NVarChar, -1, ParameterDirection.Input, postTokenString);
            sph.DefineSqlParameter("@Searchable", SqlDbType.Bit, ParameterDirection.Input, searchable);
            sph.DefineSqlParameter("@EditPageControlWrapperCssClass", SqlDbType.NVarChar, 50, ParameterDirection.Input, editPageControlWrapperCssClass);
            sph.DefineSqlParameter("@EditPageLabelCssClass", SqlDbType.NVarChar, 50, ParameterDirection.Input, editPageLabelCssClass);
            sph.DefineSqlParameter("@EditPageControlCssClass", SqlDbType.NVarChar, 50, ParameterDirection.Input, editPageControlCssClass);
            sph.DefineSqlParameter("@DatePickerIncludeTimeForDate", SqlDbType.Bit, ParameterDirection.Input, datePickerIncludeTimeForDate);
            sph.DefineSqlParameter("@DatePickerShowMonthList", SqlDbType.Bit, ParameterDirection.Input, datePickerShowMonthList);
            sph.DefineSqlParameter("@DatePickerShowYearList", SqlDbType.Bit, ParameterDirection.Input, datePickerShowYearList);
            sph.DefineSqlParameter("@DatePickerYearRange", SqlDbType.NVarChar, 10, ParameterDirection.Input, datePickerYearRange);
            sph.DefineSqlParameter("@ImageBrowserEmptyUrl", SqlDbType.NVarChar, -1, ParameterDirection.Input, imageBrowserEmptyUrl);
            sph.DefineSqlParameter("@Options", SqlDbType.NVarChar, -1, ParameterDirection.Input, options);
            sph.DefineSqlParameter("@CheckBoxReturnBool", SqlDbType.Bit, ParameterDirection.Input, checkBoxReturnBool);
            sph.DefineSqlParameter("@CheckBoxReturnValueWhenTrue", SqlDbType.NVarChar, -1, ParameterDirection.Input, checkBoxReturnValueWhenTrue);
            sph.DefineSqlParameter("@CheckBoxReturnValueWhenFalse", SqlDbType.NVarChar, -1, ParameterDirection.Input, checkBoxReturnValueWhenFalse);
            sph.DefineSqlParameter("@DateFormat", SqlDbType.NVarChar, -1, ParameterDirection.Input, dateFormat);
            sph.DefineSqlParameter("@TextBoxMode", SqlDbType.NVarChar, 25, ParameterDirection.Input, textBoxMode);
            sph.DefineSqlParameter("@Attributes", SqlDbType.NVarChar, 100, ParameterDirection.Input, attributes);
            sph.DefineSqlParameter("@IsGlobal", SqlDbType.Bit, ParameterDirection.Input, isGlobal);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected);
        }
Example #54
0
        //public bool UpdatePasswordAndSalt(
        //    int userId,
        //    int pwdFormat,
        //    string password,
        //    string passwordSalt)
        //{
        //    SqlParameterHelper sph = new SqlParameterHelper(
        //        logFactory,
        //        writeConnectionString, 
        //        "mp_Users_UpdatePasswordAndSalt", 
        //        4);

        //    sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
        //    sph.DefineSqlParameter("@Password", SqlDbType.NVarChar, 1000, ParameterDirection.Input, password);
        //    sph.DefineSqlParameter("@PasswordSalt", SqlDbType.NVarChar, 128, ParameterDirection.Input, passwordSalt);
        //    sph.DefineSqlParameter("@PwdFormat", SqlDbType.Int, ParameterDirection.Input, pwdFormat);
        //    int rowsAffected = sph.ExecuteNonQuery();
        //    return (rowsAffected > -1);
        //}

        public bool UpdatePasswordQuestionAndAnswer(
            Guid userGuid,
            String passwordQuestion,
            String passwordAnswer)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_Users_UpdatePasswordQuestionAndAnswer", 
                3);

            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@PasswordQuestion", SqlDbType.NVarChar, 255, ParameterDirection.Input, passwordQuestion);
            sph.DefineSqlParameter("@PasswordAnswer", SqlDbType.NVarChar, 255, ParameterDirection.Input, passwordAnswer);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);
        }
Example #55
0
        public static int Add(
            Guid cartGuid,
            string customerFirstName,
            string customerLastName,
            string customerCompany,
            string customerAddressLine1,
            string customerAddressLine2,
            string customerSuburb,
            string customerCity,
            string customerPostalCode,
            string customerState,
            string customerCountry,
            string customerTelephoneDay,
            string customerTelephoneNight,
            string customerEmail,
            bool customerEmailVerified,
            string deliveryFirstName,
            string deliveryLastName,
            string deliveryCompany,
            string deliveryAddress1,
            string deliveryAddress2,
            string deliverySuburb,
            string deliveryCity,
            string deliveryPostalCode,
            string deliveryState,
            string deliveryCountry,
            string billingFirstName,
            string billingLastName,
            string billingCompany,
            string billingAddress1,
            string billingAddress2,
            string billingSuburb,
            string billingCity,
            string billingPostalCode,
            string billingState,
            string billingCountry,
            Guid cardTypeGuid,
            string cardOwner,
            string cardNumber,
            string cardExpires,
            string cardSecurityCode,
            DateTime completed,
            string completedFromIP,
            Guid taxZoneGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_CartOrderInfo_Insert", 43);

            sph.DefineSqlParameter("@CartGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, cartGuid);
            sph.DefineSqlParameter("@CustomerFirstName", SqlDbType.NVarChar, 100, ParameterDirection.Input, customerFirstName);
            sph.DefineSqlParameter("@CustomerLastName", SqlDbType.NVarChar, 100, ParameterDirection.Input, customerLastName);
            sph.DefineSqlParameter("@CustomerCompany", SqlDbType.NVarChar, 255, ParameterDirection.Input, customerCompany);
            sph.DefineSqlParameter("@CustomerAddressLine1", SqlDbType.NVarChar, 255, ParameterDirection.Input, customerAddressLine1);
            sph.DefineSqlParameter("@CustomerAddressLine2", SqlDbType.NVarChar, 255, ParameterDirection.Input, customerAddressLine2);
            sph.DefineSqlParameter("@CustomerSuburb", SqlDbType.NVarChar, 255, ParameterDirection.Input, customerSuburb);
            sph.DefineSqlParameter("@CustomerCity", SqlDbType.NVarChar, 255, ParameterDirection.Input, customerCity);
            sph.DefineSqlParameter("@CustomerPostalCode", SqlDbType.NVarChar, 20, ParameterDirection.Input, customerPostalCode);
            sph.DefineSqlParameter("@CustomerState", SqlDbType.NVarChar, 255, ParameterDirection.Input, customerState);
            sph.DefineSqlParameter("@CustomerCountry", SqlDbType.NVarChar, 255, ParameterDirection.Input, customerCountry);
            sph.DefineSqlParameter("@CustomerTelephoneDay", SqlDbType.NVarChar, 32, ParameterDirection.Input, customerTelephoneDay);
            sph.DefineSqlParameter("@CustomerTelephoneNight", SqlDbType.NVarChar, 32, ParameterDirection.Input, customerTelephoneNight);
            sph.DefineSqlParameter("@CustomerEmail", SqlDbType.NVarChar, 96, ParameterDirection.Input, customerEmail);
            sph.DefineSqlParameter("@CustomerEmailVerified", SqlDbType.Bit, ParameterDirection.Input, customerEmailVerified);
            sph.DefineSqlParameter("@DeliveryFirstName", SqlDbType.NVarChar, 100, ParameterDirection.Input, deliveryFirstName);
            sph.DefineSqlParameter("@DeliveryLastName", SqlDbType.NVarChar, 100, ParameterDirection.Input, deliveryLastName);
            sph.DefineSqlParameter("@DeliveryCompany", SqlDbType.NVarChar, 255, ParameterDirection.Input, deliveryCompany);
            sph.DefineSqlParameter("@DeliveryAddress1", SqlDbType.NVarChar, 255, ParameterDirection.Input, deliveryAddress1);
            sph.DefineSqlParameter("@DeliveryAddress2", SqlDbType.NVarChar, 255, ParameterDirection.Input, deliveryAddress2);
            sph.DefineSqlParameter("@DeliverySuburb", SqlDbType.NVarChar, 255, ParameterDirection.Input, deliverySuburb);
            sph.DefineSqlParameter("@DeliveryCity", SqlDbType.NVarChar, 255, ParameterDirection.Input, deliveryCity);
            sph.DefineSqlParameter("@DeliveryPostalCode", SqlDbType.NVarChar, 20, ParameterDirection.Input, deliveryPostalCode);
            sph.DefineSqlParameter("@DeliveryState", SqlDbType.NVarChar, 255, ParameterDirection.Input, deliveryState);
            sph.DefineSqlParameter("@DeliveryCountry", SqlDbType.NVarChar, 255, ParameterDirection.Input, deliveryCountry);
            sph.DefineSqlParameter("@BillingFirstName", SqlDbType.NVarChar, 100, ParameterDirection.Input, billingFirstName);
            sph.DefineSqlParameter("@BillingLastName", SqlDbType.NVarChar, 100, ParameterDirection.Input, billingLastName);
            sph.DefineSqlParameter("@BillingCompany", SqlDbType.NVarChar, 255, ParameterDirection.Input, billingCompany);
            sph.DefineSqlParameter("@BillingAddress1", SqlDbType.NVarChar, 255, ParameterDirection.Input, billingAddress1);
            sph.DefineSqlParameter("@BillingAddress2", SqlDbType.NVarChar, 255, ParameterDirection.Input, billingAddress2);
            sph.DefineSqlParameter("@BillingSuburb", SqlDbType.NVarChar, 255, ParameterDirection.Input, billingSuburb);
            sph.DefineSqlParameter("@BillingCity", SqlDbType.NVarChar, 255, ParameterDirection.Input, billingCity);
            sph.DefineSqlParameter("@BillingPostalCode", SqlDbType.NVarChar, 20, ParameterDirection.Input, billingPostalCode);
            sph.DefineSqlParameter("@BillingState", SqlDbType.NVarChar, 255, ParameterDirection.Input, billingState);
            sph.DefineSqlParameter("@BillingCountry", SqlDbType.NVarChar, 255, ParameterDirection.Input, billingCountry);
            sph.DefineSqlParameter("@CardTypeGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, cardTypeGuid);
            sph.DefineSqlParameter("@CardOwner", SqlDbType.NVarChar, 100, ParameterDirection.Input, cardOwner);
            sph.DefineSqlParameter("@CardNumber", SqlDbType.NVarChar, 255, ParameterDirection.Input, cardNumber);
            sph.DefineSqlParameter("@CardExpires", SqlDbType.NVarChar, 6, ParameterDirection.Input, cardExpires);
            sph.DefineSqlParameter("@CardSecurityCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, cardSecurityCode);
            sph.DefineSqlParameter("@Completed", SqlDbType.DateTime, ParameterDirection.Input, completed);
            sph.DefineSqlParameter("@CompletedFromIP", SqlDbType.NVarChar, 255, ParameterDirection.Input, completedFromIP);
            sph.DefineSqlParameter("@TaxZoneGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, taxZoneGuid);


            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected);
        }
Example #56
0
        public static bool Update(
            int productID,
            int siteID,
            int zoneID,
            string title,
            string subTitle,
            string url,
            string code,
            string briefContent,
            string fullContent,
            int productType,
            bool openInNewWindow,
            int position,
            int showOption,
            bool isPublished,
            DateTime startDate,
            DateTime endDate,
            int displayOrder,
            decimal price,
            decimal oldPrice,
            decimal specialPrice,
            DateTime?specialPriceStartDate,
            DateTime?specialPriceEndDate,
            int viewCount,
            int commentCount,
            string metaTitle,
            string metaKeywords,
            string metaDescription,
            string additionalMetaTags,
            string compiledMeta,
            int manufacturerID,
            int stockQuantity,
            bool disableBuyButton,
            string fileAttachment,
            Guid productGuid,
            Guid userGuid,
            DateTime createdUtc,
            DateTime lastModUtc,
            Guid lastModUserGuid,
            bool isDeleted)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "gb_Product_Update", 39);

            sph.DefineSqlParameter("@ProductID", SqlDbType.Int, ParameterDirection.Input, productID);
            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteID);
            sph.DefineSqlParameter("@ZoneID", SqlDbType.Int, ParameterDirection.Input, zoneID);
            sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title);
            sph.DefineSqlParameter("@SubTitle", SqlDbType.NVarChar, 255, ParameterDirection.Input, subTitle);
            sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, 255, ParameterDirection.Input, url);
            sph.DefineSqlParameter("@Code", SqlDbType.NVarChar, 255, ParameterDirection.Input, code);
            sph.DefineSqlParameter("@BriefContent", SqlDbType.NVarChar, -1, ParameterDirection.Input, briefContent);
            sph.DefineSqlParameter("@FullContent", SqlDbType.NVarChar, -1, ParameterDirection.Input, fullContent);
            sph.DefineSqlParameter("@ProductType", SqlDbType.Int, ParameterDirection.Input, productType);
            sph.DefineSqlParameter("@OpenInNewWindow", SqlDbType.Bit, ParameterDirection.Input, openInNewWindow);
            sph.DefineSqlParameter("@Position", SqlDbType.Int, ParameterDirection.Input, position);
            sph.DefineSqlParameter("@ShowOption", SqlDbType.Int, ParameterDirection.Input, showOption);
            sph.DefineSqlParameter("@IsPublished", SqlDbType.Bit, ParameterDirection.Input, isPublished);
            sph.DefineSqlParameter("@StartDate", SqlDbType.DateTime, ParameterDirection.Input, startDate);
            if (endDate < DateTime.MaxValue)
            {
                sph.DefineSqlParameter("@EndDate", SqlDbType.DateTime, ParameterDirection.Input, endDate);
            }
            else
            {
                sph.DefineSqlParameter("@EndDate", SqlDbType.DateTime, ParameterDirection.Input, DBNull.Value);
            }
            sph.DefineSqlParameter("@DisplayOrder", SqlDbType.Int, ParameterDirection.Input, displayOrder);
            sph.DefineSqlParameter("@Price", SqlDbType.Decimal, ParameterDirection.Input, price);
            sph.DefineSqlParameter("@OldPrice", SqlDbType.Decimal, ParameterDirection.Input, oldPrice);
            sph.DefineSqlParameter("@SpecialPrice", SqlDbType.Decimal, ParameterDirection.Input, specialPrice);
            sph.DefineSqlParameter("@SpecialPriceStartDate", SqlDbType.DateTime, ParameterDirection.Input, specialPriceStartDate);
            sph.DefineSqlParameter("@SpecialPriceEndDate", SqlDbType.DateTime, ParameterDirection.Input, specialPriceEndDate);
            sph.DefineSqlParameter("@ViewCount", SqlDbType.Int, ParameterDirection.Input, viewCount);
            sph.DefineSqlParameter("@CommentCount", SqlDbType.Int, ParameterDirection.Input, commentCount);
            sph.DefineSqlParameter("@MetaTitle", SqlDbType.NVarChar, 255, ParameterDirection.Input, metaTitle);
            sph.DefineSqlParameter("@MetaKeywords", SqlDbType.NVarChar, 255, ParameterDirection.Input, metaKeywords);
            sph.DefineSqlParameter("@MetaDescription", SqlDbType.NVarChar, 255, ParameterDirection.Input, metaDescription);
            sph.DefineSqlParameter("@AdditionalMetaTags", SqlDbType.NVarChar, -1, ParameterDirection.Input, additionalMetaTags);
            sph.DefineSqlParameter("@CompiledMeta", SqlDbType.NVarChar, -1, ParameterDirection.Input, compiledMeta);
            sph.DefineSqlParameter("@ManufacturerID", SqlDbType.Int, ParameterDirection.Input, manufacturerID);
            sph.DefineSqlParameter("@StockQuantity", SqlDbType.Int, ParameterDirection.Input, stockQuantity);
            sph.DefineSqlParameter("@DisableBuyButton", SqlDbType.Bit, ParameterDirection.Input, disableBuyButton);
            sph.DefineSqlParameter("@FileAttachment", SqlDbType.NVarChar, 255, ParameterDirection.Input, fileAttachment);
            sph.DefineSqlParameter("@ProductGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, productGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
            sph.DefineSqlParameter("@LastModUtc", SqlDbType.DateTime, ParameterDirection.Input, lastModUtc);
            sph.DefineSqlParameter("@LastModUserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModUserGuid);
            sph.DefineSqlParameter("@IsDeleted", SqlDbType.Bit, ParameterDirection.Input, isDeleted);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
Example #57
0
        /// <summary>
        /// Inserts a row in the mp_UserLocation table. Returns rows affected count.
        /// </summary>
        /// <param name="rowID"> rowID </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="iPAddress"> iPAddress </param>
        /// <param name="iPAddressLong"> iPAddressLong </param>
        /// <param name="hostname"> hostname </param>
        /// <param name="longitude"> longitude </param>
        /// <param name="latitude"> latitude </param>
        /// <param name="iSP"> iSP </param>
        /// <param name="continent"> continent </param>
        /// <param name="country"> country </param>
        /// <param name="region"> region </param>
        /// <param name="city"> city </param>
        /// <param name="timeZone"> timeZone </param>
        /// <param name="captureCount"> captureCount </param>
        /// <param name="firstCaptureUTC"> firstCaptureUTC </param>
        /// <param name="lastCaptureUTC"> lastCaptureUTC </param>
        /// <returns>int</returns>
        public int Create(
            Guid rowID,
            Guid userGuid,
            Guid siteGuid,
            string iPAddress,
            long iPAddressLong,
            string hostname,
            double longitude,
            double latitude,
            string iSP,
            string continent,
            string country,
            string region,
            string city,
            string timeZone,
            int captureCount,
            DateTime firstCaptureUTC,
            DateTime lastCaptureUTC)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_UserLocation_Insert", 
                17);

            sph.DefineSqlParameter("@RowID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowID);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@IPAddress", SqlDbType.NVarChar, 50, ParameterDirection.Input, iPAddress);
            sph.DefineSqlParameter("@IPAddressLong", SqlDbType.BigInt, ParameterDirection.Input, iPAddressLong);
            sph.DefineSqlParameter("@Hostname", SqlDbType.NVarChar, 255, ParameterDirection.Input, hostname);
            sph.DefineSqlParameter("@Longitude", SqlDbType.Float, ParameterDirection.Input, longitude);
            sph.DefineSqlParameter("@Latitude", SqlDbType.Float, ParameterDirection.Input, latitude);
            sph.DefineSqlParameter("@ISP", SqlDbType.NVarChar, 255, ParameterDirection.Input, iSP);
            sph.DefineSqlParameter("@Continent", SqlDbType.NVarChar, 255, ParameterDirection.Input, continent);
            sph.DefineSqlParameter("@Country", SqlDbType.NVarChar, 255, ParameterDirection.Input, country);
            sph.DefineSqlParameter("@Region", SqlDbType.NVarChar, 255, ParameterDirection.Input, region);
            sph.DefineSqlParameter("@City", SqlDbType.NVarChar, 255, ParameterDirection.Input, city);
            sph.DefineSqlParameter("@TimeZone", SqlDbType.NVarChar, 255, ParameterDirection.Input, timeZone);
            sph.DefineSqlParameter("@CaptureCount", SqlDbType.Int, ParameterDirection.Input, captureCount);
            sph.DefineSqlParameter("@FirstCaptureUTC", SqlDbType.DateTime, ParameterDirection.Input, firstCaptureUTC);
            sph.DefineSqlParameter("@LastCaptureUTC", SqlDbType.DateTime, ParameterDirection.Input, lastCaptureUTC);
            int rowsAffected = sph.ExecuteNonQuery();
            return rowsAffected;
        }