Esempio n. 1
0
        public static int Create(
            int siteID,
            int shippingProvider,
            string name,
            string description,
            decimal shippingFee,
            bool freeShippingOverXEnabled,
            decimal freeShippingOverXValue,
            int displayOrder,
            bool isActive,
            Guid guid,
            bool isDeleted)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "gb_ShippingMethod_Insert", 11);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteID);
            sph.DefineSqlParameter("@ShippingProvider", SqlDbType.Int, ParameterDirection.Input, shippingProvider);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name);
            sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
            sph.DefineSqlParameter("@ShippingFee", SqlDbType.Decimal, ParameterDirection.Input, shippingFee);
            sph.DefineSqlParameter("@FreeShippingOverXEnabled", SqlDbType.Bit, ParameterDirection.Input, freeShippingOverXEnabled);
            sph.DefineSqlParameter("@FreeShippingOverXValue", SqlDbType.Decimal, ParameterDirection.Input, freeShippingOverXValue);
            sph.DefineSqlParameter("@DisplayOrder", SqlDbType.Int, ParameterDirection.Input, displayOrder);
            sph.DefineSqlParameter("@IsActive", SqlDbType.Bit, ParameterDirection.Input, isActive);
            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@IsDeleted", SqlDbType.Bit, ParameterDirection.Input, isDeleted);
            int newID = Convert.ToInt32(sph.ExecuteScalar());

            return(newID);
        }
Esempio n. 2
0
        public static int GetCountByAuthor(int authorid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "gb_KLNews_GetCountByAuthorId", 1);

            sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, authorid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 3
0
        /// <summary>
        /// Inserts a row in the gb_KLNews table. Returns new integer id.
        /// </summary>
        /// <param name="newsID"> newsID </param>
        /// <param name="authorID"> authorID </param>
        /// <param name="viewCount"> viewCount </param>
        /// <param name="shareCount"> shareCount </param>
        /// <param name="commentCount"> commentCount </param>
        /// <param name="likeCount"> likeCount </param>
        /// <param name="approvedBy"> approvedBy </param>
        /// <param name="newType"> newType </param>
        /// <param name="newlsevel"> newlsevel </param>
        /// <param name="newstotalpoint"> newstotalpoint </param>
        /// <param name="isdraft"> isdraft </param>
        /// <param name="isapproved"> isapproved </param>
        /// <returns>int</returns>
        public static int Create(
            int newsID,
            int authorID,
            int viewCount,
            int shareCount,
            int commentCount,
            int likeCount,
            string approvedBy,
            int newType,
            int newlsevel,
            int newstotalpoint,
            bool isdraft,
            bool isapproved)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "gb_KLNews_Insert", 12);

            sph.DefineSqlParameter("@NewsID", SqlDbType.Int, ParameterDirection.Input, newsID);
            sph.DefineSqlParameter("@AuthorID", SqlDbType.Int, ParameterDirection.Input, authorID);
            sph.DefineSqlParameter("@ViewCount", SqlDbType.Int, ParameterDirection.Input, viewCount);
            sph.DefineSqlParameter("@ShareCount", SqlDbType.Int, ParameterDirection.Input, shareCount);
            sph.DefineSqlParameter("@CommentCount", SqlDbType.Int, ParameterDirection.Input, commentCount);
            sph.DefineSqlParameter("@LikeCount", SqlDbType.Int, ParameterDirection.Input, likeCount);
            sph.DefineSqlParameter("@ApprovedBy", SqlDbType.NVarChar, 100, ParameterDirection.Input, approvedBy);
            sph.DefineSqlParameter("@NewType", SqlDbType.Int, ParameterDirection.Input, newType);
            sph.DefineSqlParameter("@Newlsevel", SqlDbType.Int, ParameterDirection.Input, newlsevel);
            sph.DefineSqlParameter("@Newstotalpoint", SqlDbType.Int, ParameterDirection.Input, newstotalpoint);
            sph.DefineSqlParameter("@Isdraft", SqlDbType.Bit, ParameterDirection.Input, isdraft);
            sph.DefineSqlParameter("@Isapproved", SqlDbType.Bit, ParameterDirection.Input, isapproved);
            int newID = Convert.ToInt32(sph.ExecuteScalar());

            return(newID);
        }
Esempio n. 4
0
        /// <summary>
        /// Gets a count of responses in to a survey.
        /// </summary>
        public static int GetResponseCount(Guid surveyGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Survey_GetResponseCount", 1);

            sph.DefineSqlParameter("@SurveyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, surveyGuid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 5
0
        public static int PagesCount(Guid surveyGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Survey_CountPages", 1);

            sph.DefineSqlParameter("@SurveyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, surveyGuid);
            return((int)sph.ExecuteScalar());
        }
Esempio n. 6
0
        public static int GetCount(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "gb_Coupon_GetCount", 1);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 7
0
        /// <summary>
        /// Inserts a row in the gb_KLNewsComment table. Returns new integer id.
        /// </summary>
        /// <param name="commentParentID"> commentParentID </param>
        /// <param name="newsID"> newsID </param>
        /// <param name="userID"> userID </param>
        /// <param name="name"> name </param>
        /// <param name="title"> title </param>
        /// <param name="email"> email </param>
        /// <param name="createDate"> createDate </param>
        /// <param name="phone"> phone </param>
        /// <param name="comment"> comment </param>
        /// <param name="isPublish"> isPublish </param>
        /// <param name="iSDel"> iSDel </param>
        /// <returns>int</returns>
        public static int Create(
            int commentParentID,
            int newsID,
            int userID,
            string name,
            string title,
            string email,
            DateTime createDate,
            string phone,
            string comment,
            bool isPublish,
            bool iSDel)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "gb_KLNewsComment_Insert", 11);

            sph.DefineSqlParameter("@CommentParentID", SqlDbType.Int, ParameterDirection.Input, commentParentID);
            sph.DefineSqlParameter("@NewsID", SqlDbType.Int, ParameterDirection.Input, newsID);
            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userID);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 150, ParameterDirection.Input, name);
            sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 100, ParameterDirection.Input, title);
            sph.DefineSqlParameter("@Email", SqlDbType.NVarChar, 150, ParameterDirection.Input, email);
            sph.DefineSqlParameter("@CreateDate", SqlDbType.DateTime, ParameterDirection.Input, createDate);
            sph.DefineSqlParameter("@Phone", SqlDbType.VarChar, 12, ParameterDirection.Input, phone);
            sph.DefineSqlParameter("@Comment", SqlDbType.NVarChar, -1, ParameterDirection.Input, comment);
            sph.DefineSqlParameter("@IsPublish", SqlDbType.Bit, ParameterDirection.Input, isPublish);
            sph.DefineSqlParameter("@ISDel", SqlDbType.Bit, ParameterDirection.Input, iSDel);
            int newID = Convert.ToInt32(sph.ExecuteScalar());

            return(newID);
        }
Esempio n. 8
0
        public static int GetCountForModule(int moduleId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "i7_sflexi_items_GetCountForModule", 1);

            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
        /// <summary>
        /// Inserts a row in the mp_SystemLog table. Returns new integer id.
        /// </summary>
        /// <param name="logDate"> logDate </param>
        /// <param name="ipAddress"> ipAddress </param>
        /// <param name="culture"> culture </param>
        /// <param name="url"> url </param>
        /// <param name="shortUrl"> shortUrl </param>
        /// <param name="thread"> thread </param>
        /// <param name="logLevel"> logLevel </param>
        /// <param name="logger"> logger </param>
        /// <param name="message"> message </param>
        /// <returns>int</returns>
        public int Create(
            DateTime logDate,
            string ipAddress,
            string culture,
            string url,
            string shortUrl,
            string thread,
            string logLevel,
            string logger,
            string message)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString,
                "mp_SystemLog_Insert",
                9);

            sph.DefineSqlParameter("@LogDate", SqlDbType.DateTime, ParameterDirection.Input, logDate);
            sph.DefineSqlParameter("@IpAddress", SqlDbType.NVarChar, 50, ParameterDirection.Input, ipAddress);
            sph.DefineSqlParameter("@Culture", SqlDbType.NVarChar, 10, ParameterDirection.Input, culture);
            sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, -1, ParameterDirection.Input, url);
            sph.DefineSqlParameter("@ShortUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, shortUrl);
            sph.DefineSqlParameter("@Thread", SqlDbType.NVarChar, 255, ParameterDirection.Input, thread);
            sph.DefineSqlParameter("@LogLevel", SqlDbType.NVarChar, 20, ParameterDirection.Input, logLevel);
            sph.DefineSqlParameter("@Logger", SqlDbType.NVarChar, 255, ParameterDirection.Input, logger);
            sph.DefineSqlParameter("@Message", SqlDbType.NVarChar, -1, ParameterDirection.Input, message);
            int newID = Convert.ToInt32(sph.ExecuteScalar());

            return(newID);
        }
Esempio n. 10
0
        /// <summary>
        /// Inserts a row in the gb_KLAuthor table. Returns new integer id.
        /// </summary>
        /// <param name="userID"> userID </param>
        /// <param name="name"> name </param>
        /// <param name="avatar"> avatar </param>
        /// <param name="levelAuthor"> levelAuthor </param>
        /// <param name="linkFacebook"> linkFacebook </param>
        /// <param name="linkTwitter"> linkTwitter </param>
        /// <param name="linkPinterest"> linkPinterest </param>
        /// <param name="linkInstagram"> linkInstagram </param>
        /// <param name="joinDate"> joinDate </param>
        /// <param name="articleCount"> articleCount </param>
        /// <param name="isDel"> isDel </param>
        /// <param name="isActive"> isActive </param>
        /// <returns>int</returns>
        public static int Create(
            int userID,
            string name,
            string avatar,
            string levelAuthor,
            string linkFacebook,
            string linkTwitter,
            string linkPinterest,
            string linkInstagram,
            DateTime joinDate,
            int articleCount,
            bool isDel,
            bool isActive)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "gb_KLAuthor_Insert", 12);

            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userID);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 100, ParameterDirection.Input, name);
            sph.DefineSqlParameter("@Avatar", SqlDbType.NVarChar, 255, ParameterDirection.Input, avatar);
            sph.DefineSqlParameter("@LevelAuthor", SqlDbType.NVarChar, 100, ParameterDirection.Input, levelAuthor);
            sph.DefineSqlParameter("@LinkFacebook", SqlDbType.NVarChar, 100, ParameterDirection.Input, linkFacebook);
            sph.DefineSqlParameter("@LinkTwitter", SqlDbType.NVarChar, 100, ParameterDirection.Input, linkTwitter);
            sph.DefineSqlParameter("@LinkPinterest", SqlDbType.NVarChar, 100, ParameterDirection.Input, linkPinterest);
            sph.DefineSqlParameter("@LinkInstagram", SqlDbType.NVarChar, 100, ParameterDirection.Input, linkInstagram);
            sph.DefineSqlParameter("@JoinDate", SqlDbType.DateTime, ParameterDirection.Input, joinDate);
            sph.DefineSqlParameter("@ArticleCount", SqlDbType.Int, ParameterDirection.Input, articleCount);
            sph.DefineSqlParameter("@IsDel", SqlDbType.Bit, ParameterDirection.Input, isDel);
            sph.DefineSqlParameter("@IsActive", SqlDbType.Bit, ParameterDirection.Input, isActive);
            int newID = Convert.ToInt32(sph.ExecuteScalar());

            return(newID);
        }
Esempio n. 11
0
        /// <summary>
        /// Inserts a row in the i7_sflexi_items table. Returns new integer id.
        /// </summary>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="featureGuid"> featureGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="moduleID"> moduleID </param>
        /// <param name="definitionGuid"> definitionGuid </param>
        /// <param name="itemGuid"> itemGuid </param>
        /// <param name="sortOrder"> sortOrder </param>
        /// <param name="createdUtc"> createdUtc </param>
        /// <param name="lastModUtc"> lastModUtc </param>
        /// <returns>int</returns>
        public static int Create(
            Guid siteGuid,
            Guid featureGuid,
            Guid moduleGuid,
            int moduleID,
            Guid definitionGuid,
            Guid itemGuid,
            int sortOrder,
            DateTime createdUtc,
            DateTime lastModUtc)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "i7_sflexi_items_Insert", 9);

            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            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("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleID);
            sph.DefineSqlParameter("@DefinitionGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, definitionGuid);
            sph.DefineSqlParameter("@SortOrder", SqlDbType.Int, ParameterDirection.Input, sortOrder);
            sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
            sph.DefineSqlParameter("@LastModUtc", SqlDbType.DateTime, ParameterDirection.Input, lastModUtc);
            int newID = Convert.ToInt32(sph.ExecuteScalar());

            return(newID);
        }
Esempio n. 12
0
        /// <summary>
        /// Gets a count of rows in the ws_Product table.
        /// </summary>
        public static int GetCountForAdminList(Guid storeGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Product_GetCountForAdminList", 1);

            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 13
0
        public static int GetCountBySearch2(
            int siteId            = -1,
            string zoneIds        = null,
            int publishStatus     = -1,
            int languageId        = -1,
            int newsType          = -1,
            int position          = -1,
            int showOption        = -1,
            string newsIds        = null,
            string excludeNewsIds = null,
            DateTime?startDate    = null,
            DateTime?endDate      = null,
            string keyword        = null,
            string stateIds       = null,
            Guid?userGuid         = null)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "gb_News_GetCountBySearch2", 14);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@ZoneIDs", SqlDbType.NVarChar, ParameterDirection.Input, zoneIds);
            sph.DefineSqlParameter("@PublishStatus", SqlDbType.Int, ParameterDirection.Input, publishStatus);
            sph.DefineSqlParameter("@LanguageID", SqlDbType.Int, ParameterDirection.Input, languageId);
            sph.DefineSqlParameter("@NewsType", SqlDbType.Int, ParameterDirection.Input, newsType);
            sph.DefineSqlParameter("@Position", SqlDbType.Int, ParameterDirection.Input, position);
            sph.DefineSqlParameter("@ShowOption", SqlDbType.Int, ParameterDirection.Input, showOption);
            sph.DefineSqlParameter("@NewsIDs", SqlDbType.NVarChar, ParameterDirection.Input, newsIds);
            sph.DefineSqlParameter("@ExcludeNewsIDs", SqlDbType.NVarChar, ParameterDirection.Input, excludeNewsIds);
            sph.DefineSqlParameter("@StartDate", SqlDbType.DateTime, ParameterDirection.Input, startDate);
            sph.DefineSqlParameter("@EndDate", SqlDbType.DateTime, ParameterDirection.Input, endDate);
            sph.DefineSqlParameter("@Keyword", SqlDbType.NVarChar, 255, ParameterDirection.Input, keyword);
            sph.DefineSqlParameter("@StateIDs", SqlDbType.NVarChar, ParameterDirection.Input, stateIds);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 14
0
        public static int GetCountBySearch(
            int siteId,
            string listZoneId,
            int newsType,
            int isPublished,
            string listStateId,
            int languageId,
            int position,
            int showOption,
            DateTime?startDateFrom,
            DateTime?startDateTo,
            DateTime?endDateFrom,
            DateTime?endDateTo,
            Guid?userGuid,
            string keyword)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "gb_News_GetCountBySearch", 14);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@ListZoneID", SqlDbType.NVarChar, 255, ParameterDirection.Input, listZoneId);
            sph.DefineSqlParameter("@NewsType", SqlDbType.Int, ParameterDirection.Input, newsType);
            sph.DefineSqlParameter("@IsPublished", SqlDbType.Int, ParameterDirection.Input, isPublished);
            sph.DefineSqlParameter("@ListStateID", SqlDbType.NVarChar, 255, ParameterDirection.Input, listStateId);
            sph.DefineSqlParameter("@LanguageID", SqlDbType.Int, ParameterDirection.Input, languageId);
            sph.DefineSqlParameter("@Position", SqlDbType.Int, ParameterDirection.Input, position);
            sph.DefineSqlParameter("@ShowOption", SqlDbType.Int, ParameterDirection.Input, showOption);
            sph.DefineSqlParameter("@StartDateFrom", SqlDbType.DateTime, ParameterDirection.Input, startDateFrom);
            sph.DefineSqlParameter("@StartDateTo", SqlDbType.DateTime, ParameterDirection.Input, startDateTo);
            sph.DefineSqlParameter("@EndDateFrom", SqlDbType.DateTime, ParameterDirection.Input, endDateFrom);
            sph.DefineSqlParameter("@EndDateTo", SqlDbType.DateTime, ParameterDirection.Input, endDateTo);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@Keyword", SqlDbType.NVarChar, 255, ParameterDirection.Input, keyword);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 15
0
        public static int GetCountBySearch(
            int siteID,
            int stateID,
            int orderStatus,
            int paymentMethod,
            int shippingMethod,
            DateTime?fromDate,
            DateTime?toDate,
            decimal?fromOrderTotal,
            decimal?toOrderTotal,
            Guid?userGuid,
            string keyword)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "gb_OrderItem_GetCountBySearch", 11);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteID);
            sph.DefineSqlParameter("@StateID", SqlDbType.Int, ParameterDirection.Input, stateID);
            sph.DefineSqlParameter("@OrderStatus", SqlDbType.Int, ParameterDirection.Input, orderStatus);
            sph.DefineSqlParameter("@PaymentMethod", SqlDbType.Int, ParameterDirection.Input, paymentMethod);
            sph.DefineSqlParameter("@ShippingMethod", SqlDbType.Int, ParameterDirection.Input, shippingMethod);
            sph.DefineSqlParameter("@FromDate", SqlDbType.DateTime, ParameterDirection.Input, fromDate);
            sph.DefineSqlParameter("@ToDate", SqlDbType.DateTime, ParameterDirection.Input, toDate);
            sph.DefineSqlParameter("@FromOrderTotal", SqlDbType.Decimal, ParameterDirection.Input, fromOrderTotal);
            sph.DefineSqlParameter("@ToOrderTotal", SqlDbType.Decimal, ParameterDirection.Input, toOrderTotal);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@Keyword", SqlDbType.NVarChar, 50, ParameterDirection.Input, keyword);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 16
0
        public static int GetCountByCoupon(int couponId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "gb_CouponUsageHistory_GetCountByCoupon", 1);

            sph.DefineSqlParameter("@CouponID", SqlDbType.Int, ParameterDirection.Input, couponId);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 17
0
        /// <summary>
        /// Inserts a row in the mp_SystemLog table. Returns new integer id.
        /// </summary>
        /// <param name="logDate"> logDate </param>
        /// <param name="ipAddress"> ipAddress </param>
        /// <param name="culture"> culture </param>
        /// <param name="url"> url </param>
        /// <param name="shortUrl"> shortUrl </param>
        /// <param name="thread"> thread </param>
        /// <param name="logLevel"> logLevel </param>
        /// <param name="logger"> logger </param>
        /// <param name="message"> message </param>
        /// <returns>int</returns>
        public int Create(
            DateTime logDate,
            string ipAddress,
            string culture,
            string url,
            string shortUrl,
            string thread,
            string logLevel,
            string logger,
            string message)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_SystemLog_Insert", 
                9);

            sph.DefineSqlParameter("@LogDate", SqlDbType.DateTime, ParameterDirection.Input, logDate);
            sph.DefineSqlParameter("@IpAddress", SqlDbType.NVarChar, 50, ParameterDirection.Input, ipAddress);
            sph.DefineSqlParameter("@Culture", SqlDbType.NVarChar, 10, ParameterDirection.Input, culture);
            sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, -1, ParameterDirection.Input, url);
            sph.DefineSqlParameter("@ShortUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, shortUrl);
            sph.DefineSqlParameter("@Thread", SqlDbType.NVarChar, 255, ParameterDirection.Input, thread);
            sph.DefineSqlParameter("@LogLevel", SqlDbType.NVarChar, 20, ParameterDirection.Input, logLevel);
            sph.DefineSqlParameter("@Logger", SqlDbType.NVarChar, 255, ParameterDirection.Input, logger);
            sph.DefineSqlParameter("@Message", SqlDbType.NVarChar, -1, ParameterDirection.Input, message);
            int newID = Convert.ToInt32(sph.ExecuteScalar());
            return newID;
        }
Esempio n. 18
0
        /// <summary>
        /// Gets a count of rows for a particular Track in the mp_MediaFile table.
        /// </summary>
        /// <param name="trackID">The ID of the Track.</param>
        /// <returns>The count of rows.</returns>
        public static int GetCountByTrack(int trackId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_MediaFile_GetCountByTrack", 1);

            sph.DefineSqlParameter("@TrackID", SqlDbType.Int, ParameterDirection.Input, trackId);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 19
0
        /// <summary>
        /// Gets a count of rows in the ws_Discount table.
        /// </summary>
        public static int GetCountOfActiveDiscountCodes(Guid moduleGuid, DateTime activeForDate)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Discount_GetCountOfActive", 2);

            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@CurrentDate", SqlDbType.DateTime, ParameterDirection.Input, activeForDate);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 20
0
        public static int GetItemCountByFulfillmentType(Guid cartGuid, byte fulFillmentType)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_Cart_GetItemCountByFulfillmentType", 2);

            sph.DefineSqlParameter("@CartGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, cartGuid);
            sph.DefineSqlParameter("@FulFillmentType", SqlDbType.TinyInt, ParameterDirection.Input, fulFillmentType);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 21
0
        public static int GetHighestSortOrder(int moduleId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "i7_sflexi_items_GetHighestSortOrder", 1);

            sph.DefineSqlParameter("@ModuleId", SqlDbType.Int, ParameterDirection.Input, moduleId);
            //return sph.ExecuteReader();
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 22
0
        public static int GetCountByNewsID(int newid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "gb_KLNewsComment_GetCountByNewID", 1);

            sph.DefineSqlParameter("@NewsID", SqlDbType.Int, ParameterDirection.Input, newid);

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 23
0
        /// <summary>
        /// Gets a count of rows in the ws_Offer table.
        /// </summary>
        public static int GetCountByOffer(Guid offerGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_OfferProduct_CountByOffer", 1);

            sph.DefineSqlParameter("@OfferGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, offerGuid);

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 24
0
        public static bool IsAvailable(int siteId, string zoneIds, string productIds)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "gb_Coupon_IsAvailable", 3);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@ZoneIDs", SqlDbType.NVarChar, ParameterDirection.Input, zoneIds);
            sph.DefineSqlParameter("@ProductIDs", SqlDbType.NVarChar, ParameterDirection.Input, productIds);
            return(Convert.ToInt32(sph.ExecuteScalar()) == 1);
        }
Esempio n. 25
0
        /// <summary>
        /// gets the max sort rank or 1 if null
        /// </summary>
        /// <param name="customFieldId"></param>
        /// <returns>int</returns>
        public static int GetMaxSortOrder(int customFieldId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "gb_CustomFieldOption_GetMaxSortOrder", 1);

            sph.DefineSqlParameter("@CustomFieldID", SqlDbType.Int, ParameterDirection.Input, customFieldId);
            int pageOrder = Convert.ToInt32(sph.ExecuteScalar());

            return(pageOrder);
        }
Esempio n. 26
0
        public static bool UserHasVoted(Guid pollGuid, Guid userGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Polls_UserHasVoted", 2);

            sph.DefineSqlParameter("@PollGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pollGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            int userHasVoted = Convert.ToInt32(sph.ExecuteScalar());

            return(userHasVoted == 1);
        }
Esempio n. 27
0
        public static int GetCountByRole(int siteId, int roleId, DateTime?fromDate, DateTime?toDate, string keyword = null)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "gb_Users_CountByRole", 5);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@RoleID", SqlDbType.Int, ParameterDirection.Input, roleId);
            sph.DefineSqlParameter("@FromDate", SqlDbType.DateTime, ParameterDirection.Input, fromDate);
            sph.DefineSqlParameter("@ToDate", SqlDbType.DateTime, ParameterDirection.Input, toDate);
            sph.DefineSqlParameter("@Keyword", SqlDbType.NVarChar, 255, ParameterDirection.Input, keyword);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 28
0
        private static int GetCountProductOther(int zoneId, int productId, DateTime currentTime, int languageId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "gb_Product_GetCountProductOther", 4);

            sph.DefineSqlParameter("@ZoneID", SqlDbType.Int, ParameterDirection.Input, zoneId);
            sph.DefineSqlParameter("@ProductID", SqlDbType.Int, ParameterDirection.Input, productId);
            sph.DefineSqlParameter("@CurrentTime", SqlDbType.DateTime, ParameterDirection.Input, currentTime);
            sph.DefineSqlParameter("@LanguageID", SqlDbType.Int, ParameterDirection.Input, languageId);

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 29
0
        public static int GetCount(Guid siteGuid, Guid?featureGuid, string keyword, int languageID)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "gb_Tag_GetCount", 4);

            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@FeatureGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, featureGuid);
            sph.DefineSqlParameter("@Keyword", SqlDbType.NVarChar, 255, ParameterDirection.Input, keyword);
            sph.DefineSqlParameter("@LanguageID", SqlDbType.Int, ParameterDirection.Input, languageID);

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 30
0
        ///// <summary>
        ///// Returns true if the given userguid/ip is found
        ///// </summary>
        ///// <param name="userGuid"> userGuid </param>
        //public static bool Exists(Guid userGuid, long ipAsLong)
        //{
        //    SqlParameterHelper sph = new SqlParameterHelper(GetConnectionString(), "mp_UserLocation_Exists", 1);
        //    sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
        //    return Convert.ToInt32(sph.ExecuteScalar()) > 0;

        //}

        /// <summary>
        /// Gets a count of rows in the mp_UserLocation table for the passed in userGuid.
        /// </summary>
        /// <param name="siteGuid"> siteGuid </param>
        public int GetCountBySite(Guid siteGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString,
                "mp_UserLocation_GetCountBySite",
                1);

            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 31
0
        /// <summary>
        /// Gets an IDataReader with one row from the mp_RedirectList table.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        public int GetCount(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString,
                "mp_RedirectList_GetCount",
                1);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Esempio n. 32
0
        /// <summary>
        /// Inserts a row in the mp_BannedIPAddresses table. Returns new integer id.
        /// </summary>
        /// <param name="bannedIP"> bannedIP </param>
        /// <param name="bannedUTC"> bannedUTC </param>
        /// <param name="bannedReason"> bannedReason </param>
        /// <returns>int</returns>
        public int Add(
            string bannedIP,
            DateTime bannedUtc,
            string bannedReason)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_BannedIPAddresses_Insert", 
                3);

            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 newID = Convert.ToInt32(sph.ExecuteScalar());
            return newID;
        }
Esempio n. 33
0
        public int CountOnlineSince(int siteId, DateTime sinceTime)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString, 
                "mp_Users_CountOnlineSinceTime", 
                2);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@SinceTime", SqlDbType.DateTime, ParameterDirection.Input, sinceTime);
            int count = Convert.ToInt32(sph.ExecuteScalar());
            return count;
        }
Esempio n. 34
0
        public bool PropertyExists(Guid userGuid, string propertyName)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString, 
                "mp_UserProperties_PropertyExists", 
                2);

            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@PropertyName", SqlDbType.NVarChar, 255, ParameterDirection.Input, propertyName);
            int count = Convert.ToInt32(sph.ExecuteScalar());
            return (count > 0);
        }
Esempio n. 35
0
        public int CountUsersByRegistrationDateRange(
            int siteId,
            DateTime beginDate,
            DateTime endDate)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString, 
                "mp_Users_CountByRegistrationDateRange", 
                3);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@BeginDate", SqlDbType.DateTime, ParameterDirection.Input, beginDate);
            sph.DefineSqlParameter("@EndDate", SqlDbType.DateTime, ParameterDirection.Input, endDate);
            int count = Convert.ToInt32(sph.ExecuteScalar());
            return count;
        }
Esempio n. 36
0
        public int GetSiteIdByFolderNonAsync(string folderName)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString, 
                "mp_SiteFolders_SelectSiteIdByFolder", 
                1);

            sph.DefineSqlParameter("@FolderName", SqlDbType.NVarChar, 255, ParameterDirection.Input, folderName);
            object result = sph.ExecuteScalar();
            return Convert.ToInt32(result);

        }
Esempio n. 37
0
        /// <summary>
        /// Returns true if the passed in address is banned
        /// </summary>
        /// <param name="rowID"> rowID </param>
        /// <returns>bool</returns>
        public bool IsBanned(string ipAddress)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString, 
                "mp_BannedIPAddresses_Exists", 
                1);

            sph.DefineSqlParameter("@BannedIP", SqlDbType.NVarChar, 50, ParameterDirection.Input, ipAddress);
            int foundRows = Convert.ToInt32(sph.ExecuteScalar());
            return (foundRows > 0);

        }
Esempio n. 38
0
        ///// <summary>
        ///// Returns true if the given userguid/ip is found
        ///// </summary>
        ///// <param name="userGuid"> userGuid </param>
        //public static bool Exists(Guid userGuid, long ipAsLong)
        //{
        //    SqlParameterHelper sph = new SqlParameterHelper(GetConnectionString(), "mp_UserLocation_Exists", 1);
        //    sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
        //    return Convert.ToInt32(sph.ExecuteScalar()) > 0;

        //}

        /// <summary>
        /// Gets a count of rows in the mp_UserLocation table for the passed in userGuid.
        /// </summary>
        /// <param name="siteGuid"> siteGuid </param>
        public int GetCountBySite(Guid siteGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString, 
                "mp_UserLocation_GetCountBySite", 
                1);

            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            return Convert.ToInt32(sph.ExecuteScalar());


        }
Esempio n. 39
0
        public int GetCountOfSiteRoles(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString, 
                "mp_Roles_CountBySite", 
                1);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);

            return Convert.ToInt32(sph.ExecuteScalar());
        }
Esempio n. 40
0
        public int GetCountUnfinishedByType(string taskType)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString, 
                "mp_TaskQueue_CountIncompleteByType", 
                1);

            sph.DefineSqlParameter("@TaskType", SqlDbType.NVarChar, 255, ParameterDirection.Input, taskType);

            return Convert.ToInt32(sph.ExecuteScalar());


        }
Esempio n. 41
0
        //public static DataTable GetUserListPageTable(int siteId, int pageNumber, int pageSize, string userNameBeginsWith)
        //{
        //    SqlParameterHelper sph = new SqlParameterHelper(GetConnectionString(), "mp_Users_SelectPage", 4);
        //    sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber);
        //    sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize);
        //    sph.DefineSqlParameter("@UserNameBeginsWith", SqlDbType.NVarChar, 1, ParameterDirection.Input, userNameBeginsWith);
        //    sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);

        //    DataTable dataTable = new DataTable();
        //    dataTable.Columns.Add("UserID", typeof(int));
        //    dataTable.Columns.Add("Name", typeof(String));
        //    dataTable.Columns.Add("DateCreated", typeof(DateTime));
        //    dataTable.Columns.Add("WebSiteUrl", typeof(String));
        //    dataTable.Columns.Add("TotalPosts", typeof(int));

        //    using (IDataReader reader = sph.ExecuteReader())
        //    {
        //        while (reader.Read())
        //        {
        //            DataRow row = dataTable.NewRow();
        //            row["UserID"] = Convert.ToInt32(reader["UserID"]);
        //            row["Name"] = reader["Name"].ToString();
        //            row["DateCreated"] = Convert.ToDateTime(reader["DateCreated"]);
        //            row["WebSiteUrl"] = reader["WebSiteUrl"].ToString();
        //            row["TotalPosts"] = Convert.ToInt32(reader["TotalPosts"]);
        //            dataTable.Rows.Add(row);

        //        }

        //    }

        //    return dataTable;

        //}

        public int AddUser(
            Guid siteGuid,
            int siteId,
            string fullName,
            String loginName,
            string email,
            string password,
            string passwordSalt,
            Guid userGuid,
            DateTime dateCreated,
            bool mustChangePwd,
            string firstName,
            string lastName,
            string timeZoneId,
            DateTime dateOfBirth,
            bool emailConfirmed,
            int pwdFormat,
            string passwordHash,
            string securityStamp,
            string phoneNumber,
            bool phoneNumberConfirmed,
            bool twoFactorEnabled,
            DateTime? lockoutEndDateUtc
            )
        {

            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_Users_Insert", 
                23);

            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 100, ParameterDirection.Input, fullName);
            sph.DefineSqlParameter("@LoginName", SqlDbType.NVarChar, 50, ParameterDirection.Input, loginName);
            sph.DefineSqlParameter("@Email", SqlDbType.NVarChar, 100, ParameterDirection.Input, email);
            sph.DefineSqlParameter("@Password", SqlDbType.NVarChar, 1000, ParameterDirection.Input, password);
            sph.DefineSqlParameter("@PasswordSalt", SqlDbType.NVarChar, 128, ParameterDirection.Input, passwordSalt);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@DateCreated", SqlDbType.DateTime, ParameterDirection.Input, dateCreated);
            sph.DefineSqlParameter("@MustChangePwd", SqlDbType.Bit, ParameterDirection.Input, mustChangePwd);

            sph.DefineSqlParameter("@FirstName", SqlDbType.NVarChar, 100, ParameterDirection.Input, firstName);
            sph.DefineSqlParameter("@LastName", SqlDbType.NVarChar, 100, ParameterDirection.Input, lastName);
            sph.DefineSqlParameter("@TimeZoneId", SqlDbType.NVarChar, 32, ParameterDirection.Input, timeZoneId);
            sph.DefineSqlParameter("@EmailChangeGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, Guid.Empty);

            if (dateOfBirth == DateTime.MinValue)
            {
                sph.DefineSqlParameter("@DateOfBirth", SqlDbType.DateTime, ParameterDirection.Input, DBNull.Value);
            }
            else
            {
                sph.DefineSqlParameter("@DateOfBirth", SqlDbType.DateTime, ParameterDirection.Input, dateOfBirth);
            }

            sph.DefineSqlParameter("@EmailConfirmed", SqlDbType.Bit, ParameterDirection.Input, emailConfirmed);
            sph.DefineSqlParameter("@PwdFormat", SqlDbType.Int, ParameterDirection.Input, pwdFormat);
            sph.DefineSqlParameter("@PasswordHash", SqlDbType.NVarChar, -1, ParameterDirection.Input, passwordHash);
            sph.DefineSqlParameter("@SecurityStamp", SqlDbType.NVarChar, -1, ParameterDirection.Input, securityStamp);
            sph.DefineSqlParameter("@PhoneNumber", SqlDbType.NVarChar, 50, ParameterDirection.Input, phoneNumber);
            sph.DefineSqlParameter("@PhoneNumberConfirmed", SqlDbType.Bit, ParameterDirection.Input, phoneNumberConfirmed);
            sph.DefineSqlParameter("@TwoFactorEnabled", SqlDbType.Bit, ParameterDirection.Input, twoFactorEnabled);
            if (lockoutEndDateUtc == null)
            {
                sph.DefineSqlParameter("@LockoutEndDateUtc", SqlDbType.DateTime, ParameterDirection.Input, DBNull.Value);
            }
            else
            {
                sph.DefineSqlParameter("@LockoutEndDateUtc", SqlDbType.DateTime, ParameterDirection.Input, lockoutEndDateUtc);
            }


            int newID = Convert.ToInt32(sph.ExecuteScalar());
            return newID;
        }
Esempio n. 42
0
        public int ExistingSiteCount()
        {
            int count = 0;
            try
            {
                SqlParameterHelper sph = new SqlParameterHelper(
                    logFactory,
                    readConnectionString, 
                    "mp_Sites_CountOtherSites", 
                    1);

                sph.DefineSqlParameter("@CurrentSiteID", SqlDbType.Int, ParameterDirection.Input, -1);
                count = Convert.ToInt32(sph.ExecuteScalar());
            }
            catch (DbException) { }
            catch (InvalidOperationException) { }

            return count;

        }
Esempio n. 43
0
        public int UserCount(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString, 
                "mp_Users_Count", 
                1);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            int count = Convert.ToInt32(sph.ExecuteScalar());
            return count;
        }
Esempio n. 44
0
        /// <summary>
        /// returns true if the record exists
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        public bool Exists(int siteId, string oldUrl)
        {
            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                readConnectionString, 
                "mp_RedirectList_Exists", 
                2);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@OldUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, oldUrl);
            int count = Convert.ToInt32(sph.ExecuteScalar());
            return (count > 0);

        }
Esempio n. 45
0
        //public IDataReader SchemaVersionGetNonCore()
        //{
        //    SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SchemaVersion_SelectNonCore", 0);
        //    return sph.ExecuteReader();
        //}

        public int AddSchemaScriptHistory(
            Guid applicationId,
            string scriptFile,
            DateTime runTime,
            bool errorOccurred,
            string errorMessage,
            string scriptBody)
        {

            SqlParameterHelper sph = new SqlParameterHelper(
                logFactory,
                writeConnectionString, 
                "mp_SchemaScriptHistory_Insert", 
                6);
            sph.DefineSqlParameter("@ApplicationID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, applicationId);
            sph.DefineSqlParameter("@ScriptFile", SqlDbType.NVarChar, 255, ParameterDirection.Input, scriptFile);
            sph.DefineSqlParameter("@RunTime", SqlDbType.DateTime, ParameterDirection.Input, runTime);
            sph.DefineSqlParameter("@ErrorOccurred", SqlDbType.Bit, ParameterDirection.Input, errorOccurred);
            sph.DefineSqlParameter("@ErrorMessage", SqlDbType.NVarChar, -1, ParameterDirection.Input, errorMessage);
            sph.DefineSqlParameter("@ScriptBody", SqlDbType.NVarChar, -1, ParameterDirection.Input, scriptBody);
            int newID = Convert.ToInt32(sph.ExecuteScalar());
            return newID;
        }