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; }
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; }
/// <summary> /// Inserts a row in the mp_LetterSubscribe table. Returns rows affected count. /// </summary> /// <param name="guid"> guid </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="letterInfoGuid"> letterInfoGuid </param> /// <param name="userGuid"> userGuid </param> /// <param name="email"> email </param> /// <param name="isVerified"> isVerified </param> /// <param name="verifyGuid"> verifyGuid </param> /// <param name="beginUtc"> beginUtc </param> /// <param name="useHtml"> useHtml </param> /// <returns>int</returns> public static int Create( Guid guid, Guid siteGuid, Guid letterInfoGuid, Guid userGuid, string email, bool isVerified, Guid verifyGuid, DateTime beginUtc, bool useHtml, string ipAddress) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_LetterSubscribe_Insert", 10); sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid); sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid); sph.DefineSqlParameter("@LetterInfoGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterInfoGuid); sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid); sph.DefineSqlParameter("@Email", SqlDbType.NVarChar, 100, ParameterDirection.Input, email); sph.DefineSqlParameter("@IsVerified", SqlDbType.Bit, ParameterDirection.Input, isVerified); sph.DefineSqlParameter("@VerifyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, verifyGuid); sph.DefineSqlParameter("@BeginUtc", SqlDbType.DateTime, ParameterDirection.Input, beginUtc); sph.DefineSqlParameter("@UseHtml", SqlDbType.Bit, ParameterDirection.Input, useHtml); sph.DefineSqlParameter("@IpAddress", SqlDbType.NVarChar, 100, ParameterDirection.Input, ipAddress); int rowsAffected = sph.ExecuteNonQuery(); return rowsAffected; }
/// <summary> /// Deletes from the mp_LetterSendLog table for the letterGuid. Returns true if row deleted. /// </summary> /// <param name="letterGuid"> letterGuid </param> /// <returns>bool</returns> public static bool DeleteByLetter(Guid letterGuid) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_LetterSendLog_DeleteByLetter", 1); sph.DefineSqlParameter("@LetterGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterGuid); int rowsAffected = sph.ExecuteNonQuery(); return (rowsAffected > 0); }
/// <summary> /// Updates the TrackOrder values for the tracks that remain for the PlayerID by incrementing any Tracks that have a TrackOrder value /// greater than the provided trackOrder. /// </summary> /// <param name="playerID">The ID of the Player.</param> /// <param name="trackOrder">The TrackOrder value.</param> /// <returns>The number of rows affected by the update.</returns> public static int AdjustTrackOrdersForDelete(int playerId, int trackOrder) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_MediaTrack_AdjustTrackOrderForDelete", 2); sph.DefineSqlParameter("@PlayerID", SqlDbType.Int, ParameterDirection.Input, playerId); sph.DefineSqlParameter("@TrackOrder", SqlDbType.Int, ParameterDirection.Input, trackOrder); return sph.ExecuteNonQuery(); }
public static int Add( Guid guid, Guid storeGuid, Guid orderGuid, Guid userGuid, Guid productGuid, Guid fullfillTermsGuid, int downloadsAllowed, int expireAfterDays, bool countAfterDownload, DateTime purchaseTime, int downloadedCount) { SqlParameterHelper sph = new SqlParameterHelper(WebStoreConnectionString.GetWriteConnectionString(), "ws_FullfillDownloadTicket_Insert", 11); sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid); sph.DefineSqlParameter("@StoreGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, storeGuid); sph.DefineSqlParameter("@OrderGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, orderGuid); sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid); sph.DefineSqlParameter("@ProductGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, productGuid); sph.DefineSqlParameter("@FullfillTermsGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, fullfillTermsGuid); 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("@PurchaseTime", SqlDbType.DateTime, ParameterDirection.Input, purchaseTime); sph.DefineSqlParameter("@DownloadedCount", SqlDbType.Int, ParameterDirection.Input, downloadedCount); int rowsAffected = sph.ExecuteNonQuery(); return rowsAffected; }
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); }
/// <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; }
/// <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); }
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; }
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; }
/// <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); }
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; }
public static bool DeleteByModule(Guid moduleGuid) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ContactFormMessage_DeleteByModule", 1); sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid); int rowsAffected = sph.ExecuteNonQuery(); return (rowsAffected > 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); }
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; }
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); }
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); }
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); }
/// <summary> /// Inserts a row in the mp_ContactFormMessage table. Returns rows affected count. /// </summary> /// <param name="rowGuid"> rowGuid </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="moduleGuid"> moduleGuid </param> /// <param name="email"> email </param> /// <param name="url"> url </param> /// <param name="subject"> subject </param> /// <param name="message"> message </param> /// <param name="createdUtc"> createdUtc </param> /// <param name="createdFromIpAddress"> createdFromIpAddress </param> /// <param name="userGuid"> userGuid </param> /// <returns>int</returns> public static int Create( Guid rowGuid, Guid siteGuid, Guid moduleGuid, string email, string url, string subject, string message, DateTime createdUtc, string createdFromIpAddress, Guid userGuid) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ContactFormMessage_Insert", 10); 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("@Email", SqlDbType.NVarChar, 100, ParameterDirection.Input, email); sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, 255, ParameterDirection.Input, url); sph.DefineSqlParameter("@Subject", SqlDbType.NVarChar, 255, ParameterDirection.Input, subject); sph.DefineSqlParameter("@Message", SqlDbType.NVarChar, -1, ParameterDirection.Input, message); sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc); sph.DefineSqlParameter("@CreatedFromIpAddress", SqlDbType.NVarChar, 255, ParameterDirection.Input, createdFromIpAddress); sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid); int rowsAffected = sph.ExecuteNonQuery(); return rowsAffected; }
/// <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); }
/// <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; }
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); }
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); }
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); }
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); }
public static bool AccountClearLockout(Guid userGuid) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Users_AccountClearLockout", 1); sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid); int rowsAffected = sph.ExecuteNonQuery(); return (rowsAffected > -1); }
/// <summary> /// Inserts a row in the mp_TaxRateHistory table. Returns rows affected count. /// </summary> /// <param name="guid"> guid </param> /// <param name="taxRateGuid"> taxRateGuid </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="geoZoneGuid"> geoZoneGuid </param> /// <param name="taxClassGuid"> taxClassGuid </param> /// <param name="priority"> priority </param> /// <param name="rate"> rate </param> /// <param name="description"> description </param> /// <param name="created"> created </param> /// <param name="createdBy"> createdBy </param> /// <param name="lastModified"> lastModified </param> /// <param name="modifiedBy"> modifiedBy </param> /// <param name="logTime"> logTime </param> /// <returns>int</returns> public static int AddHistory( Guid guid, Guid taxRateGuid, Guid siteGuid, Guid geoZoneGuid, Guid taxClassGuid, int priority, decimal rate, string description, DateTime created, Guid createdBy, DateTime lastModified, Guid modifiedBy, DateTime logTime) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_TaxRateHistory_Insert", 13); sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid); sph.DefineSqlParameter("@TaxRateGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, taxRateGuid); sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid); sph.DefineSqlParameter("@GeoZoneGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, geoZoneGuid); sph.DefineSqlParameter("@TaxClassGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, taxClassGuid); sph.DefineSqlParameter("@Priority", SqlDbType.Int, ParameterDirection.Input, priority); sph.DefineSqlParameter("@Rate", SqlDbType.Decimal, ParameterDirection.Input, rate); sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, 255, ParameterDirection.Input, description); sph.DefineSqlParameter("@Created", SqlDbType.DateTime, ParameterDirection.Input, created); sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy); sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified); sph.DefineSqlParameter("@ModifiedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, modifiedBy); sph.DefineSqlParameter("@LogTime", SqlDbType.DateTime, ParameterDirection.Input, logTime); int rowsAffected = sph.ExecuteNonQuery(); return rowsAffected; }
public static bool DeleteUserPage(Guid userPageId) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_UserPages_Delete", 1); sph.DefineSqlParameter("@UserPageID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userPageId); int rowsAffected = sph.ExecuteNonQuery(); return (rowsAffected > -1); }
/// <summary> /// Updates a row in the mp_FileAttachment table. Returns true if row updated. /// </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>bool</returns> public static bool Update( Guid rowGuid, string serverFileName, string fileName, string contentTitle, long contentLength, string contentType) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_FileAttachment_Update", 6); sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid); 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); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > 0); }
/// <summary> /// Updates a row in the mp_UserLocation table. Returns true if row updated. /// </summary> /// <param name="rowID"> rowID </param> /// <param name="userGuid"> userGuid </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="iPAddress"> iPAddress </param> /// <param name="iPAddressLong"> iPAddressLong </param> /// <param name="hostname"> hostname </param> /// <param name="longitude"> longitude </param> /// <param name="latitude"> latitude </param> /// <param name="iSP"> iSP </param> /// <param name="continent"> continent </param> /// <param name="country"> country </param> /// <param name="region"> region </param> /// <param name="city"> city </param> /// <param name="timeZone"> timeZone </param> /// <param name="captureCount"> captureCount </param> /// <param name="lastCaptureUTC"> lastCaptureUTC </param> /// <returns>bool</returns> public static bool Update( Guid rowID, Guid userGuid, Guid siteGuid, string iPAddress, long iPAddressLong, string hostname, double longitude, double latitude, string iSP, string continent, string country, string region, string city, string timeZone, int captureCount, DateTime lastCaptureUTC) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_UserLocation_Update", 16); sph.DefineSqlParameter("@RowID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowID); sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid); sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid); sph.DefineSqlParameter("@IPAddress", SqlDbType.NVarChar, 50, ParameterDirection.Input, iPAddress); sph.DefineSqlParameter("@IPAddressLong", SqlDbType.BigInt, ParameterDirection.Input, iPAddressLong); sph.DefineSqlParameter("@Hostname", SqlDbType.NVarChar, 255, ParameterDirection.Input, hostname); sph.DefineSqlParameter("@Longitude", SqlDbType.Float, ParameterDirection.Input, longitude); sph.DefineSqlParameter("@Latitude", SqlDbType.Float, ParameterDirection.Input, latitude); sph.DefineSqlParameter("@ISP", SqlDbType.NVarChar, 255, ParameterDirection.Input, iSP); sph.DefineSqlParameter("@Continent", SqlDbType.NVarChar, 255, ParameterDirection.Input, continent); sph.DefineSqlParameter("@Country", SqlDbType.NVarChar, 255, ParameterDirection.Input, country); sph.DefineSqlParameter("@Region", SqlDbType.NVarChar, 255, ParameterDirection.Input, region); sph.DefineSqlParameter("@City", SqlDbType.NVarChar, 255, ParameterDirection.Input, city); sph.DefineSqlParameter("@TimeZone", SqlDbType.NVarChar, 255, ParameterDirection.Input, timeZone); sph.DefineSqlParameter("@CaptureCount", SqlDbType.Int, ParameterDirection.Input, captureCount); sph.DefineSqlParameter("@LastCaptureUTC", SqlDbType.DateTime, ParameterDirection.Input, lastCaptureUTC); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > 0); }
/// <summary> /// Inserts a row in the mp_ContentMeta table. Returns rows affected count. /// </summary> /// <returns>int</returns> public static int Create( Guid guid, Guid siteGuid, Guid moduleGuid, Guid contentGuid, string name, string nameProperty, string scheme, string langCode, string dir, string metaContent, string contentProperty, int sortRank, DateTime createdUtc, Guid createdBy) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ContentMeta_Insert", 16); 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("@NameProperty", SqlDbType.NVarChar, 255, ParameterDirection.Input, nameProperty); 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("@ContentProperty", SqlDbType.NVarChar, 255, ParameterDirection.Input, contentProperty); 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); }
/// <summary> /// Updates a row in the mp_LetterSendLog table. Returns true if row updated. /// </summary> /// <param name="rowID"> rowID </param> /// <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>bool</returns> public static bool Update( int rowId, Guid letterGuid, Guid userGuid, string emailAddress, DateTime uTC, bool errorOccurred, string errorMessage) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_LetterSendLog_Update", 7); sph.DefineSqlParameter("@RowID", SqlDbType.Int, ParameterDirection.Input, rowId); sph.DefineSqlParameter("@LetterGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterGuid); sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid); 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 rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > 0); }
public static int AddUserPage( Guid userPageId, Guid siteGuid, int siteId, Guid userGuid, string pageName, String pagePath, int pageOrder) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_UserPages_Insert", 7); sph.DefineSqlParameter("@UserPageID", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userPageId); sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid); sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId); sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid); sph.DefineSqlParameter("@PageName", SqlDbType.NVarChar, ParameterDirection.Input, pageName); sph.DefineSqlParameter("@PagePath", SqlDbType.NVarChar, ParameterDirection.Input, pagePath); sph.DefineSqlParameter("@PageOrder", SqlDbType.Int, ParameterDirection.Input, pageOrder); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected); }
/// <summary> /// Inserts a row in the mp_RedirectList table. Returns rows affected count. /// </summary> /// <param name="rowGuid"> rowGuid </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="siteID"> siteID </param> /// <param name="oldUrl"> oldUrl </param> /// <param name="newUrl"> newUrl </param> /// <param name="createdUtc"> createdUtc </param> /// <param name="expireUtc"> expireUtc </param> /// <returns>int</returns> public static int Create( Guid rowGuid, Guid siteGuid, int siteID, string oldUrl, string newUrl, DateTime createdUtc, DateTime expireUtc) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_RedirectList_Insert", 7); sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid); sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid); sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteID); sph.DefineSqlParameter("@OldUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, oldUrl); sph.DefineSqlParameter("@NewUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, newUrl); sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc); sph.DefineSqlParameter("@ExpireUtc", SqlDbType.DateTime, ParameterDirection.Input, expireUtc); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected); }
///// <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_CategoryItem table. Returns rows affected count. /// </summary> /// <param name="guid"> guid </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="featureGuid"> featureGuid </param> /// <param name="moduleGuid"> moduleGuid </param> /// <param name="itemGuid"> itemGuid </param> /// <param name="categoryGuid"> categoryGuid </param> /// <param name="extraGuid"> extraGuid </param> /// <returns>int</returns> public static int Create( Guid guid, Guid siteGuid, Guid featureGuid, Guid moduleGuid, Guid itemGuid, Guid categoryGuid, Guid extraGuid) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_CategoryItem_Insert", 7); sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid); sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid); sph.DefineSqlParameter("@FeatureGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, featureGuid); sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid); sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid); sph.DefineSqlParameter("@CategoryGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, categoryGuid); sph.DefineSqlParameter("@ExtraGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, extraGuid); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected); }
public static bool UpdateSharedFileFolder( int folderId, int moduleId, string folderName, int parentId, Guid parentGuid, string viewRoles ) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SharedFileFolders_Update", 6); 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); sph.DefineSqlParameter("@ViewRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, viewRoles); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > -1); }
public static bool ForumPostUpdate( int postId, string subject, string post, int sortOrder, bool approved, Guid approvedBy, DateTime approvedUtc, bool notificationSent, int modStatus) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ForumPosts_Update", 9); sph.DefineSqlParameter("@PostID", SqlDbType.Int, ParameterDirection.Input, postId); sph.DefineSqlParameter("@Subject", SqlDbType.NVarChar, 255, ParameterDirection.Input, subject); sph.DefineSqlParameter("@Post", SqlDbType.NVarChar, -1, ParameterDirection.Input, post); sph.DefineSqlParameter("@SortOrder", SqlDbType.Int, ParameterDirection.Input, sortOrder); sph.DefineSqlParameter("@Approved", SqlDbType.Bit, ParameterDirection.Input, approved); sph.DefineSqlParameter("@ApprovedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, approvedBy); if (approvedUtc > DateTime.MinValue) { sph.DefineSqlParameter("@ApprovedUtc", SqlDbType.DateTime, ParameterDirection.Input, approvedUtc); } else { sph.DefineSqlParameter("@ApprovedUtc", SqlDbType.DateTime, ParameterDirection.Input, DBNull.Value); } sph.DefineSqlParameter("@NotificationSent", SqlDbType.Bit, ParameterDirection.Input, notificationSent); sph.DefineSqlParameter("@ModStatus", SqlDbType.Int, ParameterDirection.Input, modStatus); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > -1); }
///// <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_EmailSendLog table. Returns rows affected count. /// </summary> /// <param name="guid"> guid </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="moduleGuid"> moduleGuid </param> /// <param name="specialGuid1"> specialGuid1 </param> /// <param name="specialGuid2"> specialGuid2 </param> /// <param name="toAddress"> toAddress </param> /// <param name="ccAddress"> ccAddress </param> /// <param name="bccAddress"> bccAddress </param> /// <param name="subject"> subject </param> /// <param name="textBody"> textBody </param> /// <param name="htmlBody"> htmlBody </param> /// <param name="type"> type </param> /// <param name="sentUtc"> sentUtc </param> /// <param name="fromAddress"> fromAddress </param> /// <param name="replyTo"> replyTo </param> /// <param name="userGuid"> userGuid </param> /// <returns>int</returns> public static void Create( Guid guid, Guid siteGuid, Guid moduleGuid, Guid specialGuid1, Guid specialGuid2, string toAddress, string ccAddress, string bccAddress, string subject, string textBody, string htmlBody, string type, DateTime sentUtc, string fromAddress, string replyTo, Guid userGuid) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_EmailSendLog_Insert", 16); 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("@SpecialGuid1", SqlDbType.UniqueIdentifier, ParameterDirection.Input, specialGuid1); sph.DefineSqlParameter("@SpecialGuid2", SqlDbType.UniqueIdentifier, ParameterDirection.Input, specialGuid2); sph.DefineSqlParameter("@ToAddress", SqlDbType.NVarChar, 255, ParameterDirection.Input, toAddress); sph.DefineSqlParameter("@CcAddress", SqlDbType.NVarChar, 255, ParameterDirection.Input, ccAddress); sph.DefineSqlParameter("@BccAddress", SqlDbType.NVarChar, 255, ParameterDirection.Input, bccAddress); sph.DefineSqlParameter("@Subject", SqlDbType.NVarChar, 255, ParameterDirection.Input, subject); sph.DefineSqlParameter("@TextBody", SqlDbType.NVarChar, -1, ParameterDirection.Input, textBody); sph.DefineSqlParameter("@HtmlBody", SqlDbType.NVarChar, -1, ParameterDirection.Input, htmlBody); sph.DefineSqlParameter("@Type", SqlDbType.NVarChar, 50, ParameterDirection.Input, type); sph.DefineSqlParameter("@SentUtc", SqlDbType.DateTime, ParameterDirection.Input, sentUtc); sph.DefineSqlParameter("@FromAddress", SqlDbType.NVarChar, 100, ParameterDirection.Input, fromAddress); sph.DefineSqlParameter("@ReplyTo", SqlDbType.NVarChar, 100, ParameterDirection.Input, replyTo); sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid); sph.ExecuteNonQuery(); }
public static bool UpdateModuleDefinition( int moduleDefId, 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, string skinFileName) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ModuleDefinitions_Update", 15); sph.DefineSqlParameter("@ModuleDefID", SqlDbType.Int, ParameterDirection.Input, moduleDefId); 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("@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); sph.DefineSqlParameter("@SkinFileName", SqlDbType.NVarChar, 255, ParameterDirection.Input, skinFileName); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > -1); }
/// <summary> /// Inserts a row in the mp_EmailTemplate table. Returns rows affected count. /// </summary> /// <param name="guid"> guid </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="featureGuid"> featureGuid </param> /// <param name="moduleGuid"> moduleGuid </param> /// <param name="specialGuid1"> specialGuid1 </param> /// <param name="specialGuid2"> specialGuid2 </param> /// <param name="name"> name </param> /// <param name="subject"> subject </param> /// <param name="textBody"> textBody </param> /// <param name="htmlBody"> htmlBody </param> /// <param name="hasHtml"> hasHtml </param> /// <param name="isEditable"> isEditable </param> /// <param name="createdUtc"> createdUtc </param> /// <param name="lastModUtc"> lastModUtc </param> /// <param name="lastModBy"> lastModBy </param> /// <returns>int</returns> public static int Create( Guid guid, Guid siteGuid, Guid featureGuid, Guid moduleGuid, Guid specialGuid1, Guid specialGuid2, string name, string subject, string textBody, string htmlBody, bool hasHtml, bool isEditable, DateTime createdUtc, Guid lastModBy) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_EmailTemplate_Insert", 15); sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid); sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid); sph.DefineSqlParameter("@FeatureGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, featureGuid); sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid); sph.DefineSqlParameter("@SpecialGuid1", SqlDbType.UniqueIdentifier, ParameterDirection.Input, specialGuid1); sph.DefineSqlParameter("@SpecialGuid2", SqlDbType.UniqueIdentifier, ParameterDirection.Input, specialGuid2); sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name); sph.DefineSqlParameter("@Subject", SqlDbType.NVarChar, 255, ParameterDirection.Input, subject); sph.DefineSqlParameter("@TextBody", SqlDbType.NVarChar, -1, ParameterDirection.Input, textBody); sph.DefineSqlParameter("@HtmlBody", SqlDbType.NVarChar, -1, ParameterDirection.Input, htmlBody); sph.DefineSqlParameter("@HasHtml", SqlDbType.Bit, ParameterDirection.Input, hasHtml); sph.DefineSqlParameter("@IsEditable", SqlDbType.Bit, ParameterDirection.Input, isEditable); sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc); sph.DefineSqlParameter("@LastModUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc); sph.DefineSqlParameter("@LastModBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModBy); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected); }
/// <summary> /// Updates a row in the mp_CalendarEvents table. Returns true if row updated. /// </summary> /// <param name="itemID"> itemID </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="location"> location </param> /// <param name="ticketPrice"> ticketPrice </param> /// <param name="requiresTicket"> requiresTicket </param> /// <param name="lastModUtc"> lastModUtc </param> /// <param name="lastModUserGuid"> lastModUserGuid </param> /// <returns>bool</returns> public static bool UpdateCalendarEvent( int itemId, int moduleId, string title, string description, string imageName, DateTime eventDate, DateTime startTime, DateTime endTime, string location, bool requiresTicket, decimal ticketPrice, DateTime lastModUtc, Guid lastModUserGuid, bool showMap) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_CalendarEvents_Update", 14); sph.DefineSqlParameter("@ItemID", SqlDbType.Int, ParameterDirection.Input, itemId); 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("@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("@LastModUtc", SqlDbType.DateTime, ParameterDirection.Input, lastModUtc); sph.DefineSqlParameter("@LastModUserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModUserGuid); sph.DefineSqlParameter("@ShowMap", SqlDbType.Bit, ParameterDirection.Input, showMap); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > -1); }
public static bool UpdateSharedFile( int itemId, int moduleId, int uploadUserId, string friendlyName, string originalFileName, string serverFileName, int sizeInKB, DateTime uploadDate, int folderId, Guid folderGuid, Guid userGuid, string description, string viewRoles ) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_SharedFiles_Update", 13); sph.DefineSqlParameter("@ItemID", SqlDbType.Int, ParameterDirection.Input, itemId); 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("@FolderGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, folderGuid); sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid); sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description); sph.DefineSqlParameter("@ViewRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, viewRoles); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > -1); }
/// <summary> /// Inserts a row in the mp_TagItem table. Returns rows affected count. /// </summary> /// <param name="tagItemGuid"> tagItemGuid </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="featureGuid"> featureGuid </param> /// <param name="moduleGuid"> moduleGuid </param> /// <param name="relatedItemGuid"> relatedItemGuid </param> /// <param name="tagGuid"> tagGuid </param> /// <param name="extraGuid"> extraGuid </param> /// <param name="taggedBy"> taggedBy </param> /// <returns>int</returns> public static bool Create( Guid tagItemGuid, Guid siteGuid, Guid featureGuid, Guid moduleGuid, Guid relatedItemGuid, Guid tagGuid, Guid extraGuid, Guid taggedBy ) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_TagItem_Insert", 8); //change params in DB sph.DefineSqlParameter("@TagItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, tagItemGuid); sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid); sph.DefineSqlParameter("@FeatureGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, featureGuid); sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid); sph.DefineSqlParameter("@RelatedItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, relatedItemGuid); sph.DefineSqlParameter("@TagGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, tagGuid); sph.DefineSqlParameter("@ExtraGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, extraGuid); sph.DefineSqlParameter("@TaggedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, taggedBy); return(sph.ExecuteNonQuery() > 0); }
/// <summary> /// Updates a row in the mp_RssFeedEntries table. Returns true if row updated. /// </summary> /// <param name="moduleGuid"> moduleGuid </param> /// <param name="title"> title </param> /// <param name="author"> author </param> /// <param name="blogUrl"> blogUrl </param> /// <param name="description"> description </param> /// <param name="link"> link </param> /// <param name="entryHash"> entryHash </param> /// <param name="cachedTimeUtc"> cachedTimeUtc </param> /// <returns>bool</returns> public static bool UpdateEnry( Guid moduleGuid, string title, string author, string blogUrl, string description, string link, int entryHash, DateTime cachedTimeUtc) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_RssFeedEntries_Update", 8); sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid); sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title); sph.DefineSqlParameter("@Author", SqlDbType.NVarChar, 100, ParameterDirection.Input, author); sph.DefineSqlParameter("@BlogUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, blogUrl); sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description); sph.DefineSqlParameter("@Link", SqlDbType.NVarChar, 255, ParameterDirection.Input, link); sph.DefineSqlParameter("@EntryHash", SqlDbType.Int, ParameterDirection.Input, entryHash); sph.DefineSqlParameter("@CachedTimeUtc", SqlDbType.DateTime, ParameterDirection.Input, cachedTimeUtc); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > 0); }
public static bool PageModuleInsert( Guid pageGuid, Guid moduleGuid, int moduleId, int pageId, String paneName, int moduleOrder, DateTime publishBeginDate, DateTime publishEndDate) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_PageModules_Insert", 8); sph.DefineSqlParameter("@PageGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pageGuid); sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid); sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId); sph.DefineSqlParameter("@PageID", SqlDbType.Int, ParameterDirection.Input, pageId); sph.DefineSqlParameter("@PaneName", SqlDbType.NVarChar, 50, ParameterDirection.Input, paneName); sph.DefineSqlParameter("@ModuleOrder", SqlDbType.Int, ParameterDirection.Input, moduleOrder); sph.DefineSqlParameter("@PublishBeginDate", SqlDbType.DateTime, ParameterDirection.Input, publishBeginDate); sph.DefineSqlParameter("@PublishEndDate", SqlDbType.DateTime, ParameterDirection.Input, (publishEndDate == DateTime.MinValue) ? (object)DBNull.Value : (object)publishEndDate); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > -1); }
/// <summary> /// Inserts a row in the mp_Tag table. Returns rows affected count. /// </summary> /// <param name="guid"> guid </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="featureGuid"> featureGuid </param> /// <param name="moduleGuid"> moduleGuid </param> /// <param name="tag"> tag </param> /// <param name="createdUtc"> createdUtc </param> /// <param name="createdBy"> createdBy </param> /// <returns>int</returns> public static bool Create( Guid guid, Guid siteGuid, Guid featureGuid, Guid moduleGuid, string tagText, DateTime createdUtc, Guid createdBy, Guid vocabularyGuid ) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Tag_Insert", 8); sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid); sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid); sph.DefineSqlParameter("@FeatureGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, featureGuid); sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid); sph.DefineSqlParameter("@Tag", SqlDbType.NVarChar, 255, ParameterDirection.Input, tagText); sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc); sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy); sph.DefineSqlParameter("@VocabularyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, vocabularyGuid); return(sph.ExecuteNonQuery() > 0); }
public static bool Update( Guid guid, Guid geoZoneGuid, Guid taxClassGuid, int priority, decimal rate, string description, DateTime lastModified, Guid modifiedBy) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_TaxRate_Update", 8); sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid); sph.DefineSqlParameter("@GeoZoneGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, geoZoneGuid); sph.DefineSqlParameter("@TaxClassGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, taxClassGuid); sph.DefineSqlParameter("@Priority", SqlDbType.Int, ParameterDirection.Input, priority); sph.DefineSqlParameter("@Rate", SqlDbType.Decimal, ParameterDirection.Input, rate); sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, 255, ParameterDirection.Input, description); sph.DefineSqlParameter("@LastModified", SqlDbType.DateTime, ParameterDirection.Input, lastModified); sph.DefineSqlParameter("@ModifiedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, modifiedBy); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > 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); }
/// <summary> /// Inserts a row in the mp_LetterInfo table. Returns rows affected count. /// </summary> /// <param name="letterInfoGuid"> letterInfoGuid </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="title"> title </param> /// <param name="description"> description </param> /// <param name="availableToRoles"> availableToRoles </param> /// <param name="enabled"> enabled </param> /// <param name="allowUserFeedback"> allowUserFeedback </param> /// <param name="allowAnonFeedback"> allowAnonFeedback </param> /// <param name="fromAddress"> fromAddress </param> /// <param name="fromName"> fromName </param> /// <param name="replyToAddress"> replyToAddress </param> /// <param name="sendMode"> sendMode </param> /// <param name="enableViewAsWebPage"> enableViewAsWebPage </param> /// <param name="enableSendLog"> enableSendLog </param> /// <param name="rolesThatCanEdit"> rolesThatCanEdit </param> /// <param name="rolesThatCanApprove"> rolesThatCanApprove </param> /// <param name="rolesThatCanSend"> rolesThatCanSend </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 letterInfoGuid, Guid siteGuid, string title, string description, string availableToRoles, bool enabled, bool allowUserFeedback, bool allowAnonFeedback, string fromAddress, string fromName, string replyToAddress, int sendMode, bool enableViewAsWebPage, bool enableSendLog, string rolesThatCanEdit, string rolesThatCanApprove, string rolesThatCanSend, DateTime createdUtc, Guid createdBy, DateTime lastModUtc, Guid lastModBy, bool allowArchiveView, bool profileOptIn, int sortRank, string displayNameDefault, string firstNameDefault, string lastNameDefault) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_LetterInfo_Insert", 27); sph.DefineSqlParameter("@LetterInfoGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, letterInfoGuid); sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid); sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title); sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description); sph.DefineSqlParameter("@AvailableToRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, availableToRoles); sph.DefineSqlParameter("@Enabled", SqlDbType.Bit, ParameterDirection.Input, enabled); sph.DefineSqlParameter("@AllowUserFeedback", SqlDbType.Bit, ParameterDirection.Input, allowUserFeedback); sph.DefineSqlParameter("@AllowAnonFeedback", SqlDbType.Bit, ParameterDirection.Input, allowAnonFeedback); sph.DefineSqlParameter("@FromAddress", SqlDbType.NVarChar, 255, ParameterDirection.Input, fromAddress); sph.DefineSqlParameter("@FromName", SqlDbType.NVarChar, 255, ParameterDirection.Input, fromName); sph.DefineSqlParameter("@ReplyToAddress", SqlDbType.NVarChar, 255, ParameterDirection.Input, replyToAddress); sph.DefineSqlParameter("@SendMode", SqlDbType.Int, ParameterDirection.Input, sendMode); sph.DefineSqlParameter("@EnableViewAsWebPage", SqlDbType.Bit, ParameterDirection.Input, enableViewAsWebPage); sph.DefineSqlParameter("@EnableSendLog", SqlDbType.Bit, ParameterDirection.Input, enableSendLog); sph.DefineSqlParameter("@RolesThatCanEdit", SqlDbType.NVarChar, -1, ParameterDirection.Input, rolesThatCanEdit); sph.DefineSqlParameter("@RolesThatCanApprove", SqlDbType.NVarChar, -1, ParameterDirection.Input, rolesThatCanApprove); sph.DefineSqlParameter("@RolesThatCanSend", SqlDbType.NVarChar, -1, ParameterDirection.Input, rolesThatCanSend); sph.DefineSqlParameter("@CreatedUTC", SqlDbType.DateTime, ParameterDirection.Input, createdUtc); sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy); sph.DefineSqlParameter("@LastModUTC", SqlDbType.DateTime, ParameterDirection.Input, lastModUtc); sph.DefineSqlParameter("@LastModBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModBy); sph.DefineSqlParameter("@AllowArchiveView", SqlDbType.Bit, ParameterDirection.Input, allowArchiveView); sph.DefineSqlParameter("@ProfileOptIn", SqlDbType.Bit, ParameterDirection.Input, profileOptIn); sph.DefineSqlParameter("@SortRank", SqlDbType.Int, ParameterDirection.Input, sortRank); sph.DefineSqlParameter("@DisplayNameDefault", SqlDbType.NVarChar, 50, ParameterDirection.Input, displayNameDefault); sph.DefineSqlParameter("@FirstNameDefault", SqlDbType.NVarChar, 50, ParameterDirection.Input, firstNameDefault); sph.DefineSqlParameter("@LastNameDefault", SqlDbType.NVarChar, 50, ParameterDirection.Input, lastNameDefault); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected); }
/// <summary> /// Inserts a row in the mp_PayPalLog table. Returns rows affected count. /// </summary> /// <param name="rowGuid"> rowGuid </param> /// <param name="createdUtc"> createdUtc </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="userGuid"> userGuid </param> /// <param name="storeGuid"> storeGuid </param> /// <param name="cartGuid"> cartGuid </param> /// <param name="requestType"> requestType </param> /// <param name="apiVersion"> apiVersion </param> /// <param name="rawResponse"> rawResponse </param> /// <param name="token"> token </param> /// <param name="payerId"> payerId </param> /// <param name="transactionId"> transactionId </param> /// <param name="paymentType"> paymentType </param> /// <param name="paymentStatus"> paymentStatus </param> /// <param name="pendingReason"> pendingReason </param> /// <param name="reasonCode"> reasonCode </param> /// <param name="currencyCode"> currencyCode </param> /// <param name="exchangeRate"> exchangeRate </param> /// <param name="cartTotal"> cartTotal </param> /// <param name="payPalAmt"> payPalAmt </param> /// <param name="taxAmt"> taxAmt </param> /// <param name="feeAmt"> feeAmt </param> /// <param name="settleAmt"> settleAmt </param> /// <returns>int</returns> public static int Create( Guid rowGuid, DateTime createdUtc, Guid siteGuid, Guid userGuid, Guid storeGuid, Guid cartGuid, string requestType, string apiVersion, string rawResponse, string token, string payerId, string transactionId, string paymentType, string paymentStatus, string pendingReason, string reasonCode, string currencyCode, decimal exchangeRate, decimal cartTotal, decimal payPalAmt, decimal taxAmt, decimal feeAmt, decimal settleAmt, string providerName, string returnUrl, string serializedObject, string pdtProviderName, string ipnProviderName, string response) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_PayPalLog_Insert", 29); sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid); sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc); 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("@RequestType", SqlDbType.NVarChar, 255, ParameterDirection.Input, requestType); sph.DefineSqlParameter("@ApiVersion", SqlDbType.NVarChar, 50, ParameterDirection.Input, apiVersion); sph.DefineSqlParameter("@RawResponse", SqlDbType.NVarChar, -1, ParameterDirection.Input, rawResponse); sph.DefineSqlParameter("@Token", SqlDbType.NVarChar, 50, ParameterDirection.Input, token); sph.DefineSqlParameter("@PayerId", SqlDbType.NVarChar, 50, ParameterDirection.Input, payerId); sph.DefineSqlParameter("@TransactionId", SqlDbType.NVarChar, 50, ParameterDirection.Input, transactionId); sph.DefineSqlParameter("@PaymentType", SqlDbType.NVarChar, 10, ParameterDirection.Input, paymentType); sph.DefineSqlParameter("@PaymentStatus", SqlDbType.NVarChar, 50, ParameterDirection.Input, paymentStatus); sph.DefineSqlParameter("@PendingReason", SqlDbType.NVarChar, 255, ParameterDirection.Input, pendingReason); sph.DefineSqlParameter("@ReasonCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, reasonCode); sph.DefineSqlParameter("@CurrencyCode", SqlDbType.NVarChar, 50, ParameterDirection.Input, currencyCode); sph.DefineSqlParameter("@ExchangeRate", SqlDbType.Decimal, ParameterDirection.Input, exchangeRate); sph.DefineSqlParameter("@CartTotal", SqlDbType.Decimal, ParameterDirection.Input, cartTotal); sph.DefineSqlParameter("@PayPalAmt", SqlDbType.Decimal, ParameterDirection.Input, payPalAmt); sph.DefineSqlParameter("@TaxAmt", SqlDbType.Decimal, ParameterDirection.Input, taxAmt); sph.DefineSqlParameter("@FeeAmt", SqlDbType.Decimal, ParameterDirection.Input, feeAmt); sph.DefineSqlParameter("@SettleAmt", SqlDbType.Decimal, ParameterDirection.Input, settleAmt); sph.DefineSqlParameter("@ProviderName", SqlDbType.NVarChar, 255, ParameterDirection.Input, providerName); sph.DefineSqlParameter("@ReturnUrl", SqlDbType.NVarChar, 255, ParameterDirection.Input, returnUrl); sph.DefineSqlParameter("@SerializedObject", SqlDbType.NVarChar, -1, ParameterDirection.Input, serializedObject); sph.DefineSqlParameter("@PDTProviderName", SqlDbType.NVarChar, 255, ParameterDirection.Input, pdtProviderName); sph.DefineSqlParameter("@IPNProviderName", SqlDbType.NVarChar, 255, ParameterDirection.Input, ipnProviderName); sph.DefineSqlParameter("@Response", SqlDbType.NVarChar, 255, ParameterDirection.Input, response); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected); }
public static bool UpdatePage( int siteId, int pageId, int parentId, string pageName, string pageTitle, string skin, int pageOrder, string authorizedRoles, string editRoles, string draftEditRoles, string draftApprovalRoles, string createChildPageRoles, string createChildDraftRoles, bool requireSsl, bool allowBrowserCache, bool showBreadcrumbs, bool showChildPageBreadcrumbs, string pageKeyWords, string pageDescription, string pageEncoding, string additionalMetaTags, bool useUrl, string url, bool openInNewWindow, bool showChildPageMenu, bool hideMainMenu, bool includeInMenu, String menuImage, string changeFrequency, string siteMapPriority, Guid parentGuid, bool hideAfterLogin, string compiledMeta, DateTime compiledMetaUtc, bool includeInSiteMap, bool isClickable, bool showHomeCrumb, bool isPending, string canonicalOverride, bool includeInSearchMap, bool enableComments, bool includeInChildSiteMap, bool expandOnSiteMap, Guid pubTeamId, string bodyCssClass, string menuCssClass, int publishMode, DateTime createdUtc, Guid createdBy, Guid lastModBy, string lastModFromIp, string menuDescription, string linkRel, string pageHeading, bool showPageHeading, DateTime pubDateUtc) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Pages_Update", 58); sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId); sph.DefineSqlParameter("@PageID", SqlDbType.Int, ParameterDirection.Input, pageId); sph.DefineSqlParameter("@ParentID", SqlDbType.Int, ParameterDirection.Input, parentId); sph.DefineSqlParameter("@PageOrder", SqlDbType.Int, ParameterDirection.Input, pageOrder); sph.DefineSqlParameter("@PageName", SqlDbType.NVarChar, 255, ParameterDirection.Input, pageName); sph.DefineSqlParameter("@AuthorizedRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, authorizedRoles); sph.DefineSqlParameter("@EditRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, editRoles); sph.DefineSqlParameter("@DraftEditRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, draftEditRoles); sph.DefineSqlParameter("@DraftApprovalRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, draftApprovalRoles); //JOE DAVIS sph.DefineSqlParameter("@CreateChildPageRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, createChildPageRoles); sph.DefineSqlParameter("@CreateChildDraftRoles", SqlDbType.NVarChar, -1, ParameterDirection.Input, createChildDraftRoles); sph.DefineSqlParameter("@RequireSSL", SqlDbType.Bit, ParameterDirection.Input, requireSsl); sph.DefineSqlParameter("@ShowBreadcrumbs", SqlDbType.Bit, ParameterDirection.Input, showBreadcrumbs); sph.DefineSqlParameter("@ShowChildPageBreadcrumbs", SqlDbType.Bit, ParameterDirection.Input, showChildPageBreadcrumbs); sph.DefineSqlParameter("@PageKeyWords", SqlDbType.NVarChar, 1000, ParameterDirection.Input, pageKeyWords); sph.DefineSqlParameter("@PageDescription", SqlDbType.NVarChar, 255, ParameterDirection.Input, pageDescription); sph.DefineSqlParameter("@PageEncoding", SqlDbType.NVarChar, 255, ParameterDirection.Input, pageEncoding); sph.DefineSqlParameter("@AdditionalMetaTags", SqlDbType.NVarChar, 255, ParameterDirection.Input, additionalMetaTags); sph.DefineSqlParameter("@UseUrl", SqlDbType.Bit, ParameterDirection.Input, useUrl); sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, 255, ParameterDirection.Input, url); sph.DefineSqlParameter("@OpenInNewWindow", SqlDbType.Bit, ParameterDirection.Input, openInNewWindow); sph.DefineSqlParameter("@ShowChildPageMenu", SqlDbType.Bit, ParameterDirection.Input, showChildPageMenu); sph.DefineSqlParameter("@HideMainMenu", SqlDbType.Bit, ParameterDirection.Input, hideMainMenu); sph.DefineSqlParameter("@Skin", SqlDbType.NVarChar, 100, ParameterDirection.Input, skin); sph.DefineSqlParameter("@IncludeInMenu", SqlDbType.Bit, ParameterDirection.Input, includeInMenu); sph.DefineSqlParameter("@MenuImage", SqlDbType.NVarChar, 255, ParameterDirection.Input, menuImage); sph.DefineSqlParameter("@PageTitle", SqlDbType.NVarChar, 255, ParameterDirection.Input, pageTitle); sph.DefineSqlParameter("@AllowBrowserCache", SqlDbType.Bit, ParameterDirection.Input, allowBrowserCache); sph.DefineSqlParameter("@ChangeFrequency", SqlDbType.NVarChar, 20, ParameterDirection.Input, changeFrequency); sph.DefineSqlParameter("@SiteMapPriority", SqlDbType.NVarChar, 10, ParameterDirection.Input, siteMapPriority); sph.DefineSqlParameter("@LastModifiedUTC", SqlDbType.DateTime, ParameterDirection.Input, DateTime.UtcNow); sph.DefineSqlParameter("@ParentGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, parentGuid); sph.DefineSqlParameter("@HideAfterLogin", SqlDbType.Bit, ParameterDirection.Input, hideAfterLogin); sph.DefineSqlParameter("@CompiledMeta", SqlDbType.NVarChar, -1, ParameterDirection.Input, compiledMeta); sph.DefineSqlParameter("@CompiledMetaUtc", SqlDbType.DateTime, ParameterDirection.Input, compiledMetaUtc); sph.DefineSqlParameter("@IncludeInSiteMap", SqlDbType.Bit, ParameterDirection.Input, includeInSiteMap); sph.DefineSqlParameter("@IsClickable", SqlDbType.Bit, ParameterDirection.Input, isClickable); sph.DefineSqlParameter("@ShowHomeCrumb", SqlDbType.Bit, ParameterDirection.Input, showHomeCrumb); sph.DefineSqlParameter("@IsPending", SqlDbType.Bit, ParameterDirection.Input, isPending); sph.DefineSqlParameter("@CanonicalOverride", SqlDbType.NVarChar, 255, ParameterDirection.Input, canonicalOverride); sph.DefineSqlParameter("@IncludeInSearchMap", SqlDbType.Bit, ParameterDirection.Input, includeInSearchMap); sph.DefineSqlParameter("@EnableComments", SqlDbType.Bit, ParameterDirection.Input, enableComments); sph.DefineSqlParameter("@IncludeInChildSiteMap", SqlDbType.Bit, ParameterDirection.Input, includeInChildSiteMap); sph.DefineSqlParameter("@ExpandOnSiteMap", SqlDbType.Bit, ParameterDirection.Input, expandOnSiteMap); sph.DefineSqlParameter("@PubTeamId", SqlDbType.UniqueIdentifier, ParameterDirection.Input, pubTeamId); sph.DefineSqlParameter("@BodyCssClass", SqlDbType.NVarChar, 50, ParameterDirection.Input, bodyCssClass); sph.DefineSqlParameter("@MenuCssClass", SqlDbType.NVarChar, 50, ParameterDirection.Input, menuCssClass); sph.DefineSqlParameter("@PublishMode", SqlDbType.Int, ParameterDirection.Input, publishMode); sph.DefineSqlParameter("@PCreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc); sph.DefineSqlParameter("@PCreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy); sph.DefineSqlParameter("@PLastModUtc", SqlDbType.DateTime, ParameterDirection.Input, DateTime.UtcNow); sph.DefineSqlParameter("@PLastModBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, lastModBy); sph.DefineSqlParameter("@PLastModFromIp", SqlDbType.NVarChar, 36, ParameterDirection.Input, lastModFromIp); sph.DefineSqlParameter("@MenuDesc", SqlDbType.NVarChar, -1, ParameterDirection.Input, menuDescription); sph.DefineSqlParameter("@LinkRel", SqlDbType.NVarChar, 20, ParameterDirection.Input, linkRel); sph.DefineSqlParameter("@PageHeading", SqlDbType.NVarChar, 255, ParameterDirection.Input, pageHeading); sph.DefineSqlParameter("@ShowPageHeading", SqlDbType.Bit, ParameterDirection.Input, showPageHeading); if (pubDateUtc == DateTime.MaxValue) { sph.DefineSqlParameter("@PubDateUtc", SqlDbType.DateTime, ParameterDirection.Input, DBNull.Value); } else { sph.DefineSqlParameter("@PubDateUtc", SqlDbType.DateTime, ParameterDirection.Input, pubDateUtc); } int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > -1); }
public static bool Update( int siteId, string siteName, string skin, string logo, string icon, bool allowNewRegistration, bool allowUserSkins, bool allowPageSkins, bool allowHideMenuOnPages, bool useSecureRegistration, bool useSslOnAllPages, string defaultPageKeywords, string defaultPageDescription, string defaultPageEncoding, string defaultAdditionalMetaTags, bool isServerAdminSite, bool useLdapAuth, bool autoCreateLdapUserOnFirstLogin, string ldapServer, int ldapPort, String ldapDomain, string ldapRootDN, string ldapUserDNKey, bool allowUserFullNameChange, bool useEmailForLogin, bool reallyDeleteUsers, String editorSkin, String defaultFriendlyUrlPattern, bool enableMyPageFeature, string editorProvider, string datePickerProvider, string captchaProvider, string recaptchaPrivateKey, string recaptchaPublicKey, string wordpressApiKey, string windowsLiveAppId, string windowsLiveKey, bool allowOpenIdAuth, bool allowWindowsLiveAuth, string gmapApiKey, string apiKeyExtra1, string apiKeyExtra2, string apiKeyExtra3, string apiKeyExtra4, string apiKeyExtra5, bool disableDbAuth) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Sites_Update", 46); sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId); sph.DefineSqlParameter("@SiteName", SqlDbType.NVarChar, 128, ParameterDirection.Input, siteName); sph.DefineSqlParameter("@Skin", SqlDbType.NVarChar, 100, ParameterDirection.Input, skin); sph.DefineSqlParameter("@Logo", SqlDbType.NVarChar, 50, ParameterDirection.Input, logo); sph.DefineSqlParameter("@Icon", SqlDbType.NVarChar, 50, ParameterDirection.Input, icon); sph.DefineSqlParameter("@AllowNewRegistration", SqlDbType.Bit, ParameterDirection.Input, allowNewRegistration); sph.DefineSqlParameter("@AllowUserSkins", SqlDbType.Bit, ParameterDirection.Input, allowUserSkins); sph.DefineSqlParameter("@UseSecureRegistration", SqlDbType.Bit, ParameterDirection.Input, useSecureRegistration); sph.DefineSqlParameter("@UseSSLOnAllPages", SqlDbType.Bit, ParameterDirection.Input, useSslOnAllPages); sph.DefineSqlParameter("@DefaultPageKeywords", SqlDbType.NVarChar, 255, ParameterDirection.Input, defaultPageKeywords); sph.DefineSqlParameter("@DefaultPageDescription", SqlDbType.NVarChar, 255, ParameterDirection.Input, defaultPageDescription); sph.DefineSqlParameter("@DefaultPageEncoding", SqlDbType.NVarChar, 255, ParameterDirection.Input, defaultPageEncoding); sph.DefineSqlParameter("@DefaultAdditionalMetaTags", SqlDbType.NVarChar, 255, ParameterDirection.Input, defaultAdditionalMetaTags); sph.DefineSqlParameter("@IsServerAdminSite", SqlDbType.Bit, ParameterDirection.Input, isServerAdminSite); sph.DefineSqlParameter("@AllowPageSkins", SqlDbType.Bit, ParameterDirection.Input, allowPageSkins); sph.DefineSqlParameter("@AllowHideMenuOnPages", SqlDbType.Bit, ParameterDirection.Input, allowHideMenuOnPages); sph.DefineSqlParameter("@UseLdapAuth", SqlDbType.Bit, ParameterDirection.Input, useLdapAuth); sph.DefineSqlParameter("@AutoCreateLDAPUserOnFirstLogin", SqlDbType.Bit, ParameterDirection.Input, autoCreateLdapUserOnFirstLogin); sph.DefineSqlParameter("@LdapServer", SqlDbType.NVarChar, 255, ParameterDirection.Input, ldapServer); sph.DefineSqlParameter("@LdapPort", SqlDbType.Int, ParameterDirection.Input, ldapPort); sph.DefineSqlParameter("@LdapRootDN", SqlDbType.NVarChar, 255, ParameterDirection.Input, ldapRootDN); sph.DefineSqlParameter("@LdapUserDNKey", SqlDbType.NVarChar, 10, ParameterDirection.Input, ldapUserDNKey); sph.DefineSqlParameter("@AllowUserFullNameChange", SqlDbType.Bit, ParameterDirection.Input, allowUserFullNameChange); sph.DefineSqlParameter("@UseEmailForLogin", SqlDbType.Bit, ParameterDirection.Input, useEmailForLogin); sph.DefineSqlParameter("@ReallyDeleteUsers", SqlDbType.Bit, ParameterDirection.Input, reallyDeleteUsers); sph.DefineSqlParameter("@EditorSkin", SqlDbType.NVarChar, 50, ParameterDirection.Input, editorSkin); sph.DefineSqlParameter("@DefaultFriendlyUrlPatternEnum", SqlDbType.NVarChar, 50, ParameterDirection.Input, defaultFriendlyUrlPattern); sph.DefineSqlParameter("@EnableMyPageFeature", SqlDbType.Bit, ParameterDirection.Input, enableMyPageFeature); sph.DefineSqlParameter("@LdapDomain", SqlDbType.NVarChar, 255, ParameterDirection.Input, ldapDomain); sph.DefineSqlParameter("@EditorProvider", SqlDbType.NVarChar, 255, ParameterDirection.Input, editorProvider); sph.DefineSqlParameter("@DatePickerProvider", SqlDbType.NVarChar, 255, ParameterDirection.Input, datePickerProvider); sph.DefineSqlParameter("@CaptchaProvider", SqlDbType.NVarChar, 255, ParameterDirection.Input, captchaProvider); sph.DefineSqlParameter("@RecaptchaPrivateKey", SqlDbType.NVarChar, 255, ParameterDirection.Input, recaptchaPrivateKey); sph.DefineSqlParameter("@RecaptchaPublicKey", SqlDbType.NVarChar, 255, ParameterDirection.Input, recaptchaPublicKey); sph.DefineSqlParameter("@WordpressAPIKey", SqlDbType.NVarChar, 255, ParameterDirection.Input, wordpressApiKey); sph.DefineSqlParameter("@WindowsLiveAppID", SqlDbType.NVarChar, 255, ParameterDirection.Input, windowsLiveAppId); sph.DefineSqlParameter("@WindowsLiveKey", SqlDbType.NVarChar, 255, ParameterDirection.Input, windowsLiveKey); sph.DefineSqlParameter("@AllowOpenIDAuth", SqlDbType.Bit, ParameterDirection.Input, allowOpenIdAuth); sph.DefineSqlParameter("@AllowWindowsLiveAuth", SqlDbType.Bit, ParameterDirection.Input, allowWindowsLiveAuth); sph.DefineSqlParameter("@GmapApiKey", SqlDbType.NVarChar, 255, ParameterDirection.Input, gmapApiKey); sph.DefineSqlParameter("@ApiKeyExtra1", SqlDbType.NVarChar, 255, ParameterDirection.Input, apiKeyExtra1); sph.DefineSqlParameter("@ApiKeyExtra2", SqlDbType.NVarChar, 255, ParameterDirection.Input, apiKeyExtra2); sph.DefineSqlParameter("@ApiKeyExtra3", SqlDbType.NVarChar, 255, ParameterDirection.Input, apiKeyExtra3); sph.DefineSqlParameter("@ApiKeyExtra4", SqlDbType.NVarChar, 255, ParameterDirection.Input, apiKeyExtra4); sph.DefineSqlParameter("@ApiKeyExtra5", SqlDbType.NVarChar, 255, ParameterDirection.Input, apiKeyExtra5); sph.DefineSqlParameter("@DisableDbAuth", SqlDbType.Bit, ParameterDirection.Input, disableDbAuth); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected > -1); }
///// <summary> ///// Gets the connection string. ///// </summary> ///// <returns></returns> //private static string GetConnectionString() //{ // return ConfigurationManager.AppSettings["MSSQLConnectionString"]; //} /// <summary> /// Inserts a row in the mp_GoogleCheckoutLog table. Returns rows affected count. /// </summary> /// <param name="rowGuid"> rowGuid </param> /// <param name="createdUtc"> createdUtc </param> /// <param name="siteGuid"> siteGuid </param> /// <param name="userGuid"> userGuid </param> /// <param name="storeGuid"> storeGuid </param> /// <param name="cartGuid"> cartGuid </param> /// <param name="notificationType"> notificationType </param> /// <param name="rawResponse"> rawResponse </param> /// <param name="serialNumber"> serialNumber </param> /// <param name="gTimestamp"> gTimestamp </param> /// <param name="orderNumber"> orderNumber </param> /// <param name="buyerId"> buyerId </param> /// <param name="fullfillState"> fullfillState </param> /// <param name="financeState"> financeState </param> /// <param name="emailListOptIn"> emailListOptIn </param> /// <param name="avsResponse"> avsResponse </param> /// <param name="cvnResponse"> cvnResponse </param> /// <param name="authExpDate"> authExpDate </param> /// <param name="authAmt"> authAmt </param> /// <param name="discountTotal"> discountTotal </param> /// <param name="shippingTotal"> shippingTotal </param> /// <param name="taxTotal"> taxTotal </param> /// <param name="orderTotal"> orderTotal </param> /// <param name="latestChgAmt"> latestChgAmt </param> /// <param name="totalChgAmt"> totalChgAmt </param> /// <param name="latestRefundAmt"> latestRefundAmt </param> /// <param name="totalRefundAmt"> totalRefundAmt </param> /// <param name="latestChargeback"> latestChargeback </param> /// <param name="totalChargeback"> totalChargeback </param> /// <param name="cartXml"> cartXml </param> /// <returns>int</returns> public static int Create( Guid rowGuid, DateTime createdUtc, Guid siteGuid, Guid userGuid, Guid storeGuid, Guid cartGuid, string notificationType, string rawResponse, string serialNumber, DateTime gTimestamp, string orderNumber, string buyerId, string fullfillState, string financeState, bool emailListOptIn, string avsResponse, string cvnResponse, DateTime authExpDate, decimal authAmt, decimal discountTotal, decimal shippingTotal, decimal taxTotal, decimal orderTotal, decimal latestChgAmt, decimal totalChgAmt, decimal latestRefundAmt, decimal totalRefundAmt, decimal latestChargeback, decimal totalChargeback, string cartXml, string providerName) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_GoogleCheckoutLog_Insert", 31); sph.DefineSqlParameter("@RowGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, rowGuid); sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc); 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("@NotificationType", SqlDbType.NVarChar, 255, ParameterDirection.Input, notificationType); sph.DefineSqlParameter("@RawResponse", SqlDbType.NVarChar, -1, ParameterDirection.Input, rawResponse); sph.DefineSqlParameter("@SerialNumber", SqlDbType.NVarChar, 50, ParameterDirection.Input, serialNumber); sph.DefineSqlParameter("@GTimestamp", SqlDbType.DateTime, ParameterDirection.Input, gTimestamp); sph.DefineSqlParameter("@OrderNumber", SqlDbType.NVarChar, 50, ParameterDirection.Input, orderNumber); sph.DefineSqlParameter("@BuyerId", SqlDbType.NVarChar, 50, ParameterDirection.Input, buyerId); sph.DefineSqlParameter("@FullfillState", SqlDbType.NVarChar, 50, ParameterDirection.Input, fullfillState); sph.DefineSqlParameter("@FinanceState", SqlDbType.NVarChar, 50, ParameterDirection.Input, financeState); sph.DefineSqlParameter("@EmailListOptIn", SqlDbType.Bit, ParameterDirection.Input, emailListOptIn); sph.DefineSqlParameter("@AvsResponse", SqlDbType.NVarChar, 5, ParameterDirection.Input, avsResponse); sph.DefineSqlParameter("@CvnResponse", SqlDbType.NVarChar, 5, ParameterDirection.Input, cvnResponse); sph.DefineSqlParameter("@AuthExpDate", SqlDbType.DateTime, ParameterDirection.Input, authExpDate); sph.DefineSqlParameter("@AuthAmt", SqlDbType.Decimal, ParameterDirection.Input, authAmt); sph.DefineSqlParameter("@DiscountTotal", SqlDbType.Decimal, ParameterDirection.Input, discountTotal); sph.DefineSqlParameter("@ShippingTotal", SqlDbType.Decimal, ParameterDirection.Input, shippingTotal); sph.DefineSqlParameter("@TaxTotal", SqlDbType.Decimal, ParameterDirection.Input, taxTotal); sph.DefineSqlParameter("@OrderTotal", SqlDbType.Decimal, ParameterDirection.Input, orderTotal); sph.DefineSqlParameter("@LatestChgAmt", SqlDbType.Decimal, ParameterDirection.Input, latestChgAmt); sph.DefineSqlParameter("@TotalChgAmt", SqlDbType.Decimal, ParameterDirection.Input, totalChgAmt); sph.DefineSqlParameter("@LatestRefundAmt", SqlDbType.Decimal, ParameterDirection.Input, latestRefundAmt); sph.DefineSqlParameter("@TotalRefundAmt", SqlDbType.Decimal, ParameterDirection.Input, totalRefundAmt); sph.DefineSqlParameter("@LatestChargeback", SqlDbType.Decimal, ParameterDirection.Input, latestChargeback); sph.DefineSqlParameter("@TotalChargeback", SqlDbType.Decimal, ParameterDirection.Input, totalChargeback); sph.DefineSqlParameter("@CartXml", SqlDbType.NVarChar, -1, ParameterDirection.Input, cartXml); sph.DefineSqlParameter("@ProviderName", SqlDbType.NVarChar, 255, ParameterDirection.Input, providerName); int rowsAffected = sph.ExecuteNonQuery(); return(rowsAffected); }