Exemple #1
0
        /// <summary>
        /// Update values in TitleItem. Returns an object of type TitleItem.
        /// </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="titleItemID"></param>
        /// <param name="titleID"></param>
        /// <param name="itemID"></param>
        /// <param name="itemSequence"></param>
        /// <returns>Object of type TitleItem.</returns>
        public TitleItem TitleItemUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int titleItemID,
            int titleID,
            int itemID,
            short?itemSequence)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleItemUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("TitleItemID", SqlDbType.Int, null, false, titleItemID),
                                                                      CustomSqlHelper.CreateInputParameter("TitleID", SqlDbType.Int, null, false, titleID),
                                                                      CustomSqlHelper.CreateInputParameter("ItemID", SqlDbType.Int, null, false, itemID),
                                                                      CustomSqlHelper.CreateInputParameter("ItemSequence", SqlDbType.SmallInt, null, true, itemSequence),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <TitleItem> helper = new CustomSqlHelper <TitleItem>())
                {
                    CustomGenericList <TitleItem> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        TitleItem o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
        /// <summary>
        /// Update values in Page_PageType. Returns an object of type Page_PageType.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="pageID">Unique identifier for each Page record.</param>
        /// <param name="pageTypeID">Unique identifier for each Page Type record.</param>
        /// <param name="verified"></param>
        /// <param name="lastModifiedUserID"></param>
        /// <returns>Object of type Page_PageType.</returns>
        public Page_PageType Page_PageTypeUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int pageID,
            int pageTypeID,
            bool verified,
            int?lastModifiedUserID)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("Page_PageTypeUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("PageID", SqlDbType.Int, null, false, pageID),
                                                                      CustomSqlHelper.CreateInputParameter("PageTypeID", SqlDbType.Int, null, false, pageTypeID),
                                                                      CustomSqlHelper.CreateInputParameter("Verified", SqlDbType.Bit, null, false, verified),
                                                                      CustomSqlHelper.CreateInputParameter("LastModifiedUserID", SqlDbType.Int, null, true, lastModifiedUserID),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <Page_PageType> helper = new CustomSqlHelper <Page_PageType>())
                {
                    CustomGenericList <Page_PageType> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        Page_PageType o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
        /// <summary>
        /// Update values in MarcSubField. Returns an object of type MarcSubField.
        /// </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="marcSubFieldID"></param>
        /// <param name="marcDataFieldID"></param>
        /// <param name="code"></param>
        /// <param name="value"></param>
        /// <returns>Object of type MarcSubField.</returns>
        public MarcSubField MarcSubFieldUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int marcSubFieldID,
            int marcDataFieldID,
            string code,
            string value)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("MarcSubFieldUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("MarcSubFieldID", SqlDbType.Int, null, false, marcSubFieldID),
                                                                      CustomSqlHelper.CreateInputParameter("MarcDataFieldID", SqlDbType.Int, null, false, marcDataFieldID),
                                                                      CustomSqlHelper.CreateInputParameter("Code", SqlDbType.NChar, 1, false, code),
                                                                      CustomSqlHelper.CreateInputParameter("Value", SqlDbType.NVarChar, 200, false, value),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <MarcSubField> helper = new CustomSqlHelper <MarcSubField>())
                {
                    CustomGenericList <MarcSubField> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        MarcSubField o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
        /// <summary>
        /// Update values in TitleAssociation_TitleIdentifier. Returns an object of type TitleAssociation_TitleIdentifier.
        /// </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="titleAssociation_TitleIdentifierID"></param>
        /// <param name="titleAssociationID"></param>
        /// <param name="titleIdentifierID"></param>
        /// <param name="identifierValue"></param>
        /// <returns>Object of type TitleAssociation_TitleIdentifier.</returns>
        public TitleAssociation_TitleIdentifier TitleAssociation_TitleIdentifierUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int titleAssociation_TitleIdentifierID,
            int titleAssociationID,
            int titleIdentifierID,
            string identifierValue)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleAssociation_TitleIdentifierUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("TitleAssociation_TitleIdentifierID", SqlDbType.Int, null, false, titleAssociation_TitleIdentifierID),
                                                                      CustomSqlHelper.CreateInputParameter("TitleAssociationID", SqlDbType.Int, null, false, titleAssociationID),
                                                                      CustomSqlHelper.CreateInputParameter("TitleIdentifierID", SqlDbType.Int, null, false, titleIdentifierID),
                                                                      CustomSqlHelper.CreateInputParameter("IdentifierValue", SqlDbType.VarChar, 125, false, identifierValue),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <TitleAssociation_TitleIdentifier> helper = new CustomSqlHelper <TitleAssociation_TitleIdentifier>())
                {
                    CustomGenericList <TitleAssociation_TitleIdentifier> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        TitleAssociation_TitleIdentifier o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #5
0
        /// <summary>
        /// Insert values into Language.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="languageCode">Code for a language.</param>
        /// <param name="languageName">Name used for the language.</param>
        /// <param name="note">Notes about this Language and its use.</param>
        /// <returns>Object of type Language.</returns>
        public Language LanguageInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string languageCode,
            string languageName,
            string note)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("LanguageInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("LanguageCode", SqlDbType.NVarChar, 10, false, languageCode),
                                                                      CustomSqlHelper.CreateInputParameter("LanguageName", SqlDbType.NVarChar, 20, false, languageName),
                                                                      CustomSqlHelper.CreateInputParameter("Note", SqlDbType.NVarChar, 255, true, note),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <Language> helper = new CustomSqlHelper <Language>())
                {
                    CustomGenericList <Language> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        Language o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #6
0
        /// <summary>
        /// Update values in TitleTag. Returns an object of type TitleTag.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="titleID"></param>
        /// <param name="tagText"></param>
        /// <param name="marcDataFieldTag"></param>
        /// <param name="marcSubFieldCode"></param>
        /// <returns>Object of type TitleTag.</returns>
        public TitleTag TitleTagUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int titleID,
            string tagText,
            string marcDataFieldTag,
            string marcSubFieldCode)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleTagUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("TitleID", SqlDbType.Int, null, false, titleID),
                                                                      CustomSqlHelper.CreateInputParameter("TagText", SqlDbType.NVarChar, 50, false, tagText),
                                                                      CustomSqlHelper.CreateInputParameter("MarcDataFieldTag", SqlDbType.NVarChar, 50, true, marcDataFieldTag),
                                                                      CustomSqlHelper.CreateInputParameter("MarcSubFieldCode", SqlDbType.NVarChar, 50, true, marcSubFieldCode),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <TitleTag> helper = new CustomSqlHelper <TitleTag>())
                {
                    CustomGenericList <TitleTag> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        TitleTag o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
        /// <summary>
        /// Delete values from Institution 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="institutionCode">Code for Institution providing assistance.</param>
        /// <returns>true if successful otherwise false.</returns>
        public bool InstitutionDeleteAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            string institutionCode)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("InstitutionDeleteAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("InstitutionCode", SqlDbType.NVarChar, 10, false, institutionCode),
                                                                      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);
                }
            }
        }
Exemple #8
0
        /// <summary>
        /// Update values in MarcImportBatch. Returns an object of type MarcImportBatch.
        /// </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="marcImportBatchID"></param>
        /// <param name="fileName"></param>
        /// <param name="institutionCode"></param>
        /// <returns>Object of type MarcImportBatch.</returns>
        public MarcImportBatch MarcImportBatchUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int marcImportBatchID,
            string fileName,
            string institutionCode)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("MarcImportBatchUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("MarcImportBatchID", SqlDbType.Int, null, false, marcImportBatchID),
                                                                      CustomSqlHelper.CreateInputParameter("FileName", SqlDbType.NVarChar, 500, false, fileName),
                                                                      CustomSqlHelper.CreateInputParameter("InstitutionCode", SqlDbType.NVarChar, 10, true, institutionCode),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <MarcImportBatch> helper = new CustomSqlHelper <MarcImportBatch>())
                {
                    CustomGenericList <MarcImportBatch> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        MarcImportBatch o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #9
0
        /// <summary>
        /// Update values in PDFStatus. Returns an object of type PDFStatus.
        /// </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="pdfStatusID"></param>
        /// <param name="pdfStatusName"></param>
        /// <returns>Object of type PDFStatus.</returns>
        public PDFStatus PDFStatusUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int pdfStatusID,
            string pdfStatusName)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("PDFStatusUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("PdfStatusID", SqlDbType.Int, null, false, pdfStatusID),
                                                                      CustomSqlHelper.CreateInputParameter("PdfStatusName", SqlDbType.NChar, 10, false, pdfStatusName),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <PDFStatus> helper = new CustomSqlHelper <PDFStatus>())
                {
                    CustomGenericList <PDFStatus> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        PDFStatus o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #10
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);
                }
            }
        }
        /// <summary>
        /// Update values in TitleLanguage. Returns an object of type TitleLanguage.
        /// </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="titleLanguageID"></param>
        /// <param name="titleID"></param>
        /// <param name="languageCode"></param>
        /// <returns>Object of type TitleLanguage.</returns>
        public TitleLanguage TitleLanguageUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int titleLanguageID,
            int titleID,
            string languageCode)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleLanguageUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("TitleLanguageID", SqlDbType.Int, null, false, titleLanguageID),
                                                                      CustomSqlHelper.CreateInputParameter("TitleID", SqlDbType.Int, null, false, titleID),
                                                                      CustomSqlHelper.CreateInputParameter("LanguageCode", SqlDbType.NVarChar, 10, false, languageCode),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <TitleLanguage> helper = new CustomSqlHelper <TitleLanguage>())
                {
                    CustomGenericList <TitleLanguage> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        TitleLanguage o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
        /// <summary>
        /// Update values in CreatorRoleType. Returns an object of type CreatorRoleType.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="creatorRoleTypeID">Unique identifier for each Creator Role Type.</param>
        /// <param name="creatorRoleType">A type of Role performed by a Creator.</param>
        /// <param name="creatorRoleTypeDescription">Description of a Creator Role Type.</param>
        /// <param name="mARCDataFieldTag">Data Field Tag from MARC XML.</param>
        /// <returns>Object of type CreatorRoleType.</returns>
        public CreatorRoleType CreatorRoleTypeUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int creatorRoleTypeID,
            string creatorRoleType,
            string creatorRoleTypeDescription,
            string mARCDataFieldTag)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("CreatorRoleTypeUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("CreatorRoleTypeID", SqlDbType.Int, null, false, creatorRoleTypeID),
                                                                      CustomSqlHelper.CreateInputParameter("CreatorRoleType", SqlDbType.NVarChar, 25, false, creatorRoleType),
                                                                      CustomSqlHelper.CreateInputParameter("CreatorRoleTypeDescription", SqlDbType.NVarChar, 255, true, creatorRoleTypeDescription),
                                                                      CustomSqlHelper.CreateInputParameter("MARCDataFieldTag", SqlDbType.NVarChar, 3, true, mARCDataFieldTag),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <CreatorRoleType> helper = new CustomSqlHelper <CreatorRoleType>())
                {
                    CustomGenericList <CreatorRoleType> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        CreatorRoleType o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
        /// <summary>
        /// Insert values into TitleIdentifier.
        /// </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="identifierName"></param>
        /// <param name="marcDataFieldTag"></param>
        /// <param name="marcSubFieldCode"></param>
        /// <returns>Object of type TitleIdentifier.</returns>
        public TitleIdentifier TitleIdentifierInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            string identifierName,
            string marcDataFieldTag,
            string marcSubFieldCode)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleIdentifierInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("TitleIdentifierID", SqlDbType.Int, null, false),
                                                                      CustomSqlHelper.CreateInputParameter("IdentifierName", SqlDbType.NVarChar, 40, false, identifierName),
                                                                      CustomSqlHelper.CreateInputParameter("MarcDataFieldTag", SqlDbType.NVarChar, 50, false, marcDataFieldTag),
                                                                      CustomSqlHelper.CreateInputParameter("MarcSubFieldCode", SqlDbType.NVarChar, 50, false, marcSubFieldCode),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <TitleIdentifier> helper = new CustomSqlHelper <TitleIdentifier>())
                {
                    CustomGenericList <TitleIdentifier> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        TitleIdentifier o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #14
0
        /// <summary>
        /// Insert values into ItemStatus.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="itemStatusID"></param>
        /// <param name="itemStatusName"></param>
        /// <returns>Object of type ItemStatus.</returns>
        public ItemStatus ItemStatusInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int itemStatusID,
            string itemStatusName)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("ItemStatusInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("ItemStatusID", SqlDbType.Int, null, false, itemStatusID),
                                                                      CustomSqlHelper.CreateInputParameter("ItemStatusName", SqlDbType.NVarChar, 50, false, itemStatusName),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <ItemStatus> helper = new CustomSqlHelper <ItemStatus>())
                {
                    CustomGenericList <ItemStatus> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        ItemStatus o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
        /// <summary>
        /// Delete values from TitleAssociation_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="titleAssociation_TitleIdentifierID"></param>
        /// <returns>true if successful otherwise false.</returns>
        public bool TitleAssociation_TitleIdentifierDeleteAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int titleAssociation_TitleIdentifierID)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleAssociation_TitleIdentifierDeleteAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("TitleAssociation_TitleIdentifierID", SqlDbType.Int, null, false, titleAssociation_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);
                }
            }
        }
Exemple #16
0
        /// <summary>
        /// Delete values from IndicatedPage by primary key(s).
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="pageID">Unique identifier for each Page record.</param>
        /// <param name="sequence">A number to separately identify various series of Indicated Pages.</param>
        /// <returns>true if successful otherwise false.</returns>
        public bool IndicatedPageDeleteAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int pageID,
            short sequence)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("IndicatedPageDeleteAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("PageID", SqlDbType.Int, null, false, pageID),
                                                                      CustomSqlHelper.CreateInputParameter("Sequence", SqlDbType.SmallInt, null, false, sequence),
                                                                      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);
                }
            }
        }
Exemple #17
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);
            }
        }
        /// <summary>
        /// Delete values from CreatorRoleType by primary key(s).
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="creatorRoleTypeID">Unique identifier for each Creator Role Type.</param>
        /// <returns>true if successful otherwise false.</returns>
        public bool CreatorRoleTypeDeleteAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int creatorRoleTypeID)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("CreatorRoleTypeDeleteAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("CreatorRoleTypeID", SqlDbType.Int, null, false, creatorRoleTypeID),
                                                                      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);
                }
            }
        }
Exemple #19
0
        /// <summary>
        /// Insert values into TitleType.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="titleTypeID">Unique identifier for each Title Type record.</param>
        /// <param name="titleType">A Type to be associated with a Title.</param>
        /// <param name="titleTypeDescription">Description of a Title Type.</param>
        /// <returns>Object of type TitleType.</returns>
        public TitleType TitleTypeInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int titleTypeID,
            string titleType,
            string titleTypeDescription)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleTypeInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("TitleTypeID", SqlDbType.Int, null, false, titleTypeID),
                                                                      CustomSqlHelper.CreateInputParameter("TitleType", SqlDbType.NVarChar, 25, false, titleType),
                                                                      CustomSqlHelper.CreateInputParameter("TitleTypeDescription", SqlDbType.NVarChar, 80, true, titleTypeDescription),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <TitleType> helper = new CustomSqlHelper <TitleType>())
                {
                    CustomGenericList <TitleType> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        TitleType o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #20
0
        /// <summary>
        /// Update values in PDF. Returns an object of type PDF.
        /// </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="pdfID"></param>
        /// <param name="itemID"></param>
        /// <param name="emailAddress"></param>
        /// <param name="shareWithEmailAddresses"></param>
        /// <param name="imagesOnly"></param>
        /// <param name="articleTitle"></param>
        /// <param name="articleCreators"></param>
        /// <param name="articleTags"></param>
        /// <param name="fileLocation"></param>
        /// <param name="fileUrl"></param>
        /// <param name="fileGenerationDate"></param>
        /// <param name="fileDeletionDate"></param>
        /// <param name="pdfStatusID"></param>
        /// <param name="numberImagesMissing"></param>
        /// <param name="numberOcrMissing"></param>
        /// <param name="comment"></param>
        /// <returns>Object of type PDF.</returns>
        public PDF PDFUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int pdfID,
            int itemID,
            string emailAddress,
            string shareWithEmailAddresses,
            bool imagesOnly,
            string articleTitle,
            string articleCreators,
            string articleTags,
            string fileLocation,
            string fileUrl,
            DateTime?fileGenerationDate,
            DateTime?fileDeletionDate,
            int pdfStatusID,
            int numberImagesMissing,
            int numberOcrMissing,
            string comment)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("PDFUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("PdfID", SqlDbType.Int, null, false, pdfID),
                                                                      CustomSqlHelper.CreateInputParameter("ItemID", SqlDbType.Int, null, false, itemID),
                                                                      CustomSqlHelper.CreateInputParameter("EmailAddress", SqlDbType.NVarChar, 200, false, emailAddress),
                                                                      CustomSqlHelper.CreateInputParameter("ShareWithEmailAddresses", SqlDbType.NVarChar, 1073741823, false, shareWithEmailAddresses),
                                                                      CustomSqlHelper.CreateInputParameter("ImagesOnly", SqlDbType.Bit, null, false, imagesOnly),
                                                                      CustomSqlHelper.CreateInputParameter("ArticleTitle", SqlDbType.NVarChar, 1073741823, false, articleTitle),
                                                                      CustomSqlHelper.CreateInputParameter("ArticleCreators", SqlDbType.NVarChar, 1073741823, false, articleCreators),
                                                                      CustomSqlHelper.CreateInputParameter("ArticleTags", SqlDbType.NVarChar, 1073741823, false, articleTags),
                                                                      CustomSqlHelper.CreateInputParameter("FileLocation", SqlDbType.NVarChar, 200, false, fileLocation),
                                                                      CustomSqlHelper.CreateInputParameter("FileUrl", SqlDbType.NVarChar, 200, false, fileUrl),
                                                                      CustomSqlHelper.CreateInputParameter("FileGenerationDate", SqlDbType.DateTime, null, true, fileGenerationDate),
                                                                      CustomSqlHelper.CreateInputParameter("FileDeletionDate", SqlDbType.DateTime, null, true, fileDeletionDate),
                                                                      CustomSqlHelper.CreateInputParameter("PdfStatusID", SqlDbType.Int, null, false, pdfStatusID),
                                                                      CustomSqlHelper.CreateInputParameter("NumberImagesMissing", SqlDbType.Int, null, false, numberImagesMissing),
                                                                      CustomSqlHelper.CreateInputParameter("NumberOcrMissing", SqlDbType.Int, null, false, numberOcrMissing),
                                                                      CustomSqlHelper.CreateInputParameter("Comment", SqlDbType.NVarChar, 1073741823, false, comment),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <PDF> helper = new CustomSqlHelper <PDF>())
                {
                    CustomGenericList <PDF> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        PDF o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #21
0
        /// <summary>
        /// Update values in Creator. Returns an object of type Creator.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="creatorID">Unique identifier for each Creator record.</param>
        /// <param name="creatorName">Creator name in last name first order.</param>
        /// <param name="firstNameFirst">Creator name in first name first order.</param>
        /// <param name="simpleName">Name using simple English alphabet (first name first).</param>
        /// <param name="dOB">Creator's date of birth.</param>
        /// <param name="dOD">Creator's date of death.</param>
        /// <param name="biography">Biography of the Creator.</param>
        /// <param name="creatorNote">Notes about this Creator.</param>
        /// <param name="mARCDataFieldTag">MARC XML DataFieldTag providing this record.</param>
        /// <param name="mARCCreator_a">"a" field from MARC XML</param>
        /// <param name="mARCCreator_b">"b" field from MARC XML</param>
        /// <param name="mARCCreator_c">"c" field from MARC XML</param>
        /// <param name="mARCCreator_d">"d" field from MARC XML</param>
        /// <param name="mARCCreator_Full">"Full" Creator information from MARC XML</param>
        /// <returns>Object of type Creator.</returns>
        public Creator CreatorUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int creatorID,
            string creatorName,
            string firstNameFirst,
            string simpleName,
            string dOB,
            string dOD,
            string biography,
            string creatorNote,
            string mARCDataFieldTag,
            string mARCCreator_a,
            string mARCCreator_b,
            string mARCCreator_c,
            string mARCCreator_d,
            string mARCCreator_Full)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("CreatorUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("CreatorID", SqlDbType.Int, null, false, creatorID),
                                                                      CustomSqlHelper.CreateInputParameter("CreatorName", SqlDbType.NVarChar, 255, false, creatorName),
                                                                      CustomSqlHelper.CreateInputParameter("FirstNameFirst", SqlDbType.NVarChar, 255, true, firstNameFirst),
                                                                      CustomSqlHelper.CreateInputParameter("SimpleName", SqlDbType.NVarChar, 255, true, simpleName),
                                                                      CustomSqlHelper.CreateInputParameter("DOB", SqlDbType.NVarChar, 50, true, dOB),
                                                                      CustomSqlHelper.CreateInputParameter("DOD", SqlDbType.NVarChar, 50, true, dOD),
                                                                      CustomSqlHelper.CreateInputParameter("Biography", SqlDbType.NText, 1073741823, true, biography),
                                                                      CustomSqlHelper.CreateInputParameter("CreatorNote", SqlDbType.NVarChar, 255, true, creatorNote),
                                                                      CustomSqlHelper.CreateInputParameter("MARCDataFieldTag", SqlDbType.NVarChar, 3, true, mARCDataFieldTag),
                                                                      CustomSqlHelper.CreateInputParameter("MARCCreator_a", SqlDbType.NVarChar, 450, true, mARCCreator_a),
                                                                      CustomSqlHelper.CreateInputParameter("MARCCreator_b", SqlDbType.NVarChar, 450, true, mARCCreator_b),
                                                                      CustomSqlHelper.CreateInputParameter("MARCCreator_c", SqlDbType.NVarChar, 450, true, mARCCreator_c),
                                                                      CustomSqlHelper.CreateInputParameter("MARCCreator_d", SqlDbType.NVarChar, 450, true, mARCCreator_d),
                                                                      CustomSqlHelper.CreateInputParameter("MARCCreator_Full", SqlDbType.NVarChar, 450, true, mARCCreator_Full),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <Creator> helper = new CustomSqlHelper <Creator>())
                {
                    CustomGenericList <Creator> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        Creator o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #22
0
        /// <summary>
        /// Update values in TitleAssociation. Returns an object of type TitleAssociation.
        /// </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="titleAssociationID"></param>
        /// <param name="titleID"></param>
        /// <param name="titleAssociationTypeID"></param>
        /// <param name="title"></param>
        /// <param name="section"></param>
        /// <param name="volume"></param>
        /// <param name="heading"></param>
        /// <param name="publication"></param>
        /// <param name="relationship"></param>
        /// <param name="active"></param>
        /// <param name="associatedTitleID"></param>
        /// <returns>Object of type TitleAssociation.</returns>
        public TitleAssociation TitleAssociationUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int titleAssociationID,
            int titleID,
            int titleAssociationTypeID,
            string title,
            string section,
            string volume,
            string heading,
            string publication,
            string relationship,
            bool active,
            int?associatedTitleID)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleAssociationUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("TitleAssociationID", SqlDbType.Int, null, false, titleAssociationID),
                                                                      CustomSqlHelper.CreateInputParameter("TitleID", SqlDbType.Int, null, false, titleID),
                                                                      CustomSqlHelper.CreateInputParameter("TitleAssociationTypeID", SqlDbType.Int, null, false, titleAssociationTypeID),
                                                                      CustomSqlHelper.CreateInputParameter("Title", SqlDbType.NVarChar, 500, false, title),
                                                                      CustomSqlHelper.CreateInputParameter("Section", SqlDbType.NVarChar, 500, false, section),
                                                                      CustomSqlHelper.CreateInputParameter("Volume", SqlDbType.NVarChar, 500, false, volume),
                                                                      CustomSqlHelper.CreateInputParameter("Heading", SqlDbType.NVarChar, 500, false, heading),
                                                                      CustomSqlHelper.CreateInputParameter("Publication", SqlDbType.NVarChar, 500, false, publication),
                                                                      CustomSqlHelper.CreateInputParameter("Relationship", SqlDbType.NVarChar, 500, false, relationship),
                                                                      CustomSqlHelper.CreateInputParameter("Active", SqlDbType.Bit, null, false, active),
                                                                      CustomSqlHelper.CreateInputParameter("AssociatedTitleID", SqlDbType.Int, null, true, associatedTitleID),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <TitleAssociation> helper = new CustomSqlHelper <TitleAssociation>())
                {
                    CustomGenericList <TitleAssociation> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        TitleAssociation o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #23
0
        /// <summary>
        /// Update values in PageName. Returns an object of type PageName.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="pageNameID"></param>
        /// <param name="pageID"></param>
        /// <param name="source"></param>
        /// <param name="nameFound"></param>
        /// <param name="nameConfirmed"></param>
        /// <param name="nameBankID"></param>
        /// <param name="active"></param>
        /// <param name="isCommonName"></param>
        /// <returns>Object of type PageName.</returns>
        public PageName PageNameUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int pageNameID,
            int pageID,
            string source,
            string nameFound,
            string nameConfirmed,
            int?nameBankID,
            bool active,
            bool?isCommonName)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("PageNameUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("PageNameID", SqlDbType.Int, null, false, pageNameID),
                                                                      CustomSqlHelper.CreateInputParameter("PageID", SqlDbType.Int, null, false, pageID),
                                                                      CustomSqlHelper.CreateInputParameter("Source", SqlDbType.NVarChar, 50, true, source),
                                                                      CustomSqlHelper.CreateInputParameter("NameFound", SqlDbType.NVarChar, 100, false, nameFound),
                                                                      CustomSqlHelper.CreateInputParameter("NameConfirmed", SqlDbType.NVarChar, 100, true, nameConfirmed),
                                                                      CustomSqlHelper.CreateInputParameter("NameBankID", SqlDbType.Int, null, true, nameBankID),
                                                                      CustomSqlHelper.CreateInputParameter("Active", SqlDbType.Bit, null, false, active),
                                                                      CustomSqlHelper.CreateInputParameter("IsCommonName", SqlDbType.Bit, null, true, isCommonName),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <PageName> helper = new CustomSqlHelper <PageName>())
                {
                    CustomGenericList <PageName> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        PageName o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #24
0
        /// <summary>
        /// Insert values into IndicatedPage.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="pageID">Unique identifier for each Page record.</param>
        /// <param name="sequence">A number to separately identify various series of Indicated Pages.</param>
        /// <param name="pagePrefix">Prefix portion of Indicated Page.</param>
        /// <param name="pageNumber">Page Number portion of Indicated Page.</param>
        /// <param name="implied"></param>
        /// <param name="creationUserID"></param>
        /// <param name="lastModifiedUserID"></param>
        /// <returns>Object of type IndicatedPage.</returns>
        public IndicatedPage IndicatedPageInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int pageID,
            short sequence,
            string pagePrefix,
            string pageNumber,
            bool implied,
            int?creationUserID,
            int?lastModifiedUserID)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("IndicatedPageInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("PageID", SqlDbType.Int, null, false, pageID),
                                                                      CustomSqlHelper.CreateInputParameter("Sequence", SqlDbType.SmallInt, null, false, sequence),
                                                                      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, true, creationUserID),
                                                                      CustomSqlHelper.CreateInputParameter("LastModifiedUserID", SqlDbType.Int, null, true, lastModifiedUserID),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <IndicatedPage> helper = new CustomSqlHelper <IndicatedPage>())
                {
                    CustomGenericList <IndicatedPage> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        IndicatedPage o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #25
0
        /// <summary>
        /// Insert values into Marc.
        /// </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="marcImportStatusID"></param>
        /// <param name="marcImportBatchID"></param>
        /// <param name="marcFileLocation"></param>
        /// <param name="institutionCode"></param>
        /// <param name="leader"></param>
        /// <param name="titleID"></param>
        /// <returns>Object of type Marc.</returns>
        public Marc MarcInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int marcImportStatusID,
            int marcImportBatchID,
            string marcFileLocation,
            string institutionCode,
            string leader,
            int?titleID)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("MarcInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("MarcID", SqlDbType.Int, null, false),
                                                                      CustomSqlHelper.CreateInputParameter("MarcImportStatusID", SqlDbType.Int, null, false, marcImportStatusID),
                                                                      CustomSqlHelper.CreateInputParameter("MarcImportBatchID", SqlDbType.Int, null, false, marcImportBatchID),
                                                                      CustomSqlHelper.CreateInputParameter("MarcFileLocation", SqlDbType.NVarChar, 500, false, marcFileLocation),
                                                                      CustomSqlHelper.CreateInputParameter("InstitutionCode", SqlDbType.NVarChar, 10, true, institutionCode),
                                                                      CustomSqlHelper.CreateInputParameter("Leader", SqlDbType.NVarChar, 200, false, leader),
                                                                      CustomSqlHelper.CreateInputParameter("TitleID", SqlDbType.Int, null, true, titleID),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <Marc> helper = new CustomSqlHelper <Marc>())
                {
                    CustomGenericList <Marc> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        Marc o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #26
0
        /// <summary>
        /// Update values in TitleAssociationType. Returns an object of type TitleAssociationType.
        /// </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="titleAssociationTypeID"></param>
        /// <param name="titleAssociationName"></param>
        /// <param name="mARCTag"></param>
        /// <param name="mARCIndicator2"></param>
        /// <param name="titleAssociationLabel"></param>
        /// <returns>Object of type TitleAssociationType.</returns>
        public TitleAssociationType TitleAssociationTypeUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int titleAssociationTypeID,
            string titleAssociationName,
            string mARCTag,
            string mARCIndicator2,
            string titleAssociationLabel)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleAssociationTypeUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("TitleAssociationTypeID", SqlDbType.Int, null, false, titleAssociationTypeID),
                                                                      CustomSqlHelper.CreateInputParameter("TitleAssociationName", SqlDbType.NVarChar, 60, false, titleAssociationName),
                                                                      CustomSqlHelper.CreateInputParameter("MARCTag", SqlDbType.NVarChar, 20, false, mARCTag),
                                                                      CustomSqlHelper.CreateInputParameter("MARCIndicator2", SqlDbType.NChar, 1, false, mARCIndicator2),
                                                                      CustomSqlHelper.CreateInputParameter("TitleAssociationLabel", SqlDbType.NVarChar, 30, false, titleAssociationLabel),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <TitleAssociationType> helper = new CustomSqlHelper <TitleAssociationType>())
                {
                    CustomGenericList <TitleAssociationType> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        TitleAssociationType o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #27
0
        /// <summary>
        /// Insert values into Title_Creator.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="titleID">Unique identifier for each Title record.</param>
        /// <param name="creatorID">Unique identifier for each Creator record.</param>
        /// <param name="creatorRoleTypeID">Unique identifier for each Creator Role Type.</param>
        /// <param name="creationUserID"></param>
        /// <param name="lastModifiedUserID"></param>
        /// <returns>Object of type Title_Creator.</returns>
        public Title_Creator Title_CreatorInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int titleID,
            int creatorID,
            int creatorRoleTypeID,
            int?creationUserID,
            int?lastModifiedUserID)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("Title_CreatorInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("Title_CreatorID", SqlDbType.Int, null, false),
                                                                      CustomSqlHelper.CreateInputParameter("TitleID", SqlDbType.Int, null, false, titleID),
                                                                      CustomSqlHelper.CreateInputParameter("CreatorID", SqlDbType.Int, null, false, creatorID),
                                                                      CustomSqlHelper.CreateInputParameter("CreatorRoleTypeID", SqlDbType.Int, null, false, creatorRoleTypeID),
                                                                      CustomSqlHelper.CreateInputParameter("CreationUserID", SqlDbType.Int, null, true, creationUserID),
                                                                      CustomSqlHelper.CreateInputParameter("LastModifiedUserID", SqlDbType.Int, null, true, lastModifiedUserID),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <Title_Creator> helper = new CustomSqlHelper <Title_Creator>())
                {
                    CustomGenericList <Title_Creator> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        Title_Creator o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
        /// <summary>
        /// Update values in MonthlyStats. Returns an object of type MonthlyStats.
        /// </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>
        /// <param name="statValue"></param>
        /// <returns>Object of type MonthlyStats.</returns>
        public MonthlyStats MonthlyStatsUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int year,
            int month,
            string institutionName,
            string statType,
            int statValue)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("MonthlyStatsUpdateAuto", 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.CreateInputParameter("StatValue", SqlDbType.Int, null, false, statValue),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <MonthlyStats> helper = new CustomSqlHelper <MonthlyStats>())
                {
                    CustomGenericList <MonthlyStats> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        MonthlyStats o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemple #29
0
        /// <summary>
        /// Update values in Location. Returns an object of type Location.
        /// </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="locationName"></param>
        /// <param name="latitude"></param>
        /// <param name="longitude"></param>
        /// <param name="nextAttemptDate"></param>
        /// <param name="includeInUI"></param>
        /// <returns>Object of type Location.</returns>
        public Location LocationUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            string locationName,
            string latitude,
            string longitude,
            DateTime?nextAttemptDate,
            bool includeInUI)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("LocationUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("LocationName", SqlDbType.NVarChar, 50, false, locationName),
                                                                      CustomSqlHelper.CreateInputParameter("Latitude", SqlDbType.VarChar, 20, true, latitude),
                                                                      CustomSqlHelper.CreateInputParameter("Longitude", SqlDbType.VarChar, 20, true, longitude),
                                                                      CustomSqlHelper.CreateInputParameter("NextAttemptDate", SqlDbType.DateTime, null, true, nextAttemptDate),
                                                                      CustomSqlHelper.CreateInputParameter("IncludeInUI", SqlDbType.Bit, null, false, includeInUI),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <Location> helper = new CustomSqlHelper <Location>())
                {
                    CustomGenericList <Location> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        Location o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
        /// <summary>
        /// Update values in Institution. Returns an object of type Institution.
        /// </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="institutionCode">Code for Institution providing assistance.</param>
        /// <param name="institutionName">Name for the Institution.</param>
        /// <param name="note">Notes about this Institution.</param>
        /// <param name="institutionUrl"></param>
        /// <param name="bHLMemberLibrary"></param>
        /// <returns>Object of type Institution.</returns>
        public Institution InstitutionUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            string institutionCode,
            string institutionName,
            string note,
            string institutionUrl,
            bool bHLMemberLibrary)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("InstitutionUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("InstitutionCode", SqlDbType.NVarChar, 10, false, institutionCode),
                                                                      CustomSqlHelper.CreateInputParameter("InstitutionName", SqlDbType.NVarChar, 255, false, institutionName),
                                                                      CustomSqlHelper.CreateInputParameter("Note", SqlDbType.NVarChar, 255, true, note),
                                                                      CustomSqlHelper.CreateInputParameter("InstitutionUrl", SqlDbType.NVarChar, 255, true, institutionUrl),
                                                                      CustomSqlHelper.CreateInputParameter("BHLMemberLibrary", SqlDbType.Bit, null, false, bHLMemberLibrary),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <Institution> helper = new CustomSqlHelper <Institution>())
                {
                    CustomGenericList <Institution> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        Institution o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }