Exemplo n.º 1
0
        /// <summary>
        /// Insert values into ItemLanguage.
        /// </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="itemID"></param>
        /// <param name="languageCode"></param>
        /// <returns>Object of type ItemLanguage.</returns>
        public ItemLanguage ItemLanguageInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int itemID,
            string languageCode)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("ItemLanguageInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("ItemLanguageID", SqlDbType.Int, null, false),
                                                                      CustomSqlHelper.CreateInputParameter("ItemID", SqlDbType.Int, null, false, itemID),
                                                                      CustomSqlHelper.CreateInputParameter("LanguageCode", SqlDbType.NVarChar, 10, false, languageCode),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <ItemLanguage> helper = new CustomSqlHelper <ItemLanguage>())
                {
                    CustomGenericList <ItemLanguage> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        ItemLanguage o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
        /// <summary>
        /// Insert values into 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="titleAssociationID"></param>
        /// <param name="titleIdentifierID"></param>
        /// <param name="identifierValue"></param>
        /// <returns>Object of type TitleAssociation_TitleIdentifier.</returns>
        public TitleAssociation_TitleIdentifier TitleAssociation_TitleIdentifierInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int titleAssociationID,
            int titleIdentifierID,
            string identifierValue)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleAssociation_TitleIdentifierInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("TitleAssociation_TitleIdentifierID", SqlDbType.Int, null, false),
                                                                      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);
                    }
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Insert values into 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="marcDataFieldID"></param>
        /// <param name="code"></param>
        /// <param name="value"></param>
        /// <returns>Object of type MarcSubField.</returns>
        public MarcSubField MarcSubFieldInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int marcDataFieldID,
            string code,
            string value)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("MarcSubFieldInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("MarcSubFieldID", SqlDbType.Int, null, false),
                                                                      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);
                    }
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Insert values into PageType.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="pageTypeName">Name of a Page Type.</param>
        /// <param name="pageTypeDescription">Description of the Page Type.</param>
        /// <returns>Object of type PageType.</returns>
        public PageType PageTypeInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string pageTypeName,
            string pageTypeDescription)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("PageTypeInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("PageTypeID", SqlDbType.Int, null, false),
                                                                      CustomSqlHelper.CreateInputParameter("PageTypeName", SqlDbType.NVarChar, 30, false, pageTypeName),
                                                                      CustomSqlHelper.CreateInputParameter("PageTypeDescription", SqlDbType.NVarChar, 255, true, pageTypeDescription),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <PageType> helper = new CustomSqlHelper <PageType>())
                {
                    CustomGenericList <PageType> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        PageType o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Insert values into Title_TitleType.
        /// </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="titleTypeID">Unique identifier for each Title Type record.</param>
        /// <returns>Object of type Title_TitleType.</returns>
        public Title_TitleType Title_TitleTypeInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int titleID,
            int titleTypeID)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("Title_TitleTypeInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("Title_TitleTypeID", SqlDbType.Int, null, false),
                                                                      CustomSqlHelper.CreateInputParameter("TitleID", SqlDbType.Int, null, false, titleID),
                                                                      CustomSqlHelper.CreateInputParameter("TitleTypeID", SqlDbType.Int, null, false, titleTypeID),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <Title_TitleType> helper = new CustomSqlHelper <Title_TitleType>())
                {
                    CustomGenericList <Title_TitleType> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        Title_TitleType o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Insert values into 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="titleID"></param>
        /// <param name="itemID"></param>
        /// <param name="itemSequence"></param>
        /// <returns>Object of type TitleItem.</returns>
        public TitleItem TitleItemInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int titleID,
            int itemID,
            short?itemSequence)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleItemInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("TitleItemID", SqlDbType.Int, null, false),
                                                                      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);
                    }
                }
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Insert values into 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="fileName"></param>
        /// <param name="institutionCode"></param>
        /// <returns>Object of type MarcImportBatch.</returns>
        public MarcImportBatch MarcImportBatchInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            string fileName,
            string institutionCode)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("MarcImportBatchInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("MarcImportBatchID", SqlDbType.Int, null, false),
                                                                      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);
                    }
                }
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Insert values into 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="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 PDFInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            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("PDFInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("PdfID", SqlDbType.Int, null, false),
                                                                      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);
                    }
                }
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Insert values into Creator.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</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 CreatorInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            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("CreatorInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("CreatorID", SqlDbType.Int, null, false),
                                                                      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);
                    }
                }
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// Insert values into 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="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 TitleAssociationInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            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("TitleAssociationInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("TitleAssociationID", SqlDbType.Int, null, false),
                                                                      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);
                    }
                }
            }
        }
Exemplo n.º 11
0
        public bool PDFUpdatePdfStatus(SqlConnection sqlConnection, SqlTransaction sqlTransaction,
                                       int PdfId,
                                       int PdfStatusId
                                       )
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("PDFUpdatePdfStatus", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("PdfID", SqlDbType.Int, null, false, PdfId),
                                                                      CustomSqlHelper.CreateInputParameter("PdfStatusID", SqlDbType.Int, null, false, PdfStatusId),
                                                                      CustomSqlHelper.CreateOutputParameter("RowsUpdated", SqlDbType.Int, null, false)))
            {
                command.ExecuteNonQuery();
                // If RowsUpdated > 0, then a row was updated (return true)
                return((int)command.Parameters[2].Value > 0);
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// Insert values into PageName.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</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 PageNameInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            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("PageNameInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("PageNameID", SqlDbType.Int, null, false),
                                                                      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);
                    }
                }
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// Insert values into 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="titleAssociationName"></param>
        /// <param name="mARCTag"></param>
        /// <param name="mARCIndicator2"></param>
        /// <param name="titleAssociationLabel"></param>
        /// <returns>Object of type TitleAssociationType.</returns>
        public TitleAssociationType TitleAssociationTypeInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            string titleAssociationName,
            string mARCTag,
            string mARCIndicator2,
            string titleAssociationLabel)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleAssociationTypeInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("TitleAssociationTypeID", SqlDbType.Int, null, false),
                                                                      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);
                    }
                }
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// Insert values into Title.
        /// </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="mARCBibID"></param>
        /// <param name="mARCLeader"></param>
        /// <param name="tropicosTitleID"></param>
        /// <param name="redirectTitleID"></param>
        /// <param name="fullTitle"></param>
        /// <param name="shortTitle"></param>
        /// <param name="uniformTitle"></param>
        /// <param name="sortTitle"></param>
        /// <param name="partNumber"></param>
        /// <param name="partName"></param>
        /// <param name="callNumber"></param>
        /// <param name="publicationDetails"></param>
        /// <param name="startYear"></param>
        /// <param name="endYear"></param>
        /// <param name="datafield_260_a"></param>
        /// <param name="datafield_260_b"></param>
        /// <param name="datafield_260_c"></param>
        /// <param name="institutionCode"></param>
        /// <param name="languageCode"></param>
        /// <param name="titleDescription"></param>
        /// <param name="tL2Author"></param>
        /// <param name="publishReady"></param>
        /// <param name="rareBooks"></param>
        /// <param name="note"></param>
        /// <param name="creationUserID"></param>
        /// <param name="lastModifiedUserID"></param>
        /// <param name="originalCatalogingSource"></param>
        /// <param name="editionStatement"></param>
        /// <param name="currentPublicationFrequency"></param>
        /// <returns>Object of type Title.</returns>
        public Title TitleInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            string mARCBibID,
            string mARCLeader,
            int?tropicosTitleID,
            int?redirectTitleID,
            string fullTitle,
            string shortTitle,
            string uniformTitle,
            string sortTitle,
            string partNumber,
            string partName,
            string callNumber,
            string publicationDetails,
            short?startYear,
            short?endYear,
            string datafield_260_a,
            string datafield_260_b,
            string datafield_260_c,
            string institutionCode,
            string languageCode,
            string titleDescription,
            string tL2Author,
            bool publishReady,
            bool rareBooks,
            string note,
            int?creationUserID,
            int?lastModifiedUserID,
            string originalCatalogingSource,
            string editionStatement,
            string currentPublicationFrequency)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("TitleID", SqlDbType.Int, null, false),
                                                                      CustomSqlHelper.CreateInputParameter("MARCBibID", SqlDbType.NVarChar, 50, false, mARCBibID),
                                                                      CustomSqlHelper.CreateInputParameter("MARCLeader", SqlDbType.NVarChar, 24, true, mARCLeader),
                                                                      CustomSqlHelper.CreateInputParameter("TropicosTitleID", SqlDbType.Int, null, true, tropicosTitleID),
                                                                      CustomSqlHelper.CreateInputParameter("RedirectTitleID", SqlDbType.Int, null, true, redirectTitleID),
                                                                      CustomSqlHelper.CreateInputParameter("FullTitle", SqlDbType.NVarChar, 2000, false, fullTitle),
                                                                      CustomSqlHelper.CreateInputParameter("ShortTitle", SqlDbType.NVarChar, 255, true, shortTitle),
                                                                      CustomSqlHelper.CreateInputParameter("UniformTitle", SqlDbType.NVarChar, 255, true, uniformTitle),
                                                                      CustomSqlHelper.CreateInputParameter("SortTitle", SqlDbType.NVarChar, 60, true, sortTitle),
                                                                      CustomSqlHelper.CreateInputParameter("PartNumber", SqlDbType.NVarChar, 255, true, partNumber),
                                                                      CustomSqlHelper.CreateInputParameter("PartName", SqlDbType.NVarChar, 255, true, partName),
                                                                      CustomSqlHelper.CreateInputParameter("CallNumber", SqlDbType.NVarChar, 100, true, callNumber),
                                                                      CustomSqlHelper.CreateInputParameter("PublicationDetails", SqlDbType.NVarChar, 255, true, publicationDetails),
                                                                      CustomSqlHelper.CreateInputParameter("StartYear", SqlDbType.SmallInt, null, true, startYear),
                                                                      CustomSqlHelper.CreateInputParameter("EndYear", SqlDbType.SmallInt, null, true, endYear),
                                                                      CustomSqlHelper.CreateInputParameter("Datafield_260_a", SqlDbType.NVarChar, 150, true, datafield_260_a),
                                                                      CustomSqlHelper.CreateInputParameter("Datafield_260_b", SqlDbType.NVarChar, 255, true, datafield_260_b),
                                                                      CustomSqlHelper.CreateInputParameter("Datafield_260_c", SqlDbType.NVarChar, 100, true, datafield_260_c),
                                                                      CustomSqlHelper.CreateInputParameter("InstitutionCode", SqlDbType.NVarChar, 10, true, institutionCode),
                                                                      CustomSqlHelper.CreateInputParameter("LanguageCode", SqlDbType.NVarChar, 10, true, languageCode),
                                                                      CustomSqlHelper.CreateInputParameter("TitleDescription", SqlDbType.NText, 1073741823, true, titleDescription),
                                                                      CustomSqlHelper.CreateInputParameter("TL2Author", SqlDbType.NVarChar, 100, true, tL2Author),
                                                                      CustomSqlHelper.CreateInputParameter("PublishReady", SqlDbType.Bit, null, false, publishReady),
                                                                      CustomSqlHelper.CreateInputParameter("RareBooks", SqlDbType.Bit, null, false, rareBooks),
                                                                      CustomSqlHelper.CreateInputParameter("Note", SqlDbType.NVarChar, 255, true, note),
                                                                      CustomSqlHelper.CreateInputParameter("CreationUserID", SqlDbType.Int, null, true, creationUserID),
                                                                      CustomSqlHelper.CreateInputParameter("LastModifiedUserID", SqlDbType.Int, null, true, lastModifiedUserID),
                                                                      CustomSqlHelper.CreateInputParameter("OriginalCatalogingSource", SqlDbType.NVarChar, 100, true, originalCatalogingSource),
                                                                      CustomSqlHelper.CreateInputParameter("EditionStatement", SqlDbType.NVarChar, 450, true, editionStatement),
                                                                      CustomSqlHelper.CreateInputParameter("CurrentPublicationFrequency", SqlDbType.NVarChar, 100, true, currentPublicationFrequency),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <Title> helper = new CustomSqlHelper <Title>())
                {
                    CustomGenericList <Title> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        Title o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// Insert values into Page.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="itemID"></param>
        /// <param name="fileNamePrefix"></param>
        /// <param name="sequenceOrder"></param>
        /// <param name="pageDescription"></param>
        /// <param name="illustration"></param>
        /// <param name="note"></param>
        /// <param name="fileSize_Temp"></param>
        /// <param name="fileExtension"></param>
        /// <param name="active"></param>
        /// <param name="year"></param>
        /// <param name="series"></param>
        /// <param name="volume"></param>
        /// <param name="issue"></param>
        /// <param name="externalURL"></param>
        /// <param name="altExternalURL"></param>
        /// <param name="issuePrefix"></param>
        /// <param name="lastPageNameLookupDate"></param>
        /// <param name="paginationUserID"></param>
        /// <param name="paginationDate"></param>
        /// <param name="creationUserID"></param>
        /// <param name="lastModifiedUserID"></param>
        /// <returns>Object of type Page.</returns>
        public Page PageInsertAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            int itemID,
            string fileNamePrefix,
            int?sequenceOrder,
            string pageDescription,
            bool illustration,
            string note,
            int?fileSize_Temp,
            string fileExtension,
            bool active,
            string year,
            string series,
            string volume,
            string issue,
            string externalURL,
            string altExternalURL,
            string issuePrefix,
            DateTime?lastPageNameLookupDate,
            int?paginationUserID,
            DateTime?paginationDate,
            int?creationUserID,
            int?lastModifiedUserID)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("PageInsertAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateOutputParameter("PageID", SqlDbType.Int, null, false),
                                                                      CustomSqlHelper.CreateInputParameter("ItemID", SqlDbType.Int, null, false, itemID),
                                                                      CustomSqlHelper.CreateInputParameter("FileNamePrefix", SqlDbType.NVarChar, 50, false, fileNamePrefix),
                                                                      CustomSqlHelper.CreateInputParameter("SequenceOrder", SqlDbType.Int, null, true, sequenceOrder),
                                                                      CustomSqlHelper.CreateInputParameter("PageDescription", SqlDbType.NVarChar, 255, true, pageDescription),
                                                                      CustomSqlHelper.CreateInputParameter("Illustration", SqlDbType.Bit, null, false, illustration),
                                                                      CustomSqlHelper.CreateInputParameter("Note", SqlDbType.NVarChar, 255, true, note),
                                                                      CustomSqlHelper.CreateInputParameter("FileSize_Temp", SqlDbType.Int, null, true, fileSize_Temp),
                                                                      CustomSqlHelper.CreateInputParameter("FileExtension", SqlDbType.NVarChar, 5, true, fileExtension),
                                                                      CustomSqlHelper.CreateInputParameter("Active", SqlDbType.Bit, null, false, active),
                                                                      CustomSqlHelper.CreateInputParameter("Year", SqlDbType.NVarChar, 20, true, year),
                                                                      CustomSqlHelper.CreateInputParameter("Series", SqlDbType.NVarChar, 20, true, series),
                                                                      CustomSqlHelper.CreateInputParameter("Volume", SqlDbType.NVarChar, 20, true, volume),
                                                                      CustomSqlHelper.CreateInputParameter("Issue", SqlDbType.NVarChar, 20, true, issue),
                                                                      CustomSqlHelper.CreateInputParameter("ExternalURL", SqlDbType.NVarChar, 500, true, externalURL),
                                                                      CustomSqlHelper.CreateInputParameter("AltExternalURL", SqlDbType.NVarChar, 500, true, altExternalURL),
                                                                      CustomSqlHelper.CreateInputParameter("IssuePrefix", SqlDbType.NVarChar, 20, true, issuePrefix),
                                                                      CustomSqlHelper.CreateInputParameter("LastPageNameLookupDate", SqlDbType.DateTime, null, true, lastPageNameLookupDate),
                                                                      CustomSqlHelper.CreateInputParameter("PaginationUserID", SqlDbType.Int, null, true, paginationUserID),
                                                                      CustomSqlHelper.CreateInputParameter("PaginationDate", SqlDbType.DateTime, null, true, paginationDate),
                                                                      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 <Page> helper = new CustomSqlHelper <Page>())
                {
                    CustomGenericList <Page> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        Page o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }