本文整理汇总了C#中mojoPortal.Data.SqlParameterHelper类的典型用法代码示例。如果您正苦于以下问题:C# SqlParameterHelper类的具体用法?C# SqlParameterHelper怎么用?C# SqlParameterHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlParameterHelper类属于mojoPortal.Data命名空间,在下文中一共展示了SqlParameterHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:7,代码来源:DBPoll.cs
示例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;
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:45,代码来源:DBContentWorkflow.cs
示例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;
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:26,代码来源:DBPoll.cs
示例4: AddGalleryImage
public static int AddGalleryImage(
Guid itemGuid,
Guid moduleGuid,
int moduleId,
int displayOrder,
string caption,
string description,
string metaDataXml,
string imageFile,
string webImageFile,
string thumbnailFile,
DateTime uploadDate,
string uploadUser,
Guid userGuid)
{
SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_GalleryImages_Insert", 13);
sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
sph.DefineSqlParameter("@DisplayOrder", SqlDbType.Int, ParameterDirection.Input, displayOrder);
sph.DefineSqlParameter("@Caption", SqlDbType.NVarChar, 255, ParameterDirection.Input, caption);
sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
sph.DefineSqlParameter("@MetaDataXml", SqlDbType.NVarChar, -1, ParameterDirection.Input, metaDataXml);
sph.DefineSqlParameter("@ImageFile", SqlDbType.NVarChar, 100, ParameterDirection.Input, imageFile);
sph.DefineSqlParameter("@WebImageFile", SqlDbType.NVarChar, 100, ParameterDirection.Input, webImageFile);
sph.DefineSqlParameter("@ThumbnailFile", SqlDbType.NVarChar, 100, ParameterDirection.Input, thumbnailFile);
sph.DefineSqlParameter("@UploadDate", SqlDbType.DateTime, ParameterDirection.Input, uploadDate);
sph.DefineSqlParameter("@UploadUser", SqlDbType.NVarChar, 100, ParameterDirection.Input, uploadUser);
sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
int newID = Convert.ToInt32(sph.ExecuteScalar());
return newID;
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:32,代码来源:DBGallery.cs
示例5: 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);
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:12,代码来源:DBSystemLog.cs
示例6: 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);
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:7,代码来源:dbModuleSettings.cs
示例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;
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:32,代码来源:DBDownloadTerms.cs
示例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;
}
开发者ID:BackupTheBerlios,项目名称:buildingmonitor-svn,代码行数:32,代码来源:DBProgressReport.cs
示例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);
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:7,代码来源:dbModuleDefinition.cs
示例10: AddLink
public static int AddLink(
Guid itemGuid,
Guid moduleGuid,
int moduleId,
string title,
string url,
int viewOrder,
string description,
DateTime createdDate,
int createdBy,
string target,
Guid userGuid)
{
SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_Links_Insert", 11);
sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title);
sph.DefineSqlParameter("@Url", SqlDbType.NVarChar, -1, ParameterDirection.Input, url);
sph.DefineSqlParameter("@ViewOrder", SqlDbType.Int, ParameterDirection.Input, viewOrder);
sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, -1, ParameterDirection.Input, description);
sph.DefineSqlParameter("@CreatedDate", SqlDbType.DateTime, ParameterDirection.Input, createdDate);
sph.DefineSqlParameter("@CreatedBy", SqlDbType.Int, ParameterDirection.Input, createdBy);
sph.DefineSqlParameter("@Target", SqlDbType.NVarChar, 20, ParameterDirection.Input, target);
sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
int newID = Convert.ToInt32(sph.ExecuteScalar());
return newID;
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:28,代码来源:DBLinks.cs
示例11: DeleteByOrder
/// <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);
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:12,代码来源:DBOrderOffer.cs
示例12: Count
public static int Count(int siteId)
{
SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetReadConnectionString(), "mp_WebParts_GetCount", 1);
sph.DefineSqlParameter("@SiteID", SqlDbType.Int, ParameterDirection.Input, siteId);
int count = Convert.ToInt32(sph.ExecuteScalar());
return count;
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:7,代码来源:dbWebPartContent.cs
示例13: DeleteWebPart
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);
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:7,代码来源:dbWebPartContent.cs
示例14: AddWebPart
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;
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:28,代码来源:dbWebPartContent.cs
示例15: Create
///// <summary>
///// Gets the connection string for read.
///// </summary>
///// <returns></returns>
//private static string GetReadConnectionString()
//{
// return ConfigurationManager.AppSettings["MSSQLConnectionString"];
//}
///// <summary>
///// Gets the connection string for write.
///// </summary>
///// <returns></returns>
//private static string GetWriteConnectionString()
//{
// if (ConfigurationManager.AppSettings["MSSQLWriteConnectionString"] != null)
// {
// return ConfigurationManager.AppSettings["MSSQLWriteConnectionString"];
// }
// return ConfigurationManager.AppSettings["MSSQLConnectionString"];
//}
/// <summary>
/// Inserts a row in the mp_ContentMeta table. Returns rows affected count.
/// </summary>
/// <param name="guid"> guid </param>
/// <param name="siteGuid"> siteGuid </param>
/// <param name="moduleGuid"> moduleGuid </param>
/// <param name="contentGuid"> contentGuid </param>
/// <param name="name"> name </param>
/// <param name="scheme"> scheme </param>
/// <param name="langCode"> langCode </param>
/// <param name="dir"> dir </param>
/// <param name="metaContent"> metaContent </param>
/// <param name="sortRank"> sortRank </param>
/// <param name="createdUtc"> createdUtc </param>
/// <param name="createdBy"> createdBy </param>
/// <returns>int</returns>
public static int Create(
Guid guid,
Guid siteGuid,
Guid moduleGuid,
Guid contentGuid,
string name,
string scheme,
string langCode,
string dir,
string metaContent,
int sortRank,
DateTime createdUtc,
Guid createdBy)
{
SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_ContentMeta_Insert", 14);
sph.DefineSqlParameter("@Guid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, guid);
sph.DefineSqlParameter("@SiteGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, siteGuid);
sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
sph.DefineSqlParameter("@ContentGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, contentGuid);
sph.DefineSqlParameter("@Name", SqlDbType.NVarChar, 255, ParameterDirection.Input, name);
sph.DefineSqlParameter("@Scheme", SqlDbType.NVarChar, 255, ParameterDirection.Input, scheme);
sph.DefineSqlParameter("@LangCode", SqlDbType.NVarChar, 10, ParameterDirection.Input, langCode);
sph.DefineSqlParameter("@Dir", SqlDbType.NVarChar, 3, ParameterDirection.Input, dir);
sph.DefineSqlParameter("@MetaContent", SqlDbType.NVarChar, -1, ParameterDirection.Input, metaContent);
sph.DefineSqlParameter("@SortRank", SqlDbType.Int, ParameterDirection.Input, sortRank);
sph.DefineSqlParameter("@CreatedUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
sph.DefineSqlParameter("@CreatedBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
sph.DefineSqlParameter("@LastModUtc", SqlDbType.DateTime, ParameterDirection.Input, createdUtc);
sph.DefineSqlParameter("@LastModBy", SqlDbType.UniqueIdentifier, ParameterDirection.Input, createdBy);
int rowsAffected = sph.ExecuteNonQuery();
return rowsAffected;
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:68,代码来源:DBContentMeta.cs
示例16: CreateModuleSetting
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);
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:28,代码来源:dbModuleSettings.cs
示例17: DeleteGalleryImage
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);
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:7,代码来源:DBGallery.cs
示例18: Create
/// <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;
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:44,代码来源:DBLetter.cs
示例19: DeleteByCart
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);
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:7,代码来源:DBCartOffer.cs
示例20: AddHtmlContent
public static int AddHtmlContent(
Guid itemGuid,
Guid moduleGuid,
int moduleId,
string title,
string excerpt,
string body,
string moreLink,
int sortOrder,
DateTime beginDate,
DateTime endDate,
DateTime createdDate,
int userId,
Guid userGuid,
bool excludeFromRecentContent)
{
SqlParameterHelper sph = new SqlParameterHelper(ConnectionString.GetWriteConnectionString(), "mp_HtmlContent_Insert", 14);
sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
sph.DefineSqlParameter("@ModuleGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, moduleGuid);
sph.DefineSqlParameter("@ModuleID", SqlDbType.Int, ParameterDirection.Input, moduleId);
sph.DefineSqlParameter("@Title", SqlDbType.NVarChar, 255, ParameterDirection.Input, title);
sph.DefineSqlParameter("@Excerpt", SqlDbType.NVarChar, -1, ParameterDirection.Input, excerpt);
sph.DefineSqlParameter("@Body", SqlDbType.NVarChar, -1, ParameterDirection.Input, body);
sph.DefineSqlParameter("@MoreLink", SqlDbType.NVarChar, 255, ParameterDirection.Input, moreLink);
sph.DefineSqlParameter("@SortOrder", SqlDbType.Int, ParameterDirection.Input, sortOrder);
sph.DefineSqlParameter("@BeginDate", SqlDbType.DateTime, ParameterDirection.Input, beginDate);
sph.DefineSqlParameter("@EndDate", SqlDbType.DateTime, ParameterDirection.Input, endDate);
sph.DefineSqlParameter("@CreatedDate", SqlDbType.DateTime, ParameterDirection.Input, createdDate);
sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userId);
sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
sph.DefineSqlParameter("@ExcludeFromRecentContent", SqlDbType.Bit, ParameterDirection.Input, excludeFromRecentContent);
int newID = Convert.ToInt32(sph.ExecuteScalar());
return newID;
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:34,代码来源:dbHtmlContent.cs
注:本文中的mojoPortal.Data.SqlParameterHelper类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论