本文整理汇总了C#中mojoPortal.Data.SqlParameterHelper.ExecuteNonQuery方法的典型用法代码示例。如果您正苦于以下问题:C# SqlParameterHelper.ExecuteNonQuery方法的具体用法?C# SqlParameterHelper.ExecuteNonQuery怎么用?C# SqlParameterHelper.ExecuteNonQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mojoPortal.Data.SqlParameterHelper
的用法示例。
在下文中一共展示了SqlParameterHelper.ExecuteNonQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
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);
}
示例2: Create
/// <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;
}
示例3: Add
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;
}
示例4: Delete
/// <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);
}
示例5: DeleteByModule
/// <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);
}
示例6: Create
/// <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;
}
示例7: Add
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;
}
示例8: Add
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;
}
示例9: DeleteSettingById
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);
}
示例10: DeleteByLetter
/// <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);
}
示例11: CreateDefaultModuleSettings
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);
}
示例12: AccountClearLockout
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);
}
示例13: Add
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;
}
示例14: AddHistory
/// <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;
}
示例15: DeleteUserPage
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);
}