Example #1
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 static int Create(
            DateTime logDate,
            string ipAddress,
            string culture,
            string url,
            string shortUrl,
            string thread,
            string logLevel,
            string logger,
            string message)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "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);
        }
Example #2
0
        /// <summary>
        /// Gets a count of rows in the mp_ContentTemplate table.
        /// </summary>
        public static int GetCount(Guid siteGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ContentTemplate_GetCount", 1);

            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #3
0
        public static bool AddHistory(
            Guid itemGuid,
            Guid moduleGuid,
            Guid userGuid,
            int itemId,
            int moduleId,
            string friendlyName,
            string originalFileName,
            string serverFileName,
            int sizeInKB,
            DateTime uploadDate,
            int uploadUserId,
            DateTime archiveDate)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SharedFilesHistory_Insert", 12);

            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@ItemID", SqlDbType.Int, ParameterDirection.Input, itemId);
            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@FriendlyName", SqlDbType.NVarChar, 255, ParameterDirection.Input, friendlyName);
            sph.DefineSqlParameter("@OriginalFileName", SqlDbType.NVarChar, 255, ParameterDirection.Input, originalFileName);
            sph.DefineSqlParameter("@ServerFileName", SqlDbType.NVarChar, 50, ParameterDirection.Input, serverFileName);
            sph.DefineSqlParameter("@SizeInKB", SqlDbType.Int, ParameterDirection.Input, sizeInKB);
            sph.DefineSqlParameter("@UploadDate", SqlDbType.DateTime, ParameterDirection.Input, uploadDate);
            sph.DefineSqlParameter("@UploadUserID", SqlDbType.Int, ParameterDirection.Input, uploadUserId);
            sph.DefineSqlParameter("@ArchiveDate", SqlDbType.DateTime, ParameterDirection.Input, archiveDate);
            int newID = Convert.ToInt32(sph.ExecuteScalar());

            return(newID > 0);
        }
Example #4
0
        /// <summary>
        /// Gets a count of rows in the mp_GeoZone table.
        /// </summary>
        public static int GetCount(Guid countryGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_GeoZone_GetCountByCountry", 1);

            sph.DefineSqlParameter("@CountryGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, countryGuid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #5
0
        public static int AddGalleryImage(
            Guid itemGuid,
            Guid moduleGuid,
            int moduleId,
            int displayOrder,
            string caption,
            string description,
            string metaDataXml,
            string imageFile,
            string webImageFile,
            string thumbnailFile,
            DateTime uploadDate,
            string uploadUser,
            Guid userGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_GalleryImages_Insert", 13);

            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@DisplayOrder", SqlDbType.Int, ParameterDirection.Input, displayOrder);
            sph.DefineSqlParameter("@Caption", SqlDbType.NVarChar, 255, ParameterDirection.Input, caption);
            sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
            sph.DefineSqlParameter("@MetaDataXml", SqlDbType.NVarChar, -1, ParameterDirection.Input, metaDataXml);
            sph.DefineSqlParameter("@ImageFile", SqlDbType.NVarChar, 100, ParameterDirection.Input, imageFile);
            sph.DefineSqlParameter("@WebImageFile", SqlDbType.NVarChar, 100, ParameterDirection.Input, webImageFile);
            sph.DefineSqlParameter("@ThumbnailFile", SqlDbType.NVarChar, 100, ParameterDirection.Input, thumbnailFile);
            sph.DefineSqlParameter("@UploadDate", SqlDbType.DateTime, ParameterDirection.Input, uploadDate);
            sph.DefineSqlParameter("@UploadUser", SqlDbType.NVarChar, 100, ParameterDirection.Input, uploadUser);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            int newID = Convert.ToInt32(sph.ExecuteScalar());

            return(newID);
        }
Example #6
0
        public static int AddLink(
            Guid itemGuid,
            Guid moduleGuid,
            int moduleId,
            string title,
            string url,
            int viewOrder,
            string description,
            DateTime createdDate,
            int createdBy,
            string target,
            Guid userGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Links_Insert", 11);

            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title);
            sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, -1, ParameterDirection.Input, url);
            sph.DefineSqlParameter("@ViewOrder", SqlDbType.Int, ParameterDirection.Input, viewOrder);
            sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
            sph.DefineSqlParameter("@CreatedDate", SqlDbType.DateTime, ParameterDirection.Input, createdDate);
            sph.DefineSqlParameter("@CreatedBy", SqlDbType.Int, ParameterDirection.Input, createdBy);
            sph.DefineSqlParameter("@Target", SqlDbType.NVarChar, 20, ParameterDirection.Input, target);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            int newID = Convert.ToInt32(sph.ExecuteScalar());

            return(newID);
        }
Example #7
0
 public static bool AddHistory(
     Guid itemGuid,
     Guid moduleGuid,
     Guid userGuid,
     int itemId,
     int moduleId,
     string friendlyName,
     string originalFileName,
     string serverFileName,
     int sizeInKB,
     DateTime uploadDate,
     int uploadUserId,
     DateTime archiveDate)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SharedFilesHistory_Insert", 12);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     sph.DefineSqlParameter("@ItemID", SqlDbType.Int, ParameterDirection.Input, itemId);
     sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
     sph.DefineSqlParameter("@FriendlyName", SqlDbType.NVarChar, 255, ParameterDirection.Input, friendlyName);
     sph.DefineSqlParameter("@OriginalFileName", SqlDbType.NVarChar, 255, ParameterDirection.Input, originalFileName);
     sph.DefineSqlParameter("@ServerFileName", SqlDbType.NVarChar, 50, ParameterDirection.Input, serverFileName);
     sph.DefineSqlParameter("@SizeInKB", SqlDbType.Int, ParameterDirection.Input, sizeInKB);
     sph.DefineSqlParameter("@UploadDate", SqlDbType.DateTime, ParameterDirection.Input, uploadDate);
     sph.DefineSqlParameter("@UploadUserID", SqlDbType.Int, ParameterDirection.Input, uploadUserId);
     sph.DefineSqlParameter("@ArchiveDate", SqlDbType.DateTime, ParameterDirection.Input, archiveDate);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return (newID > 0);
 }
Example #8
0
        /// <summary>
        /// Gets a count of rows in the mp_Letter table.
        /// </summary>
        public static int GetCountOfDrafts(Guid letterInfoGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Letter_GetCountDrafts", 1);

            sph.DefineSqlParameter("@LetterInfoGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterInfoGuid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #9
0
        /// <summary>
        /// Gets a count of rows in the mp_UserLocation table for the passed in userGuid.
        /// </summary>
        /// <param name="userGuid"> userGuid </param>
        public static int GetCountByUser(Guid userGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_UserLocation_GetCountByUser", 1);

            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #10
0
        public static int GetMaxSortRank(Guid contentGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ContentMetaLink_GetMaxSortOrder", 1);

            sph.DefineSqlParameter("@ContentGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, contentGuid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #11
0
        public static int AddSharedFile(
            Guid itemGuid,
            Guid moduleGuid,
            Guid userGuid,
            Guid folderGuid,
            int moduleId,
            int uploadUserId,
            string friendlyName,
            string originalFileName,
            string serverFileName,
            int sizeInKB,
            DateTime uploadDate,
            int folderId,
            string description)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SharedFiles_Insert", 13);

            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@FolderGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, folderGuid);
            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@UploadUserID", SqlDbType.Int, ParameterDirection.Input, uploadUserId);
            sph.DefineSqlParameter("@FriendlyName", SqlDbType.NVarChar, 255, ParameterDirection.Input, friendlyName);
            sph.DefineSqlParameter("@OriginalFileName", SqlDbType.NVarChar, 255, ParameterDirection.Input, originalFileName);
            sph.DefineSqlParameter("@ServerFileName", SqlDbType.NVarChar, 255, ParameterDirection.Input, serverFileName);
            sph.DefineSqlParameter("@SizeInKB", SqlDbType.Int, ParameterDirection.Input, sizeInKB);
            sph.DefineSqlParameter("@UploadDate", SqlDbType.DateTime, ParameterDirection.Input, uploadDate);
            sph.DefineSqlParameter("@FolderID", SqlDbType.Int, ParameterDirection.Input, folderId);
            sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
            int newID = Convert.ToInt32(sph.ExecuteScalar());

            return(newID);
        }
Example #12
0
        public static int AddRssFeed(
            Guid itemGuid,
            Guid moduleGuid,
            Guid userGuid,
            int moduleId,
            int userId,
            string author,
            string url,
            string rssUrl,
            DateTime createdUtc,
            string imageUrl,
            string feedType,
            bool publishByDefault,
            int sortRank)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_RssFeeds_Insert", 13);

            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
            sph.DefineSqlParameter("@Author", SqlDbType.NVarChar, 100, ParameterDirection.Input, author);
            sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, -1, ParameterDirection.Input, url);
            sph.DefineSqlParameter("@RssUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, rssUrl);
            sph.DefineSqlParameter("@CreatedDate", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
            sph.DefineSqlParameter("@ImageUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, imageUrl);
            sph.DefineSqlParameter("@FeedType", SqlDbType.NVarChar, 20, ParameterDirection.Input, feedType);
            sph.DefineSqlParameter("@PublishByDefault", SqlDbType.Bit, ParameterDirection.Input, publishByDefault);
            sph.DefineSqlParameter("@SortRank", SqlDbType.Int, ParameterDirection.Input, sortRank);

            int newID = Convert.ToInt32(sph.ExecuteScalar());
            return newID;
        }
Example #13
0
 public static int Count(int siteId)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_WebParts_GetCount", 1);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     int count = Convert.ToInt32(sph.ExecuteScalar());
     return count;
 }
Example #14
0
 public static int AddLink(
     Guid itemGuid,
     Guid moduleGuid,
     int moduleId,
     string title,
     string url,
     int viewOrder,
     string description,
     DateTime createdDate,
     int createdBy,
     string target,
     Guid userGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Links_Insert", 11);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
     sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title);
     sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, -1, ParameterDirection.Input, url);
     sph.DefineSqlParameter("@ViewOrder", SqlDbType.Int, ParameterDirection.Input, viewOrder);
     sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
     sph.DefineSqlParameter("@CreatedDate", SqlDbType.DateTime, ParameterDirection.Input, createdDate);
     sph.DefineSqlParameter("@CreatedBy", SqlDbType.Int, ParameterDirection.Input, createdBy);
     sph.DefineSqlParameter("@Target", SqlDbType.NVarChar, 20, ParameterDirection.Input, target);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return newID;
 }
Example #15
0
 public static int AddHtmlContent(
     Guid itemGuid,
     Guid moduleGuid,
     int moduleId,
     string title,
     string excerpt,
     string body,
     string moreLink,
     int sortOrder,
     DateTime beginDate,
     DateTime endDate,
     DateTime createdDate,
     int userId,
     Guid userGuid,
     bool excludeFromRecentContent)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_HtmlContent_Insert", 14);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
     sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title);
     sph.DefineSqlParameter("@Excerpt", SqlDbType.NVarChar, -1, ParameterDirection.Input, excerpt);
     sph.DefineSqlParameter("@Body", SqlDbType.NVarChar, -1, ParameterDirection.Input, body);
     sph.DefineSqlParameter("@MoreLink", SqlDbType.NVarChar, 255, ParameterDirection.Input, moreLink);
     sph.DefineSqlParameter("@SortOrder", SqlDbType.Int, ParameterDirection.Input, sortOrder);
     sph.DefineSqlParameter("@BeginDate", SqlDbType.DateTime, ParameterDirection.Input, beginDate);
     sph.DefineSqlParameter("@EndDate", SqlDbType.DateTime, ParameterDirection.Input, endDate);
     sph.DefineSqlParameter("@CreatedDate", SqlDbType.DateTime, ParameterDirection.Input, createdDate);
     sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     sph.DefineSqlParameter("@ExcludeFromRecentContent", SqlDbType.Bit, ParameterDirection.Input, excludeFromRecentContent);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return newID;
 }
Example #16
0
        public static int CountOtherSites(int currentSiteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Sites_CountOtherSites", 1);
            sph.DefineSqlParameter("@CurrentSiteID", SqlDbType.Int, ParameterDirection.Input, currentSiteId);

            return Convert.ToInt32(sph.ExecuteScalar());
        }
Example #17
0
 public static int GetNextPageOrder(Guid userGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_UserPages_GetNextPageOrder", 1);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     int pageOrder = Convert.ToInt32(sph.ExecuteScalar());
     return pageOrder;
 }
Example #18
0
        /// <summary>
        /// Gets a count of rows in the mp_Category table.
        /// </summary>
        public static int GetCountByModule(Guid moduleGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Category_GetCountByModule", 1);

            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #19
0
        public static int GetWorkInProgressCountByPage(Guid pageGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ContentWorkflow_GetInProgressCountByPage", 1);

            sph.DefineSqlParameter("@PageGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pageGuid);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #20
0
 public static bool Exists(string folderName)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SiteFolder_Exists", 1);
     sph.DefineSqlParameter("@FolderName", SqlDbType.NVarChar, 255, ParameterDirection.Input, folderName);
     int count = Convert.ToInt32(sph.ExecuteScalar());
     return (count > 0);
 }
Example #21
0
        public static int GetCountOfSiteRoles(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Roles_CountBySite", 1);
            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);

            return Convert.ToInt32(sph.ExecuteScalar());
        }
Example #22
0
 public static int AddGalleryImage(
     Guid itemGuid,
     Guid moduleGuid,
     int moduleId,
     int displayOrder,
     string caption,
     string description,
     string metaDataXml,
     string imageFile,
     string webImageFile,
     string thumbnailFile,
     DateTime uploadDate,
     string uploadUser,
     Guid userGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_GalleryImages_Insert", 13);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
     sph.DefineSqlParameter("@DisplayOrder", SqlDbType.Int, ParameterDirection.Input, displayOrder);
     sph.DefineSqlParameter("@Caption", SqlDbType.NVarChar, 255, ParameterDirection.Input, caption);
     sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
     sph.DefineSqlParameter("@MetaDataXml", SqlDbType.NVarChar, -1, ParameterDirection.Input, metaDataXml);
     sph.DefineSqlParameter("@ImageFile", SqlDbType.NVarChar, 100, ParameterDirection.Input, imageFile);
     sph.DefineSqlParameter("@WebImageFile", SqlDbType.NVarChar, 100, ParameterDirection.Input, webImageFile);
     sph.DefineSqlParameter("@ThumbnailFile", SqlDbType.NVarChar, 100, ParameterDirection.Input, thumbnailFile);
     sph.DefineSqlParameter("@UploadDate", SqlDbType.DateTime, ParameterDirection.Input, uploadDate);
     sph.DefineSqlParameter("@UploadUser", SqlDbType.NVarChar, 100, ParameterDirection.Input, uploadUser);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return newID;
 }
Example #23
0
        /// <summary>
        /// Gets a count of rows in the mp_Links table.
        /// </summary>
        public static int GetCount(int moduleId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Links_GetCount", 1);

            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #24
0
        /// <summary>
        /// Gets a count of rows in the mp_FriendlyUrls table.
        /// </summary>
        public static int GetCount(int siteId, string searchTerm)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_FriendlyUrls_GetSearchCount", 2);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@SearchTerm", SqlDbType.NVarChar, 255, ParameterDirection.Input, searchTerm);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #25
0
        /// <summary>
        /// Gets a count of rows in the mp_CommerceReport table.
        /// </summary>
        public static int GetDistinctUserItemCount(Guid siteGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_CommerceReport_GetUserItemCountBySite", 1);

            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #26
0
        public static int GetSiteIdByFolder(string folderName)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SiteFolders_SelectSiteIdByFolder", 1);

            sph.DefineSqlParameter("@FolderName", SqlDbType.NVarChar, 255, ParameterDirection.Input, folderName);

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
        /// <summary>
        /// Gets a count of rows in the ws_GoogleCheckoutLog table.
        /// </summary>
        public static int GetCountByStore(Guid storeGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_GoogleCheckoutLog_GetCount", 1);

            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #28
0
 /// <summary>
 /// returns true if the record exists
 /// </summary>
 /// <param name="rowGuid"> rowGuid </param>
 public static bool Exists(int siteId, string oldUrl)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "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);
 }
Example #29
0
        /// <summary>
        /// Gets a count of rows in the mp_ContentStyle table.
        /// </summary>
        public static int GetCount(Guid siteGuid, string skinName)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ContentStyle_GetCountBySkin", 2);

            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@SkinName", SqlDbType.NVarChar, 100, ParameterDirection.Input, skinName);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #30
0
 public static bool Exists(int siteId, string roleName)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Roles_RoleExists", 2);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     sph.DefineSqlParameter("@RoleName", SqlDbType.NVarChar, 50, ParameterDirection.Input, roleName);
     int count = Convert.ToInt32(sph.ExecuteScalar());
     return (count > 0);
 }
Example #31
0
        public static int CountOtherSites(int currentSiteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Sites_CountOtherSites", 1);

            sph.DefineSqlParameter("@CurrentSiteID", SqlDbType.Int, ParameterDirection.Input, currentSiteId);

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #32
0
        public static int GetUserThreadCount(int userId, int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ForumThreads_CountByUser", 2);

            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #33
0
        public static int GetCountUnfinishedByType(string taskType)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_TaskQueue_CountIncompleteByType", 1);

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

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #34
0
        public static int GetCountChildPages(int pageId, bool includePending)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Pages_CountChildPages", 2);

            sph.DefineSqlParameter("@PageID", SqlDbType.Int, ParameterDirection.Input, pageId);
            sph.DefineSqlParameter("@IncludePending", SqlDbType.Bit, ParameterDirection.Input, includePending);
            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #35
0
        public static void UpdateSkinVersionGuidForAllSites()
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Sites_UpdateSkinVersionGuidForAllSites", 1);

            sph.DefineSqlParameter("@NewGuid", SqlDbType.NVarChar, 255, ParameterDirection.Input, Guid.NewGuid());

            sph.ExecuteScalar();
        }
Example #36
0
        public static int Create(
            Guid forumGuid,
            int moduleId,
            int userId,
            string title,
            string description,
            bool isModerated,
            bool isActive,
            int sortOrder,
            int postsPerPage,
            int threadsPerPage,
            bool allowAnonymousPosts,

            string rolesThatCanPost,
            string rolesThatCanModerate,
            string moderatorNotifyEmail,
            bool includeInGoogleMap,
            bool addNoIndexMeta,
            bool closed,
            bool visible,
            bool requireModeration,
            bool requireModForNotify,
            bool allowTrustedDirectPosts,
            bool allowTrustedDirectNotify
            )
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Forums_Insert", 22);

            sph.DefineSqlParameter("@ForumGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, forumGuid);
            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
            sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 100, ParameterDirection.Input, title);
            sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
            sph.DefineSqlParameter("@IsModerated", SqlDbType.Bit, ParameterDirection.Input, isModerated);
            sph.DefineSqlParameter("@IsActive", SqlDbType.Bit, ParameterDirection.Input, isActive);
            sph.DefineSqlParameter("@SortOrder", SqlDbType.Int, ParameterDirection.Input, sortOrder);
            sph.DefineSqlParameter("@PostsPerPage", SqlDbType.Int, ParameterDirection.Input, postsPerPage);
            sph.DefineSqlParameter("@ThreadsPerPage", SqlDbType.Int, ParameterDirection.Input, threadsPerPage);
            sph.DefineSqlParameter("@AllowAnonymousPosts", SqlDbType.Bit, ParameterDirection.Input, allowAnonymousPosts);

            sph.DefineSqlParameter("@RolesThatCanPost", SqlDbType.NVarChar, -1, ParameterDirection.Input, rolesThatCanPost);
            sph.DefineSqlParameter("@RolesThatCanModerate", SqlDbType.NVarChar, -1, ParameterDirection.Input, rolesThatCanModerate);
            sph.DefineSqlParameter("@ModeratorNotifyEmail", SqlDbType.NVarChar, -1, ParameterDirection.Input, moderatorNotifyEmail);
            sph.DefineSqlParameter("@IncludeInGoogleMap", SqlDbType.Bit, ParameterDirection.Input, includeInGoogleMap);
            sph.DefineSqlParameter("@AddNoIndexMeta", SqlDbType.Bit, ParameterDirection.Input, addNoIndexMeta);
            sph.DefineSqlParameter("@Closed", SqlDbType.Bit, ParameterDirection.Input, closed);
            sph.DefineSqlParameter("@Visible", SqlDbType.Bit, ParameterDirection.Input, visible);
            sph.DefineSqlParameter("@RequireModeration", SqlDbType.Bit, ParameterDirection.Input, requireModeration);
            sph.DefineSqlParameter("@RequireModForNotify", SqlDbType.Bit, ParameterDirection.Input, requireModForNotify);
            sph.DefineSqlParameter("@AllowTrustedDirectPosts", SqlDbType.Bit, ParameterDirection.Input, allowTrustedDirectPosts);
            sph.DefineSqlParameter("@AllowTrustedDirectNotify", SqlDbType.Bit, ParameterDirection.Input, allowTrustedDirectNotify);



            int newID = Convert.ToInt32(sph.ExecuteScalar());

            return(newID);
        }
Example #37
0
        public static int Count(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_WebParts_GetCount", 1);

            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            int count = Convert.ToInt32(sph.ExecuteScalar());

            return(count);
        }
Example #38
0
        /// <summary>
        /// Gets a count of rows in the mp_EmailTemplate table.
        /// </summary>
        public static int GetCountByModuleAndName(Guid moduleGuid, string name)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_EmailTemplate_GetCountByModuleAndName", 2);

            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name);

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #39
0
        /// <summary>
        /// Gets a count of rows in the mp_Comments table.
        /// </summary>
        public static int GetCount(Guid contentGuid, int moderationStatus)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Comments_CountByContent", 2);

            sph.DefineSqlParameter("@ContentGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, contentGuid);
            sph.DefineSqlParameter("@ModerationStatus", SqlDbType.TinyInt, ParameterDirection.Input, moderationStatus);

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #40
0
 public static bool Exists(Int32 siteId, String className, String assemblyName)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_WebParts_WebPartExists", 3);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     sph.DefineSqlParameter("@ClassName", SqlDbType.NVarChar, 255, ParameterDirection.Input, className);
     sph.DefineSqlParameter("@AssemblyName", SqlDbType.NVarChar, 255, ParameterDirection.Input, assemblyName);
     int count = Convert.ToInt32(sph.ExecuteScalar());
     return (count > 0);
 }
        public static int CountUsersNotSubscribedByLetter(Guid siteGuid, Guid letterInfoGuid, bool excludeIfAnyUnsubscribeHx)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_LetterInfoCountUsersNotSubscribed", 3);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@LetterInfoGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterInfoGuid);
            sph.DefineSqlParameter("@ExcludeIfAnyUnsubscribeHx", SqlDbType.Bit, ParameterDirection.Input, excludeIfAnyUnsubscribeHx);

            return Convert.ToInt32(sph.ExecuteScalar());
        }
Example #42
0
        public static int GetCountOfSiteRoles(int siteId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_Roles_CountBySite", 1);

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


            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #43
0
        public static int GetCountOfUsersNotInRole(int siteId, int roleId)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_UserRoles_CountNotInRole", 2);

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

            return(Convert.ToInt32(sph.ExecuteScalar()));
        }
Example #44
0
        public static bool HostNameExists(string hostName)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SiteHost_Exists", 1);

            sph.DefineSqlParameter("@HostName", SqlDbType.NVarChar, 255, ParameterDirection.Input, hostName);
            int count = Convert.ToInt32(sph.ExecuteScalar());

            return(count > 0);
        }
Example #45
0
 public static bool AddSubscriber(int forumId, int userId, Guid subGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ForumSubscriptions_Insert", 4);
     sph.DefineSqlParameter("@ForumID", SqlDbType.Int, ParameterDirection.Input, forumId);
     sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
     sph.DefineSqlParameter("@SubGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, subGuid);
     sph.DefineSqlParameter("@SubscribeDate", SqlDbType.DateTime, ParameterDirection.Input, DateTime.UtcNow);
     int rowsAffected = Convert.ToInt32(sph.ExecuteScalar());
     return (rowsAffected > 0);
 }
Example #46
0
 public static Guid GetSiteGuid(string folderName)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SiteFolders_SelectSiteGuidByFolder", 1);
     sph.DefineSqlParameter("@FolderName", SqlDbType.NVarChar, 255, ParameterDirection.Input, folderName);
     string strGuid = sph.ExecuteScalar().ToString();
     if (strGuid.Length == 36)
     {
         return new Guid(strGuid);
     }
     return Guid.Empty;
 }
        public static byte[] GetPersonalizationBlobAllUsers(
            int siteId,
            String path)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SitePersonalizationAllUsers_GetPageSettings", 2);
            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@Path", SqlDbType.NVarChar, 255, ParameterDirection.Input, path);

            byte[] result = (byte[])sph.ExecuteScalar();
            return result;
        }
Example #48
0
 public static int Create(
     string userId,
     string claimType,
     string claimValue)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_UserClaims_Insert", 3);
     sph.DefineSqlParameter("@UserId", SqlDbType.NVarChar, 128, ParameterDirection.Input, userId);
     sph.DefineSqlParameter("@ClaimType", SqlDbType.NVarChar, -1, ParameterDirection.Input, claimType);
     sph.DefineSqlParameter("@ClaimValue", SqlDbType.NVarChar, -1, ParameterDirection.Input, claimValue);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return newID;
 }
Example #49
0
 ///// <summary>
 ///// Gets the connection string.
 ///// </summary>
 ///// <returns></returns>
 //private static string GetConnectionString()
 //{
 //    return ConfigurationManager.AppSettings["MSSQLConnectionString"];
 //}
 /// <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 static int Add(
     string bannedIP,
     DateTime bannedUtc,
     string bannedReason)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "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;
 }
Example #50
0
 /// <summary>
 /// Inserts a row in the mp_MediaFile table.
 /// </summary>
 /// <param name="trackID">The ID of the Track for which the File is being added.</param>
 /// <param name="filePath">The name of the physical Media File.</param>
 /// <param name="userGuid">The Guid of the user who is adding the File.</param>
 /// <returns>The ID of the Media File in the doan_MediaFiles table.</returns>
 public static int Insert(
     int trackId,
     string filePath,
     Guid userGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_MediaFile_Insert", 3);
     sph.DefineSqlParameter("@TrackID", SqlDbType.Int, ParameterDirection.Input, trackId);
     sph.DefineSqlParameter("@FilePath", SqlDbType.NVarChar, 100, ParameterDirection.Input, filePath);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return newID;
 }
 public static byte[] GetPersonalizationBlob(
     int siteId,
     String path,
     Guid userGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SitePersonalizationPerUser_GetPageSettings", 3);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     sph.DefineSqlParameter("@Path", SqlDbType.NVarChar, 255, ParameterDirection.Input, path);
     sph.DefineSqlParameter("@UserId", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     byte[] result = (byte[])sph.ExecuteScalar();
     return result;
 }
Example #52
0
 /// <summary>
 /// Inserts a row in the mp_IndexingQueue table. Returns new integer id.
 /// </summary>
 /// <param name="indexPath"> indexPath </param>
 /// <param name="serializedItem"> serializedItem </param>
 /// <param name="itemKey"> itemKey </param>
 /// <param name="removeOnly"> removeOnly </param>
 /// <returns>int</returns>
 public static Int64 Create(
     int siteId,
     string indexPath,
     string serializedItem,
     string itemKey,
     bool removeOnly)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_IndexingQueue_Insert", 5);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     sph.DefineSqlParameter("@IndexPath", SqlDbType.NVarChar, 255, ParameterDirection.Input, indexPath);
     sph.DefineSqlParameter("@SerializedItem", SqlDbType.NVarChar, -1, ParameterDirection.Input, serializedItem);
     sph.DefineSqlParameter("@ItemKey", SqlDbType.NVarChar, 255, ParameterDirection.Input, itemKey);
     sph.DefineSqlParameter("@RemoveOnly", SqlDbType.Bit, ParameterDirection.Input, removeOnly);
     Int64 newID = Convert.ToInt64(sph.ExecuteScalar());
     return newID;
 }
 public static int GetCountOfState(
     int siteId,
     String path,
     bool allUserScope,
     Guid userGuid,
     DateTime inactiveSince)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_SitePersonalizationAdministration_GetCountOfState", 5);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     sph.DefineSqlParameter("@Path", SqlDbType.NVarChar, 255, ParameterDirection.Input, path);
     sph.DefineSqlParameter("@AllUsersScope", SqlDbType.Bit, ParameterDirection.Input, allUserScope);
     sph.DefineSqlParameter("@UserId", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     sph.DefineSqlParameter("@InactiveSinceDate", SqlDbType.DateTime, ParameterDirection.Input, inactiveSince);
     int result = Convert.ToInt32(sph.ExecuteScalar());
     return result;
 }
Example #54
0
 /// <summary>
 /// Inserts a row in the doan_MediaPlayers table.
 /// </summary>
 /// <param name="moduleID">The ID of the Module</param>
 /// <param name="playerType">The Player Type.</param>
 /// <param name="createdDate">The Date the Media Player was created.</param>
 /// <param name="userGuid">The Guid of the user who created the Media Player.</param>
 /// <param name="moduleGuid">The Guid of the Module.</param>
 /// <returns>The ID of the Media Player.</returns>
 public static int Insert(
     int moduleId,
     string playerType,
     String skin,
     Guid userGuid,
     Guid moduleGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_MediaPlayer_Insert", 5);
     sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
     sph.DefineSqlParameter("@PlayerType", SqlDbType.NVarChar, 10, ParameterDirection.Input, playerType);
     sph.DefineSqlParameter("@Skin", SqlDbType.NVarChar, 50, ParameterDirection.Input, skin);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return newID;
 }
Example #55
0
 ///// <summary>
 ///// Gets the connection string.
 ///// </summary>
 ///// <returns></returns>
 //private static string GetConnectionString()
 //{
 //    return ConfigurationManager.AppSettings["MSSQLConnectionString"];
 //}
 /// <summary>
 /// Inserts a row in the mp_FriendlyUrls table. Returns new integer id.
 /// </summary>
 /// <param name="itemGuid"> itemGuid </param>
 /// <param name="siteGuid"> siteGuid </param>
 /// <param name="pageGuid"> pageGuid </param>
 /// <param name="siteID"> siteID </param>
 /// <param name="friendlyUrl"> friendlyUrl </param>
 /// <param name="realUrl"> realUrl </param>
 /// <param name="isPattern"> isPattern </param>
 /// <returns>int</returns>
 public static int AddFriendlyUrl(
     Guid itemGuid,
     Guid siteGuid,
     Guid pageGuid,
     int siteId,
     string friendlyUrl,
     string realUrl,
     bool isPattern)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_FriendlyUrls_Insert", 7);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
     sph.DefineSqlParameter("@PageGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pageGuid);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     sph.DefineSqlParameter("@FriendlyUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, friendlyUrl);
     sph.DefineSqlParameter("@RealUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, realUrl);
     sph.DefineSqlParameter("@IsPattern", SqlDbType.Bit, ParameterDirection.Input, isPattern);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return newID;
 }
Example #56
0
 /// <summary>
 /// Inserts a row in the mp_LetterSendLog table. Returns new integer id.
 /// </summary>
 /// <param name="letterGuid"> letterGuid </param>
 /// <param name="userGuid"> userGuid </param>
 /// <param name="emailAddress"> emailAddress </param>
 /// <param name="uTC"> uTC </param>
 /// <param name="errorOccurred"> errorOccurred </param>
 /// <param name="errorMessage"> errorMessage </param>
 /// <returns>int</returns>
 public static int Create(
     Guid letterGuid,
     Guid userGuid,
     Guid subscribeGuid,
     string emailAddress,
     DateTime uTC,
     bool errorOccurred,
     string errorMessage)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_LetterSendLog_Insert", 7);
     sph.DefineSqlParameter("@LetterGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterGuid);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     sph.DefineSqlParameter("@SubscribeGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, subscribeGuid);
     sph.DefineSqlParameter("@EmailAddress", SqlDbType.NVarChar, 100, ParameterDirection.Input, emailAddress);
     sph.DefineSqlParameter("@UTC", SqlDbType.DateTime, ParameterDirection.Input, uTC);
     sph.DefineSqlParameter("@ErrorOccurred", SqlDbType.Bit, ParameterDirection.Input, errorOccurred);
     sph.DefineSqlParameter("@ErrorMessage", SqlDbType.NVarChar, -1, ParameterDirection.Input, errorMessage);
     int newID = Convert.ToInt32(sph.ExecuteScalar());
     return newID;
 }
Example #57
0
        /// <summary>
        /// Inserts a row in the mp_CalendarEvents table. Returns new integer id.
        /// </summary>
        /// <param name="itemGuid"> itemGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="moduleID"> moduleID </param>
        /// <param name="title"> title </param>
        /// <param name="description"> description </param>
        /// <param name="imageName"> imageName </param>
        /// <param name="eventDate"> eventDate </param>
        /// <param name="startTime"> startTime </param>
        /// <param name="endTime"> endTime </param>
        /// <param name="userID"> userID </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="location"> location </param>
        /// <param name="requiresTicket"> requiresTicket </param>
        /// <param name="ticketPrice"> ticketPrice </param>
        /// <param name="createdDate"> createdDate </param>
        /// <returns>int</returns>
        public static int AddCalendarEvent(
            Guid itemGuid,
            Guid moduleGuid,
            int moduleId,
            string title,
            string description,
            string imageName,
            DateTime eventDate,
            DateTime startTime,
            DateTime endTime,
            int userId,
            Guid userGuid,
            string location,
            bool requiresTicket,
            decimal ticketPrice,
            DateTime createdDate)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_CalendarEvents_Insert", 15);
            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            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("@EventDate", SqlDbType.DateTime, ParameterDirection.Input, eventDate);
            sph.DefineSqlParameter("@StartTime", SqlDbType.SmallDateTime, ParameterDirection.Input, startTime);
            sph.DefineSqlParameter("@EndTime", SqlDbType.SmallDateTime, ParameterDirection.Input, endTime);
            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@Location", SqlDbType.NVarChar, -1, ParameterDirection.Input, location);

            sph.DefineSqlParameter("@RequiresTicket", SqlDbType.Bit, ParameterDirection.Input, requiresTicket);
            sph.DefineSqlParameter("@TicketPrice", SqlDbType.Decimal, ParameterDirection.Input, ticketPrice);
            sph.DefineSqlParameter("@CreatedDate", SqlDbType.DateTime, ParameterDirection.Input, createdDate);

            int newID = Convert.ToInt32(sph.ExecuteScalar());
            return newID;
        }
        public static int AddModuleDefinition(
            Guid featureGuid,
            int siteId,
            string featureName,
            string controlSrc,
            int sortOrder,
            int defaultCacheTime,
            String icon,
            bool isAdmin,
            string resourceFile,
            bool isCacheable,
            bool isSearchable,
            string searchListName,
            bool supportsPageReuse,
            string deleteProvider,
            string partialView)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ModuleDefinitions_Insert", 15);
            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@FeatureName", SqlDbType.NVarChar, 255, ParameterDirection.Input, featureName);
            sph.DefineSqlParameter("@ControlSrc", SqlDbType.NVarChar, 255, ParameterDirection.Input, controlSrc);
            sph.DefineSqlParameter("@SortOrder", SqlDbType.Int, ParameterDirection.Input, sortOrder);
            sph.DefineSqlParameter("@IsAdmin", SqlDbType.Bit, ParameterDirection.Input, isAdmin);
            sph.DefineSqlParameter("@Icon", SqlDbType.NVarChar, 255, ParameterDirection.Input, icon);
            sph.DefineSqlParameter("@DefaultCacheTime", SqlDbType.Int, ParameterDirection.Input, defaultCacheTime);
            sph.DefineSqlParameter("@FeatureGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, featureGuid);
            sph.DefineSqlParameter("@ResourceFile", SqlDbType.NVarChar, 255, ParameterDirection.Input, resourceFile);
            sph.DefineSqlParameter("@IsCacheable", SqlDbType.Bit, ParameterDirection.Input, isCacheable);
            sph.DefineSqlParameter("@IsSearchable", SqlDbType.Bit, ParameterDirection.Input, isSearchable);
            sph.DefineSqlParameter("@SearchListName", SqlDbType.NVarChar, 255, ParameterDirection.Input, searchListName);
            sph.DefineSqlParameter("@SupportsPageReuse", SqlDbType.Bit, ParameterDirection.Input, supportsPageReuse);
            sph.DefineSqlParameter("@DeleteProvider", SqlDbType.NVarChar, 255, ParameterDirection.Input, deleteProvider);
            sph.DefineSqlParameter("@PartialView", SqlDbType.NVarChar, 255, ParameterDirection.Input, partialView);

            int newID = Convert.ToInt32(sph.ExecuteScalar());
            return newID;
        }
Example #59
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 static int Create(
     DateTime logDate,
     string ipAddress,
     string culture,
     string url,
     string shortUrl,
     string thread,
     string logLevel,
     string logger,
     string message)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "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;
 }
 public static int GetWorkInProgressCountByPage(Guid pageGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ContentWorkflow_GetInProgressCountByPage", 1);
     sph.DefineSqlParameter("@PageGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pageGuid);
     return Convert.ToInt32(sph.ExecuteScalar());
 }