示例#1
1
 public static int Add(
     Guid pollGuid,
     Guid siteGuid,
     String question,
     bool anonymousVoting,
     bool allowViewingResultsBeforeVoting,
     bool showOrderNumbers,
     bool showResultsWhenDeactivated,
     bool active,
     DateTime activeFrom,
     DateTime activeTo)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Polls_Insert", 10);
     sph.DefineSqlParameter("@PollGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pollGuid);
     sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
     sph.DefineSqlParameter("@Question", SqlDbType.NVarChar, 255, ParameterDirection.Input, question);
     sph.DefineSqlParameter("@AnonymousVoting", SqlDbType.Bit, ParameterDirection.Input, anonymousVoting);
     sph.DefineSqlParameter("@AllowViewingResultsBeforeVoting", SqlDbType.Bit, ParameterDirection.Input, allowViewingResultsBeforeVoting);
     sph.DefineSqlParameter("@ShowOrderNumbers", SqlDbType.Bit, ParameterDirection.Input, showOrderNumbers);
     sph.DefineSqlParameter("@ShowResultsWhenDeactivated", SqlDbType.Bit, ParameterDirection.Input, showResultsWhenDeactivated);
     sph.DefineSqlParameter("@Active", SqlDbType.Bit, ParameterDirection.Input, active);
     sph.DefineSqlParameter("@ActiveFrom", SqlDbType.DateTime, ParameterDirection.Input, activeFrom);
     sph.DefineSqlParameter("@ActiveTo", SqlDbType.DateTime, ParameterDirection.Input, activeTo);
     int rowsAffected = sph.ExecuteNonQuery();
     return rowsAffected;
 }
示例#2
1
 public static bool Delete(Guid pollGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Polls_Delete", 1);
     sph.DefineSqlParameter("@PollGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pollGuid);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
        /// <summary>
        /// Inserts a row in the mp_ContentWorkflow table. Returns rows affected count.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="createdDateUtc"> createdDateUtc </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="status"> status </param>
        /// <param name="contentText"> contentText </param>
        /// <param name="customData"> customData </param>
        /// <param name="customReferenceNumber"> customReferenceNumber </param>
        /// <param name="customReferenceGuid"> customReferenceGuid </param>
        /// <returns>int</returns>
        public static int Create(
            Guid guid,
            Guid siteGuid,
            Guid moduleGuid,
            Guid userGuid,
            DateTime createdDateUtc,
            string contentText,
            string customData,
            int customReferenceNumber,
            Guid customReferenceGuid,
            string status)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ContentWorkflow_Insert", 10);
            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@CreatedDateUtc", SqlDbType.DateTime, ParameterDirection.Input, createdDateUtc);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@Status", SqlDbType.NVarChar, 20, ParameterDirection.Input, status);
            sph.DefineSqlParameter("@ContentText", SqlDbType.NVarChar, -1, ParameterDirection.Input, contentText);
            sph.DefineSqlParameter("@CustomData", SqlDbType.NVarChar, -1, ParameterDirection.Input, customData);

            //object customReferenceNumberVal = customReferenceNumber.HasValue ? (object)customReferenceNumber.Value : DBNull.Value;
            sph.DefineSqlParameter("@CustomReferenceNumber", SqlDbType.Int, ParameterDirection.Input, customReferenceNumber);

            //object customReferenceGuidVal = customReferenceGuid.HasValue ? (object)customReferenceGuid.Value : DBNull.Value;
            sph.DefineSqlParameter("@CustomReferenceGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, customReferenceGuid);

            int rowsAffected = sph.ExecuteNonQuery();
            return rowsAffected;
        }
示例#4
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;
 }
示例#5
0
 public static bool DeleteBySite(int siteId)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Polls_DeleteBySite", 1);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > -1);
 }
示例#6
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);
 }
示例#7
0
 public static int AddWebPart(
     Guid webPartId,
     Guid siteGuid,
     int siteId,
     string title,
     string description,
     string imageUrl,
     string className,
     string assemblyName,
     bool availableForMyPage,
     bool allowMultipleInstancesOnMyPage,
     bool availableForContentSystem)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_WebParts_Insert", 11);
     sph.DefineSqlParameter("@WebPartID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, webPartId);
     sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
     sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
     sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, ParameterDirection.Input, title);
     sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, ParameterDirection.Input, description);
     sph.DefineSqlParameter("@ImageUrl", SqlDbType.NVarChar, ParameterDirection.Input, imageUrl);
     sph.DefineSqlParameter("@ClassName", SqlDbType.NVarChar, ParameterDirection.Input, className);
     sph.DefineSqlParameter("@AssemblyName", SqlDbType.NVarChar, ParameterDirection.Input, assemblyName);
     sph.DefineSqlParameter("@AvailableForMyPage", SqlDbType.Bit, ParameterDirection.Input, availableForMyPage);
     sph.DefineSqlParameter("@AllowMultipleInstancesOnMyPage", SqlDbType.Bit, ParameterDirection.Input, allowMultipleInstancesOnMyPage);
     sph.DefineSqlParameter("@AvailableForContentSystem", SqlDbType.Bit, ParameterDirection.Input, availableForContentSystem);
     int rowsAffected = sph.ExecuteNonQuery();
     return rowsAffected;
 }
示例#8
0
 public static bool DeleteWebPart(Guid webPartId)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_WebParts_Delete", 1);
     sph.DefineSqlParameter("@WebPartID", SqlDbType.Int, ParameterDirection.Input, webPartId);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > -1);
 }
示例#9
0
 public static bool DeleteByLetterInfo(Guid letterInfoGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_LetterSendLog_DeleteByLetterInfo", 1);
     sph.DefineSqlParameter("@LetterInfoGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterInfoGuid);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
示例#10
0
        public static bool CreateModuleSetting(
            Guid settingGuid,
            Guid moduleGuid,
            int moduleId,
            string settingName,
            string settingValue,
            string controlType,
            string regexValidationExpression,
            string controlSrc,
            string helpKey,
            int sortOrder)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ModuleSettings_Insert", 10);

            sph.DefineSqlParameter("@SettingGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, settingGuid);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@SettingName", SqlDbType.NVarChar, 50, ParameterDirection.Input, settingName);
            sph.DefineSqlParameter("@SettingValue", SqlDbType.NVarChar, -1, ParameterDirection.Input, settingValue);
            sph.DefineSqlParameter("@ControlType", SqlDbType.NVarChar, 50, ParameterDirection.Input, controlType);
            sph.DefineSqlParameter("@RegexValidationExpression", SqlDbType.NVarChar, -1, ParameterDirection.Input, regexValidationExpression);
            sph.DefineSqlParameter("@ControlSrc", SqlDbType.NVarChar, 255, ParameterDirection.Input, controlSrc);
            sph.DefineSqlParameter("@HelpKey", SqlDbType.NVarChar, 255, ParameterDirection.Input, helpKey);
            sph.DefineSqlParameter("@SortOrder", SqlDbType.Int, ParameterDirection.Input, sortOrder);

            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > -1);
        }
        public static bool Add(int contractId,
            int projectId,
            int blockId,
            int workId,
            int groupId,
            int itemId,
            int subItemId,
            int initialProgress,
            int currentProgress,
            string user)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("INSERT INTO uAvance ");
            sb.Append("(IdContrato,IdProyecto,IdBloque,IdObra,IdGrupo,IdItem,IdSubItem,AvanceInicial,AvanceActual,Usuario,Fecha)");
            sb.Append(" VALUES ");
            sb.AppendFormat("({0},{1},{2},{3},{4},{5},{6},{7},{8},'{9}',GETDATE())", contractId, projectId, blockId, workId, groupId, itemId, subItemId, initialProgress, currentProgress, user);

            SqlParameterHelper sph = new SqlParameterHelper(DBHelper.Instance.ConnectionString, sb.ToString(), CommandType.Text, 0);
            int rows = 0;

            try
            {
                rows = sph.ExecuteNonQuery();
            }
            catch(Exception)
            {
                rows = 0;
            }

            return rows > 0;
        }
示例#12
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;
 }
示例#13
0
 public static bool DeleteSettingById(int id)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ModuleDefinitionSettings_DeleteByID", 1);
     sph.DefineSqlParameter("@ID", SqlDbType.Int, ParameterDirection.Input, id);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > -1);
 }
示例#14
0
 public static bool DeleteModuleDefinitionFromSites(int moduleDefId)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SiteModuleDefinitions_DeleteByFeature", 1);
     sph.DefineSqlParameter("@ModuleDefID", SqlDbType.Int, ParameterDirection.Input, moduleDefId);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > -1);
 }
示例#15
0
        /// <summary>
        /// Inserts a row in the mp_FileAttachment table. Returns rows affected count.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="itemGuid"> itemGuid </param>
        /// <param name="specialGuid1"> specialGuid1 </param>
        /// <param name="specialGuid2"> specialGuid2 </param>
        /// <param name="serverFileName"> serverFileName </param>
        /// <param name="fileName"> fileName </param>
        /// <param name="createdUtc"> createdUtc </param>
        /// <param name="createdBy"> createdBy </param>
        /// <returns>int</returns>
        public static int Create(
            Guid rowGuid,
            Guid siteGuid,
            Guid moduleGuid,
            Guid itemGuid,
            Guid specialGuid1,
            Guid specialGuid2,
            string serverFileName,
            string fileName,
            string contentTitle,
            long contentLength,
            string contentType,
            DateTime createdUtc,
            Guid createdBy)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_FileAttachment_Insert", 13);
            sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@SpecialGuid1", SqlDbType.UniqueIdentifier, ParameterDirection.Input, specialGuid1);
            sph.DefineSqlParameter("@SpecialGuid2", SqlDbType.UniqueIdentifier, ParameterDirection.Input, specialGuid2);
            sph.DefineSqlParameter("@ServerFileName", SqlDbType.NVarChar, 255, ParameterDirection.Input, serverFileName);
            sph.DefineSqlParameter("@FileName", SqlDbType.NVarChar, 255, ParameterDirection.Input, fileName);
            sph.DefineSqlParameter("@ContentTitle", SqlDbType.NVarChar, 255, ParameterDirection.Input, contentTitle);
            sph.DefineSqlParameter("@ContentLength", SqlDbType.BigInt, ParameterDirection.Input, contentLength);
            sph.DefineSqlParameter("@ContentType", SqlDbType.NVarChar, 50, ParameterDirection.Input, contentType);

            sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
            sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
            int rowsAffected = sph.ExecuteNonQuery();
            return rowsAffected;
        }
示例#16
0
 public static int Add(
     Guid guid,
     Guid storeGuid,
     int downloadsAllowed,
     int expireAfterDays,
     bool countAfterDownload,
     DateTime created,
     Guid createdBy,
     string createdFromIP,
     DateTime lastModified,
     Guid lastModifedBy,
     string lastModifedFromIPAddress,
     string name,
     string description)
 {
     SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_FullfillDownloadTerms_Insert", 13);
     sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
     sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
     sph.DefineSqlParameter("@DownloadsAllowed", SqlDbType.Int, ParameterDirection.Input, downloadsAllowed);
     sph.DefineSqlParameter("@ExpireAfterDays", SqlDbType.Int, ParameterDirection.Input, expireAfterDays);
     sph.DefineSqlParameter("@CountAfterDownload", SqlDbType.Bit, ParameterDirection.Input, countAfterDownload);
     sph.DefineSqlParameter("@Created", SqlDbType.DateTime, ParameterDirection.Input, created);
     sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
     sph.DefineSqlParameter("@CreatedFromIP", SqlDbType.NVarChar, 255, ParameterDirection.Input, createdFromIP);
     sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified);
     sph.DefineSqlParameter("@LastModifedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModifedBy);
     sph.DefineSqlParameter("@LastModifedFromIPAddress", SqlDbType.NVarChar, 255, ParameterDirection.Input, lastModifedFromIPAddress);
     sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name);
     sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
     int rowsAffected = sph.ExecuteNonQuery();
     return rowsAffected;
 }
示例#17
0
 public static bool Delete(Guid guid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_FullfillDownloadTerms_Delete", 1);
     sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
示例#18
0
 public static int Add(
     Guid guid,
     Guid offerGuid,
     DateTime beginUtc,
     DateTime endUtc,
     bool requiresOfferCode,
     string offerCode,
     int maxAllowedPerCustomer,
     DateTime created,
     Guid createdBy,
     string createdFromIP,
     DateTime lastModified,
     Guid lastModifedBy,
     string lastModifedFromIP)
 {
     SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_OfferAvailability_Insert", 13);
     sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
     sph.DefineSqlParameter("@OfferGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, offerGuid);
     sph.DefineSqlParameter("@BeginUTC", SqlDbType.DateTime, ParameterDirection.Input, beginUtc);
     sph.DefineSqlParameter("@EndUTC", SqlDbType.DateTime, ParameterDirection.Input, endUtc);
     sph.DefineSqlParameter("@RequiresOfferCode", SqlDbType.Bit, ParameterDirection.Input, requiresOfferCode);
     sph.DefineSqlParameter("@OfferCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, offerCode);
     sph.DefineSqlParameter("@MaxAllowedPerCustomer", SqlDbType.Int, ParameterDirection.Input, maxAllowedPerCustomer);
     sph.DefineSqlParameter("@Created", SqlDbType.DateTime, ParameterDirection.Input, created);
     sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
     sph.DefineSqlParameter("@CreatedFromIP", SqlDbType.NVarChar, 255, ParameterDirection.Input, createdFromIP);
     sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified);
     sph.DefineSqlParameter("@LastModifedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModifedBy);
     sph.DefineSqlParameter("@LastModifedFromIP", SqlDbType.NVarChar, 255, ParameterDirection.Input, lastModifedFromIP);
     int rowsAffected = sph.ExecuteNonQuery();
     return rowsAffected;
 }
示例#19
0
 public static bool DeleteByCart(Guid cartGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_CartOffers_DeleteByCart", 1);
     sph.DefineSqlParameter("@CartGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, cartGuid);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
示例#20
0
 /// <summary>
 /// Deletes the Player that is for a Module.
 /// </summary>
 /// <param name="moduleID">The ID of the Module.</param>
 /// <returns>Returns true if row deleted.</returns>
 public static bool DeleteByModule(int moduleId)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_MediaPlayer_DeleteByModule", 1);
     sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
示例#21
0
 public static bool DeleteGalleryImage(int itemId)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_GalleryImages_Delete", 1);
     sph.DefineSqlParameter("@ItemID", SqlDbType.Int, ParameterDirection.Input, itemId);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > -1);
 }
示例#22
0
        /// <summary>
        /// Inserts a row in the mp_Letter table. Returns rows affected count.
        /// </summary>
        /// <param name="letterGuid"> letterGuid </param>
        /// <param name="letterInfoGuid"> letterInfoGuid </param>
        /// <param name="subject"> subject </param>
        /// <param name="htmlBody"> htmlBody </param>
        /// <param name="textBody"> textBody </param>
        /// <param name="createdBy"> createdBy </param>
        /// <param name="createdUTC"> createdUTC </param>
        /// <param name="lastModBy"> lastModBy </param>
        /// <param name="lastModUTC"> lastModUTC </param>
        /// <param name="isApproved"> isApproved </param>
        /// <param name="approvedBy"> approvedBy </param>
        /// <returns>int</returns>
        public static int Create(
            Guid letterGuid,
            Guid letterInfoGuid,
            string subject,
            string htmlBody,
            string textBody,
            Guid createdBy,
            DateTime createdUtc,
            Guid lastModBy,
            DateTime lastModUtc,
            bool isApproved,
            Guid approvedBy)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Letter_Insert", 11);
            sph.DefineSqlParameter("@LetterGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterGuid);
            sph.DefineSqlParameter("@LetterInfoGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterInfoGuid);
            sph.DefineSqlParameter("@Subject", SqlDbType.NVarChar, 255, ParameterDirection.Input, subject);
            sph.DefineSqlParameter("@HtmlBody", SqlDbType.NVarChar, -1, ParameterDirection.Input, htmlBody);
            sph.DefineSqlParameter("@TextBody", SqlDbType.NVarChar, -1, ParameterDirection.Input, textBody);
            sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
            sph.DefineSqlParameter("@CreatedUTC", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
            sph.DefineSqlParameter("@LastModBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModBy);
            sph.DefineSqlParameter("@LastModUTC", SqlDbType.DateTime, ParameterDirection.Input, lastModUtc);
            sph.DefineSqlParameter("@IsApproved", SqlDbType.Bit, ParameterDirection.Input, isApproved);
            sph.DefineSqlParameter("@ApprovedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, approvedBy);

            int rowsAffected = sph.ExecuteNonQuery();
            return rowsAffected;
        }
示例#23
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;
 }
示例#24
0
 public static bool CreateDefaultModuleSettings(int moduleId)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ModuleSettings_CreateDefaultSettings", 1);
     sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > -1);
 }
示例#25
0
 /// <summary>
 /// Deletes a row from the mp_SystemLog table. Returns true if row deleted.
 /// </summary>
 /// <param name="id"> id </param>
 /// <returns>bool</returns>
 public static bool Delete(int id)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SystemLog_Delete", 1);
     sph.DefineSqlParameter("@ID", SqlDbType.Int, ParameterDirection.Input, id);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
示例#26
0
 ///// <summary>
 ///// Gets the connection string for read.
 ///// </summary>
 ///// <returns></returns>
 //private static string GetReadConnectionString()
 //{
 //    return ConfigurationManager.AppSettings["MSSQLConnectionString"];
 //}
 ///// <summary>
 ///// Gets the connection string for write.
 ///// </summary>
 ///// <returns></returns>
 //private static string GetWriteConnectionString()
 //{
 //    if (ConfigurationManager.AppSettings["MSSQLWriteConnectionString"] != null)
 //    {
 //        return ConfigurationManager.AppSettings["MSSQLWriteConnectionString"];
 //    }
 //    return ConfigurationManager.AppSettings["MSSQLConnectionString"];
 //}
 /// <summary>
 /// Inserts a row in the mp_ContentMeta table. Returns rows affected count.
 /// </summary>
 /// <param name="guid"> guid </param>
 /// <param name="siteGuid"> siteGuid </param>
 /// <param name="moduleGuid"> moduleGuid </param>
 /// <param name="contentGuid"> contentGuid </param>
 /// <param name="name"> name </param>
 /// <param name="scheme"> scheme </param>
 /// <param name="langCode"> langCode </param>
 /// <param name="dir"> dir </param>
 /// <param name="metaContent"> metaContent </param>
 /// <param name="sortRank"> sortRank </param>
 /// <param name="createdUtc"> createdUtc </param>
 /// <param name="createdBy"> createdBy </param>
 /// <returns>int</returns>
 public static int Create(
     Guid guid,
     Guid siteGuid,
     Guid moduleGuid,
     Guid contentGuid,
     string name,
     string scheme,
     string langCode,
     string dir,
     string metaContent,
     int sortRank,
     DateTime createdUtc,
     Guid createdBy)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ContentMeta_Insert", 14);
     sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
     sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     sph.DefineSqlParameter("@ContentGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, contentGuid);
     sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name);
     sph.DefineSqlParameter("@Scheme", SqlDbType.NVarChar, 255, ParameterDirection.Input, scheme);
     sph.DefineSqlParameter("@LangCode", SqlDbType.NVarChar, 10, ParameterDirection.Input, langCode);
     sph.DefineSqlParameter("@Dir", SqlDbType.NVarChar, 3, ParameterDirection.Input, dir);
     sph.DefineSqlParameter("@MetaContent", SqlDbType.NVarChar, -1, ParameterDirection.Input, metaContent);
     sph.DefineSqlParameter("@SortRank", SqlDbType.Int, ParameterDirection.Input, sortRank);
     sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
     sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
     sph.DefineSqlParameter("@LastModUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
     sph.DefineSqlParameter("@LastModBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
     int rowsAffected = sph.ExecuteNonQuery();
     return rowsAffected;
 }
示例#27
0
 ///// <summary>
 ///// Gets the connection string for read.
 ///// </summary>
 ///// <returns></returns>
 //private static string GetReadConnectionString()
 //{
 //    return ConfigurationManager.AppSettings["MSSQLConnectionString"];
 //}
 ///// <summary>
 ///// Gets the connection string for write.
 ///// </summary>
 ///// <returns></returns>
 //private static string GetWriteConnectionString()
 //{
 //    if (ConfigurationManager.AppSettings["MSSQLWriteConnectionString"] != null)
 //    {
 //        return ConfigurationManager.AppSettings["MSSQLWriteConnectionString"];
 //    }
 //    return ConfigurationManager.AppSettings["MSSQLConnectionString"];
 //}
 /// <summary>
 /// Inserts a row in the mp_ContentMetaLink table. Returns rows affected count.
 /// </summary>
 /// <param name="guid"> guid </param>
 /// <param name="siteGuid"> siteGuid </param>
 /// <param name="moduleGuid"> moduleGuid </param>
 /// <param name="contentGuid"> contentGuid </param>
 /// <param name="rel"> rel </param>
 /// <param name="href"> href </param>
 /// <param name="hrefLang"> hrefLang </param>
 /// <param name="rev"> rev </param>
 /// <param name="type"> type </param>
 /// <param name="media"> media </param>
 /// <param name="sortRank"> sortRank </param>
 /// <param name="createdUtc"> createdUtc </param>
 /// <param name="createdBy"> createdBy </param>
 /// <param name="lastModUtc"> lastModUtc </param>
 /// <param name="lastModBy"> lastModBy </param>
 /// <returns>int</returns>
 public static int Create(
     Guid guid,
     Guid siteGuid,
     Guid moduleGuid,
     Guid contentGuid,
     string rel,
     string href,
     string hrefLang,
     string rev,
     string type,
     string media,
     int sortRank,
     DateTime createdUtc,
     Guid createdBy)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ContentMetaLink_Insert", 15);
     sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
     sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
     sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
     sph.DefineSqlParameter("@ContentGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, contentGuid);
     sph.DefineSqlParameter("@Rel", SqlDbType.NVarChar, 255, ParameterDirection.Input, rel);
     sph.DefineSqlParameter("@Href", SqlDbType.NVarChar, 255, ParameterDirection.Input, href);
     sph.DefineSqlParameter("@HrefLang", SqlDbType.NVarChar, 10, ParameterDirection.Input, hrefLang);
     sph.DefineSqlParameter("@Rev", SqlDbType.NVarChar, 50, ParameterDirection.Input, rev);
     sph.DefineSqlParameter("@Type", SqlDbType.NVarChar, 50, ParameterDirection.Input, type);
     sph.DefineSqlParameter("@Media", SqlDbType.NVarChar, 50, ParameterDirection.Input, media);
     sph.DefineSqlParameter("@SortRank", SqlDbType.Int, ParameterDirection.Input, sortRank);
     sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
     sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
     sph.DefineSqlParameter("@LastModUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
     sph.DefineSqlParameter("@LastModBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
     int rowsAffected = sph.ExecuteNonQuery();
     return rowsAffected;
 }
示例#28
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;
 }
示例#29
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;
        }
示例#30
0
 /// <summary>
 /// Deletes a row from the ws_OrderOffers table. Returns true if row deleted.
 /// </summary>
 /// <param name="itemGuid"> itemGuid </param>
 /// <returns>bool</returns>
 public static bool DeleteByOrder(Guid orderGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetReadConnectionString(), "ws_OrderOffers_DeleteByOrder", 1);
     sph.DefineSqlParameter("@OrderGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, orderGuid);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
示例#31
0
        public static bool Verify(
            Guid guid,
            bool isVerified,
            Guid verifyGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_LetterSubscribe_Verify", 3);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@IsVerified", SqlDbType.Bit, ParameterDirection.Input, isVerified);
            sph.DefineSqlParameter("@VerifyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, verifyGuid);

            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
示例#32
0
        /// <summary>
        /// Records the complete of sending in the db
        /// </summary>
        /// <param name="letterGuid"> letterGuid </param>
        /// <param name="sendClickedUtc"> sendClickedUtc </param>
        /// <returns>bool</returns>
        public static bool SendComplete(
            Guid letterGuid,
            DateTime sendCompleteUtc,
            int sendCount)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Letter_UpdateSendComplete", 3);

            sph.DefineSqlParameter("@LetterGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterGuid);
            sph.DefineSqlParameter("@SendCompleteUTC", SqlDbType.DateTime, ParameterDirection.Input, sendCompleteUtc);
            sph.DefineSqlParameter("@SendCount", SqlDbType.Int, ParameterDirection.Input, sendCount);

            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
示例#33
0
        /// <summary>
        /// Updates a row in the mp_PaymentLog table. Returns true if row updated.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="storeGuid"> storeGuid </param>
        /// <param name="cartGuid"> cartGuid </param>
        /// <param name="rawResponse"> rawResponse </param>
        /// <param name="responseCode"> responseCode </param>
        /// <param name="responseReasonCode"> responseReasonCode </param>
        /// <param name="reason"> reason </param>
        /// <param name="avsCode"> avsCode </param>
        /// <param name="ccvCode"> ccvCode </param>
        /// <param name="cavCode"> cavCode </param>
        /// <param name="transactionId"> transactionId </param>
        /// <param name="transactionType"> transactionType </param>
        /// <param name="method"> method </param>
        /// <param name="authCode"> authCode </param>
        /// <param name="amount"> amount </param>
        /// <param name="tax"> tax </param>
        /// <param name="duty"> duty </param>
        /// <param name="freight"> freight </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid rowGuid,
            Guid siteGuid,
            Guid userGuid,
            Guid storeGuid,
            Guid cartGuid,
            string rawResponse,
            string responseCode,
            string responseReasonCode,
            string reason,
            string avsCode,
            string ccvCode,
            string cavCode,
            string transactionId,
            string transactionType,
            string method,
            string authCode,
            decimal amount,
            decimal tax,
            decimal duty,
            decimal freight)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_PaymentLog_Update", 20);

            sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid);
            sph.DefineSqlParameter("@CartGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, cartGuid);
            sph.DefineSqlParameter("@RawResponse", SqlDbType.NVarChar, -1, ParameterDirection.Input, rawResponse);
            sph.DefineSqlParameter("@ResponseCode", SqlDbType.NChar, 1, ParameterDirection.Input, responseCode);
            sph.DefineSqlParameter("@ResponseReasonCode", SqlDbType.NVarChar, 20, ParameterDirection.Input, responseReasonCode);
            sph.DefineSqlParameter("@Reason", SqlDbType.NVarChar, -1, ParameterDirection.Input, reason);
            sph.DefineSqlParameter("@AvsCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, avsCode);
            sph.DefineSqlParameter("@CcvCode", SqlDbType.NChar, 1, ParameterDirection.Input, ccvCode);
            sph.DefineSqlParameter("@CavCode", SqlDbType.NChar, 1, ParameterDirection.Input, cavCode);
            sph.DefineSqlParameter("@TransactionId", SqlDbType.NVarChar, 50, ParameterDirection.Input, transactionId);
            sph.DefineSqlParameter("@TransactionType", SqlDbType.NVarChar, 50, ParameterDirection.Input, transactionType);
            sph.DefineSqlParameter("@Method", SqlDbType.NVarChar, 20, ParameterDirection.Input, method);
            sph.DefineSqlParameter("@AuthCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, authCode);
            sph.DefineSqlParameter("@Amount", SqlDbType.Decimal, ParameterDirection.Input, amount);
            sph.DefineSqlParameter("@Tax", SqlDbType.Decimal, ParameterDirection.Input, tax);
            sph.DefineSqlParameter("@Duty", SqlDbType.Decimal, ParameterDirection.Input, duty);
            sph.DefineSqlParameter("@Freight", SqlDbType.Decimal, ParameterDirection.Input, freight);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
示例#34
0
        public static bool ForumThreadUpdate(
            int threadId,
            int forumId,
            string threadSubject,
            int sortOrder,
            bool isLocked,
            bool isQuestion,
            bool includeInSiteMap,
            bool setNoIndexMeta,
            string pageTitleOverride,
            int modStatus,
            string threadType,
            Guid assignedTo,
            Guid lockedBy,
            string lockedReason,
            DateTime lockedUtc)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ForumThreads_Update", 15);

            sph.DefineSqlParameter("@ThreadID", SqlDbType.Int, ParameterDirection.Input, threadId);
            sph.DefineSqlParameter("@ForumID", SqlDbType.Int, ParameterDirection.Input, forumId);
            sph.DefineSqlParameter("@ThreadSubject", SqlDbType.NVarChar, 255, ParameterDirection.Input, threadSubject);
            sph.DefineSqlParameter("@SortOrder", SqlDbType.Int, ParameterDirection.Input, sortOrder);
            sph.DefineSqlParameter("@IsLocked", SqlDbType.Bit, ParameterDirection.Input, isLocked);

            sph.DefineSqlParameter("@IsQuestion", SqlDbType.Bit, ParameterDirection.Input, isQuestion);
            sph.DefineSqlParameter("@IncludeInSiteMap", SqlDbType.Bit, ParameterDirection.Input, includeInSiteMap);
            sph.DefineSqlParameter("@SetNoIndexMeta", SqlDbType.Bit, ParameterDirection.Input, setNoIndexMeta);
            sph.DefineSqlParameter("@PTitleOverride", SqlDbType.NVarChar, 255, ParameterDirection.Input, pageTitleOverride);
            sph.DefineSqlParameter("@ModStatus", SqlDbType.Int, ParameterDirection.Input, modStatus);
            sph.DefineSqlParameter("@ThreadType", SqlDbType.NVarChar, 100, ParameterDirection.Input, threadType);
            sph.DefineSqlParameter("@AssignedTo", SqlDbType.UniqueIdentifier, ParameterDirection.Input, assignedTo);
            sph.DefineSqlParameter("@LockedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lockedBy);
            sph.DefineSqlParameter("@LockedReason", SqlDbType.NVarChar, 255, ParameterDirection.Input, lockedReason);

            if (lockedUtc < DateTime.MaxValue)
            {
                sph.DefineSqlParameter("@LockedUtc", SqlDbType.DateTime, ParameterDirection.Input, lockedUtc);
            }
            else
            {
                sph.DefineSqlParameter("@LockedUtc", SqlDbType.DateTime, ParameterDirection.Input, DBNull.Value);
            }

            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
示例#35
0
        public static decimal GetAllTimeRevenueByModule(Guid moduleGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_CommerceReport_GetAllTimeRevenueByModule", 1);

            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);

            decimal result = 0;

            try
            {
                result = Convert.ToDecimal(sph.ExecuteScalar(), CultureInfo.InvariantCulture);
            }
            catch (InvalidCastException) { }

            return(result);
        }
示例#36
0
        public static int RoleCreate(
            Guid roleGuid,
            Guid siteGuid,
            int siteId,
            string roleName)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Roles_Insert", 4);

            sph.DefineSqlParameter("@RoleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, roleGuid);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
            sph.DefineSqlParameter("@RoleName", SqlDbType.NVarChar, 50, ParameterDirection.Input, roleName);
            int newID = Convert.ToInt32(sph.ExecuteScalar());

            return(newID);
        }
示例#37
0
        /// <summary>
        /// Updates a row in the mp_GeoCountry table. Returns true if row updated.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="name"> name </param>
        /// <param name="iSOCode2"> iSOCode2 </param>
        /// <param name="iSOCode3"> iSOCode3 </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid guid,
            string name,
            string iSOCode2,
            string iSOCode3)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_GeoCountry_Update", 4);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name);
            sph.DefineSqlParameter("@ISOCode2", SqlDbType.NChar, 2, ParameterDirection.Input, iSOCode2);
            sph.DefineSqlParameter("@ISOCode3", SqlDbType.NChar, 3, ParameterDirection.Input, iSOCode3);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
示例#38
0
        public static bool UpdateRelatedSitesWindowsLive(
            int siteId,
            string windowsLiveAppId,
            string windowsLiveKey
            )
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Sites_SyncRelatedSitesWinLive", 3);

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

            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
示例#39
0
        /// <summary>
        /// Updates a row in the mp_BannedIPAddresses table. Returns true if row updated.
        /// </summary>
        /// <param name="rowID"> rowID </param>
        /// <param name="bannedIP"> bannedIP </param>
        /// <param name="bannedUTC"> bannedUTC </param>
        /// <param name="bannedReason"> bannedReason </param>
        /// <returns>bool</returns>
        public static bool Update(
            int rowId,
            string bannedIP,
            DateTime bannedUtc,
            string bannedReason)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_BannedIPAddresses_Update", 4);

            sph.DefineSqlParameter("@RowID", SqlDbType.Int, ParameterDirection.Input, rowId);
            sph.DefineSqlParameter("@BannedIP", SqlDbType.NVarChar, 50, ParameterDirection.Input, bannedIP);
            sph.DefineSqlParameter("@BannedUTC", SqlDbType.DateTime, ParameterDirection.Input, bannedUtc);
            sph.DefineSqlParameter("@BannedReason", SqlDbType.NVarChar, 255, ParameterDirection.Input, bannedReason);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
示例#40
0
        /// <summary>
        /// Updates a row in the mp_SavedQuery table. Returns true if row updated.
        /// </summary>
        /// <param name="id"> id </param>
        /// <param name="statement"> statement </param>
        /// <param name="lastModUtc"> lastModUtc </param>
        /// <param name="lastModBy"> lastModBy </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid id,
            string statement,
            DateTime lastModUtc,
            Guid lastModBy)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SavedQuery_Update", 4);

            sph.DefineSqlParameter("@Id", SqlDbType.UniqueIdentifier, ParameterDirection.Input, id);
            sph.DefineSqlParameter("@Statement", SqlDbType.NVarChar, -1, ParameterDirection.Input, statement);
            sph.DefineSqlParameter("@LastModUtc", SqlDbType.DateTime, ParameterDirection.Input, lastModUtc);
            sph.DefineSqlParameter("@LastModBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModBy);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
示例#41
0
        public static Guid GetDraftSubmitter(Guid contentWorkflowGuid)
        {
            Guid result            = Guid.Empty;
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_ContentWorkflowAuditHistory_GetDraftSubmitter", 1);

            sph.DefineSqlParameter("@ContentWorkflowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, contentWorkflowGuid);
            using (IDataReader reader = sph.ExecuteReader())
            {
                if (reader.Read())
                {
                    result = new Guid(reader[0].ToString());
                }
            }

            return(result);
        }
示例#42
0
        public static bool UpdateRelatedSitesProperty(
            int siteId,
            string keyName,
            string keyValue)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SiteSettingsEx_UpdateRelated", 3);

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


            int rowsAffected = sph.ExecuteNonQuery();

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

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

            return(rowsAffected > 0);
        }
示例#44
0
        public static bool UpdateModuleSetting(
            Guid moduleGuid,
            int moduleId,
            string settingName,
            string settingValue)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ModuleSettings_Update", 4);

            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@SettingName", SqlDbType.NVarChar, 50, ParameterDirection.Input, settingName);
            sph.DefineSqlParameter("@SettingValue", SqlDbType.NVarChar, -1, ParameterDirection.Input, settingValue);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
示例#45
0
        public static void SavePersonalizationBlob(
            int siteId,
            String path,
            Guid userGuid,
            byte[] dataBlob,
            DateTime lastUpdateTime)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SitePersonalizationPerUser_SetPageSettings", 5);

            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);
            sph.DefineSqlParameter("@PageSettings", SqlDbType.VarBinary, -1, ParameterDirection.Input, dataBlob);
            sph.DefineSqlParameter("@LastUpdate", SqlDbType.DateTime, ParameterDirection.Input, lastUpdateTime);
            sph.ExecuteNonQuery();
        }
示例#46
0
        /// <summary>
        /// Updates a row in the mp_LetterHtmlTemplate table. Returns true if row updated.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="title"> title </param>
        /// <param name="html"> html </param>
        /// <param name="lastModUTC"> lastModUTC </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid guid,
            string title,
            string html,
            DateTime lastModUTC)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_LetterHtmlTemplate_Update", 4);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title);
            sph.DefineSqlParameter("@Html", SqlDbType.NVarChar, -1, ParameterDirection.Input, html);
            sph.DefineSqlParameter("@LastModUTC", SqlDbType.DateTime, ParameterDirection.Input, lastModUTC);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
示例#47
0
        /// <summary>
        /// Updates a row in the mp_Language table. Returns true if row updated.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="name"> name </param>
        /// <param name="code"> code </param>
        /// <param name="sort"> sort </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid guid,
            string name,
            string code,
            int sort)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Language_Update", 4);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name);
            sph.DefineSqlParameter("@Code", SqlDbType.NChar, 2, ParameterDirection.Input, code);
            sph.DefineSqlParameter("@Sort", SqlDbType.Int, ParameterDirection.Input, sort);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
示例#48
0
        //public static String DBPlatform()
        //{
        //    return "MSSQL";
        //}

        ///// <summary>
        ///// Gets the connection string.
        ///// </summary>
        ///// <returns></returns>
        //private static string GetConnectionString()
        //{
        //    return ConfigurationManager.AppSettings["MSSQLConnectionString"];

        //}


        /// <summary>
        /// Inserts a row in the mp_GeoZone table. Returns rows affected count.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="countryGuid"> countryGuid </param>
        /// <param name="name"> name </param>
        /// <param name="code"> code </param>
        /// <returns>int</returns>
        public static int Create(
            Guid guid,
            Guid countryGuid,
            string name,
            string code)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_GeoZone_Insert", 4);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@CountryGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, countryGuid);
            sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name);
            sph.DefineSqlParameter("@Code", SqlDbType.NVarChar, 255, ParameterDirection.Input, code);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected);
        }
示例#49
0
        private static bool UpdateStatus(
            Guid guid,
            DateTime lastStatusUpdateUTC,
            double completeRatio,
            string status)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_TaskQueue_UpdateStatus", 4);

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

            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
示例#50
0
        public static bool MoveOrder(
            Guid orderGuid,
            Guid newUserGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_CommerceReport_MoveOrder", 2);

            sph.DefineSqlParameter("@OrderGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, orderGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, newUserGuid);
            int rowsAffected = sph.ExecuteNonQuery();

            sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_CommerceReportOrders_MoveOrder", 2);
            sph.DefineSqlParameter("@OrderGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, orderGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, newUserGuid);
            sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
示例#51
0
        ///// <summary>
        ///// Gets the connection string.
        ///// </summary>
        ///// <returns></returns>
        //private static string GetConnectionString()
        //{
        //    return ConfigurationManager.AppSettings["MSSQLConnectionString"];

        //}

        /// <summary>
        /// Inserts a row in the mp_CommerceReport table. Returns rows affected count.
        /// </summary>
        /// <param name="rowGuid"> rowGuid </param>
        /// <param name="siteGuid"> siteGuid </param>
        /// <param name="userGuid"> userGuid </param>
        /// <param name="featureGuid"> featureGuid </param>
        /// <param name="moduleGuid"> moduleGuid </param>
        /// <param name="moduleTitle"> moduleTitle </param>
        /// <param name="orderGuid"> orderGuid </param>
        /// <param name="itemGuid"> itemGuid </param>
        /// <param name="itemName"> itemName </param>
        /// <param name="quantity"> quantity </param>
        /// <param name="price"> price </param>
        /// <param name="subTotal"> subTotal </param>
        /// <param name="orderDateUtc"> orderDateUtc </param>
        /// <param name="paymentMethod"> paymentMthod </param>
        /// <param name="iPAddress"> iPAddress </param>
        /// <param name="adminOrderLink"> adminOrderLink </param>
        /// <param name="userOrderLink"> userOrderLink </param>
        /// <param name="rowCreatedUtc"> rowCreatedUtc </param>
        /// <returns>int</returns>
        public static int Create(
            Guid rowGuid,
            Guid siteGuid,
            Guid userGuid,
            Guid featureGuid,
            Guid moduleGuid,
            string moduleTitle,
            Guid orderGuid,
            Guid itemGuid,
            string itemName,
            int quantity,
            decimal price,
            decimal subTotal,
            DateTime orderDateUtc,
            string paymentMethod,
            string iPAddress,
            string adminOrderLink,
            string userOrderLink,
            DateTime rowCreatedUtc,
            bool includeInAggregate)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_CommerceReport_Insert", 19);

            sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid);
            sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
            sph.DefineSqlParameter("@FeatureGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, featureGuid);
            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
            sph.DefineSqlParameter("@ModuleTitle", SqlDbType.NVarChar, 255, ParameterDirection.Input, moduleTitle);
            sph.DefineSqlParameter("@OrderGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, orderGuid);
            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
            sph.DefineSqlParameter("@ItemName", SqlDbType.NVarChar, 255, ParameterDirection.Input, itemName);
            sph.DefineSqlParameter("@Quantity", SqlDbType.Int, ParameterDirection.Input, quantity);
            sph.DefineSqlParameter("@Price", SqlDbType.Decimal, ParameterDirection.Input, price);
            sph.DefineSqlParameter("@SubTotal", SqlDbType.Decimal, ParameterDirection.Input, subTotal);
            sph.DefineSqlParameter("@OrderDateUtc", SqlDbType.DateTime, ParameterDirection.Input, orderDateUtc);
            sph.DefineSqlParameter("@PaymentMethod", SqlDbType.NVarChar, 50, ParameterDirection.Input, paymentMethod);
            sph.DefineSqlParameter("@IPAddress", SqlDbType.NVarChar, 250, ParameterDirection.Input, iPAddress);
            sph.DefineSqlParameter("@AdminOrderLink", SqlDbType.NVarChar, 255, ParameterDirection.Input, adminOrderLink);
            sph.DefineSqlParameter("@UserOrderLink", SqlDbType.NVarChar, 255, ParameterDirection.Input, userOrderLink);
            sph.DefineSqlParameter("@RowCreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, rowCreatedUtc);
            sph.DefineSqlParameter("@IncludeInAggregate", SqlDbType.Bit, ParameterDirection.Input, includeInAggregate);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected);
        }
示例#52
0
        public static bool UpdateModule(
            int moduleId,
            int moduleDefId,
            string moduleTitle,
            string viewRoles,
            string authorizedEditRoles,
            string draftEditRoles,
            string draftApprovalRoles,
            int cacheTime,
            bool showTitle,
            int editUserId,
            bool availableForMyPage,
            bool allowMultipleInstancesOnMyPage,
            String icon,
            bool hideFromAuthenticated,
            bool hideFromUnauthenticated,
            bool includeInSearch,
            bool isGlobal,
            string headElement,
            int publishMode)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Modules_Update", 19);

            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@ModuleDefID", SqlDbType.Int, ParameterDirection.Input, moduleDefId);
            sph.DefineSqlParameter("@ModuleTitle", SqlDbType.NVarChar, ParameterDirection.Input, moduleTitle);
            sph.DefineSqlParameter("@AuthorizedEditRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, authorizedEditRoles);
            sph.DefineSqlParameter("@DraftEditRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, draftEditRoles);
            sph.DefineSqlParameter("@DraftApprovalRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, draftApprovalRoles); //JOE DAVIS
            sph.DefineSqlParameter("@CacheTime", SqlDbType.Int, ParameterDirection.Input, cacheTime);
            sph.DefineSqlParameter("@ShowTitle", SqlDbType.Bit, ParameterDirection.Input, showTitle);
            sph.DefineSqlParameter("@EditUserID", SqlDbType.Int, ParameterDirection.Input, editUserId);
            sph.DefineSqlParameter("@AvailableForMyPage", SqlDbType.Bit, ParameterDirection.Input, availableForMyPage);
            sph.DefineSqlParameter("@AllowMultipleInstancesOnMyPage", SqlDbType.Bit, ParameterDirection.Input, allowMultipleInstancesOnMyPage);
            sph.DefineSqlParameter("@Icon", SqlDbType.NVarChar, 255, ParameterDirection.Input, icon);
            sph.DefineSqlParameter("@HideFromAuth", SqlDbType.Bit, ParameterDirection.Input, hideFromAuthenticated);
            sph.DefineSqlParameter("@HideFromUnAuth", SqlDbType.Bit, ParameterDirection.Input, hideFromUnauthenticated);
            sph.DefineSqlParameter("@ViewRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, viewRoles);
            sph.DefineSqlParameter("@IncludeInSearch", SqlDbType.Bit, ParameterDirection.Input, includeInSearch);
            sph.DefineSqlParameter("@IsGlobal", SqlDbType.Bit, ParameterDirection.Input, isGlobal);
            sph.DefineSqlParameter("@HeadElement", SqlDbType.NVarChar, 25, ParameterDirection.Input, headElement);
            sph.DefineSqlParameter("@PublishMode", SqlDbType.Int, ParameterDirection.Input, publishMode);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
示例#53
0
        public static bool UpdateSharedFileFolder(
            int folderId,
            int moduleId,
            string folderName,
            int parentId,
            Guid parentGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SharedFileFolders_Update", 5);

            sph.DefineSqlParameter("@FolderID", SqlDbType.Int, ParameterDirection.Input, folderId);
            sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
            sph.DefineSqlParameter("@FolderName", SqlDbType.NVarChar, 255, ParameterDirection.Input, folderName);
            sph.DefineSqlParameter("@ParentID", SqlDbType.Int, ParameterDirection.Input, parentId);
            sph.DefineSqlParameter("@ParentGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, parentGuid);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
示例#54
0
        public static bool AddUser(
            int roleId,
            int userId,
            Guid roleGuid,
            Guid userGuid
            )
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_UserRoles_Insert", 4);

            sph.DefineSqlParameter("@RoleID", SqlDbType.Int, ParameterDirection.Input, roleId);
            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
            sph.DefineSqlParameter("@RoleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, roleGuid);
            sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);

            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > -1);
        }
示例#55
0
        public static bool Update(
            Guid guid,
            string title,
            string description,
            DateTime lastModified,
            DateTime created)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_TaxClass_Update", 5);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title);
            sph.DefineSqlParameter("@Description", SqlDbType.NText, ParameterDirection.Input, description);
            sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified);
            sph.DefineSqlParameter("@Created", SqlDbType.DateTime, ParameterDirection.Input, created);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
示例#56
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);
        }
示例#57
0
        /// <summary>
        /// Gets an IDataReader with one row from the mp_RedirectList table.
        /// </summary>
        public static int GetCount(int siteId, string searchTerm = "")
        {
            var useSearch = !string.IsNullOrWhiteSpace(searchTerm);

            if (useSearch)
            {
                SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_RedirectList_GetSearchCount", 1);
                sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
                sph.DefineSqlParameter("@SearchTerm", SqlDbType.NVarChar, 255, ParameterDirection.Input, searchTerm);
                return(Convert.ToInt32(sph.ExecuteScalar()));
            }
            else
            {
                SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_RedirectList_GetCount", 1);
                sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
                return(Convert.ToInt32(sph.ExecuteScalar()));
            }
        }
示例#58
0
        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);
        }
示例#59
0
        /// <summary>
        /// Updates a row in the mp_Tag table. Returns true if row updated.
        /// </summary>
        /// <param name="guid"> guid </param>
        /// <param name="tag"> tag </param>
        /// <param name="modifiedUtc"> modifiedUtc </param>
        /// <param name="modifiedBy"> modifiedBy </param>
        /// <returns>bool</returns>
        public static bool Update(
            Guid guid,
            Guid vocabularyGuid,
            string tag,
            DateTime modifiedUtc,
            Guid modifiedBy)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Tag_Update", 5);

            sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
            sph.DefineSqlParameter("@VocabularyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, vocabularyGuid);
            sph.DefineSqlParameter("@Tag", SqlDbType.NVarChar, 255, ParameterDirection.Input, tag);
            sph.DefineSqlParameter("@ModifiedUtc", SqlDbType.DateTime, ParameterDirection.Input, modifiedUtc);
            sph.DefineSqlParameter("@ModifiedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, modifiedBy);
            int rowsAffected = sph.ExecuteNonQuery();

            return(rowsAffected > 0);
        }
示例#60
0
        /// <summary>
        /// Gets the most recent cache time for the module
        /// </summary>
        public static DateTime GetLastCacheTime(Guid moduleGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_RssFeedEntries_GetLastCacheTime", 1);

            sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);

            DateTime result = DateTime.UtcNow.AddDays(-1);

            using (IDataReader reader = sph.ExecuteReader())
            {
                if (reader.Read())
                {
                    result = Convert.ToDateTime(reader["CachedTimeUtc"]);
                }
            }

            return(result);
        }