示例#1
0
        /// <summary>
        /// Delete values from PageType by primary key(s).
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="pageTypeID">Unique identifier for each Page Type record.</param>
        /// <returns>true if successful otherwise false.</returns>
        public bool PageTypeDeleteAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int pageTypeID)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("PageTypeDeleteAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("PageTypeID", SqlDbType.Int, null, false, pageTypeID),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                int returnCode = CustomSqlHelper.ExecuteNonQuery(command, "ReturnCode");

                if (transaction == null)
                {
                    CustomSqlHelper.CloseConnection(connection);
                }

                if (returnCode == 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
示例#2
0
        public bool IndicatedPageDeleteAllForPage(SqlConnection sqlConnection, SqlTransaction sqlTransaction, int pageID)
        {
            SqlConnection connection = CustomSqlHelper.CreateConnection(
                CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            try
            {
                using (SqlCommand command =
                           CustomSqlHelper.CreateCommand("IndicatedPageDeleteAllForPage", connection, sqlTransaction,
                                                         CustomSqlHelper.CreateInputParameter("PageID", SqlDbType.Int, null, false, pageID),
                                                         CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
                {
                    int returnCode = CustomSqlHelper.ExecuteNonQuery(command, "ReturnCode");

                    if (transaction == null)
                    {
                        CustomSqlHelper.CloseConnection(connection);
                    }

                    if (returnCode == 0)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Exception in IndicatedPageDeleteAllForPage", ex);
            }
        }
示例#3
0
        public bool IndicatedPageInsertNext(SqlConnection sqlConnection, SqlTransaction sqlTransaction, int pageID,
                                            string pagePrefix, string pageNumber, bool implied, int userId)
        {
            SqlConnection connection = CustomSqlHelper.CreateConnection(
                CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("IndicatedPageInsertNext", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("PageID", SqlDbType.Int, null, false, pageID),
                                                                      CustomSqlHelper.CreateInputParameter("PagePrefix", SqlDbType.NVarChar, 20, true, pagePrefix),
                                                                      CustomSqlHelper.CreateInputParameter("PageNumber", SqlDbType.NVarChar, 20, true, pageNumber),
                                                                      CustomSqlHelper.CreateInputParameter("Implied", SqlDbType.Bit, null, false, implied),
                                                                      CustomSqlHelper.CreateInputParameter("CreationUserID", SqlDbType.Int, null, false, userId),
                                                                      CustomSqlHelper.CreateInputParameter("LastModifiedUserID", SqlDbType.Int, null, false, userId),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                int returnCode = CustomSqlHelper.ExecuteNonQuery(command, "ReturnCode");

                if (transaction == null)
                {
                    CustomSqlHelper.CloseConnection(connection);
                }

                if (returnCode == 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
示例#4
0
        /// <summary>
        /// Delete values from Title_TitleIdentifier by primary key(s).
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="connectionKeyName">Connection key name located in config file.</param>
        /// <param name="title_TitleIdentifierID"></param>
        /// <returns>true if successful otherwise false.</returns>
        public bool Title_TitleIdentifierDeleteAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int title_TitleIdentifierID)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("Title_TitleIdentifierDeleteAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("Title_TitleIdentifierID", SqlDbType.Int, null, false, title_TitleIdentifierID),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                int returnCode = CustomSqlHelper.ExecuteNonQuery(command, "ReturnCode");

                if (transaction == null)
                {
                    CustomSqlHelper.CloseConnection(connection);
                }

                if (returnCode == 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
示例#5
0
        public void MarcUpdateStatusError(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int marcID)
        {
            SqlConnection connection = CustomSqlHelper.CreateConnection(
                CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("MarcUpdateStatusError", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("MarcID", SqlDbType.Int, null, false, marcID)))
            {
                CustomSqlHelper.ExecuteNonQuery(command);
            }
        }
示例#6
0
        /// <summary>
        /// Delete values from MonthlyStats by primary key(s).
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="connectionKeyName">Connection key name located in config file.</param>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <param name="institutionName"></param>
        /// <param name="statType"></param>
        /// <returns>true if successful otherwise false.</returns>
        public bool MonthlyStatsDeleteAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int year,
            int month,
            string institutionName,
            string statType)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("MonthlyStatsDeleteAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("Year", SqlDbType.Int, null, false, year),
                                                                      CustomSqlHelper.CreateInputParameter("Month", SqlDbType.Int, null, false, month),
                                                                      CustomSqlHelper.CreateInputParameter("InstitutionName", SqlDbType.NVarChar, 255, false, institutionName),
                                                                      CustomSqlHelper.CreateInputParameter("StatType", SqlDbType.NVarChar, 100, false, statType),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                int returnCode = CustomSqlHelper.ExecuteNonQuery(command, "ReturnCode");

                if (transaction == null)
                {
                    CustomSqlHelper.CloseConnection(connection);
                }

                if (returnCode == 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }