當前位置: 首頁>>代碼示例>>C#>>正文


C# SqlParameterHelper.ExecuteNonQuery方法代碼示例

本文整理匯總了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);
 }
開發者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: 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

示例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);
 }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:12,代碼來源:DBMediaPlayer.cs

示例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;
 }
開發者ID:joedavis01,項目名稱:mojoportal,代碼行數:40,代碼來源:DBContactFormMessage.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: 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);
 }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:12,代碼來源:DBLetterSendLog.cs

示例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);
 }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:7,代碼來源:dbModuleSettings.cs

示例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);
 }
開發者ID:joedavis01,項目名稱:mojoportal,代碼行數:7,代碼來源:dbSiteUser.cs

示例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;
 }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:32,代碼來源:DBOfferAvailability.cs

示例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;
 }
開發者ID:saiesh86,項目名稱:TravelBlog,代碼行數:49,代碼來源:DBTaxRate.cs

示例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);
 }
開發者ID:joedavis01,項目名稱:mojoportal,代碼行數:7,代碼來源:dbUserPage.cs


注:本文中的mojoPortal.Data.SqlParameterHelper.ExecuteNonQuery方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。