/// <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); } } } }
/// <summary> /// Select values from TitleAssociation 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="titleAssociationID"></param> /// <returns>Object of type TitleAssociation.</returns> public TitleAssociation TitleAssociationSelectAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string connectionKeyName, int titleAssociationID) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleAssociationSelectAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("TitleAssociationID", SqlDbType.Int, null, false, titleAssociationID))) { 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); } } } }
/// <summary> /// Delete values from PDFStatus 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="pdfStatusID"></param> /// <returns>true if successful otherwise false.</returns> public bool PDFStatusDeleteAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string connectionKeyName, int pdfStatusID) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("PDFStatusDeleteAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("PdfStatusID", SqlDbType.Int, null, false, pdfStatusID), 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 TitleType. Returns an object of type 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 TitleTypeUpdateAuto( 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("TitleTypeUpdateAuto", 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); } } } }
/// <summary> /// Select values from PageSummaryView by Barcode. /// </summary> /// <param name="sqlConnection">Sql connection or null.</param> /// <param name="sqlTransaction">Sql transaction or null.</param> /// <param name="barcode"></param> /// <returns>Object of type Title.</returns> public PageSummaryView PageSummarySelectByBarcode( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string barcode) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("PageSummarySelectByBarcode", connection, transaction, CustomSqlHelper.CreateInputParameter("Barcode", SqlDbType.VarChar, 40, false, barcode))) { using (CustomSqlHelper <PageSummaryView> helper = new CustomSqlHelper <PageSummaryView>()) { CustomGenericList <PageSummaryView> list = helper.ExecuteReader(command); if (list.Count > 0) { return(list[0]); } else { return(null); } } } }
/// <summary> /// Select values from MarcSubField 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="marcSubFieldID"></param> /// <returns>Object of type MarcSubField.</returns> public MarcSubField MarcSubFieldSelectAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string connectionKeyName, int marcSubFieldID) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("MarcSubFieldSelectAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("MarcSubFieldID", SqlDbType.Int, null, false, marcSubFieldID))) { 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> /// Select 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>Object of type Institution.</returns> public Institution InstitutionSelectAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string connectionKeyName, string institutionCode) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("InstitutionSelectAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("InstitutionCode", SqlDbType.NVarChar, 10, false, institutionCode))) { 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); } } } }
public Title MarcSelectTitleDetailsByMarcID( SqlConnection sqlConnection, SqlTransaction sqlTransaction, int marcId) { SqlConnection connection = CustomSqlHelper.CreateConnection( CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("MarcSelectTitleDetailsByMarcID", connection, transaction, CustomSqlHelper.CreateInputParameter("MarcID", SqlDbType.Int, null, false, marcId))) { using (CustomSqlHelper <Title> helper = new CustomSqlHelper <Title>()) { CustomGenericList <Title> list = helper.ExecuteReader(command); if (list.Count > 0) { return(list[0]); } else { return(null); } } } }
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> /// Select values from Language by primary key(s). /// </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> /// <returns>Object of type Language.</returns> public Language LanguageSelectAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string languageCode) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("LanguageSelectAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("LanguageCode", SqlDbType.NVarChar, 10, false, languageCode))) { 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); } } } }
public Institution InstitutionSelectByItemID( SqlConnection sqlConnection, SqlTransaction sqlTransaction, int itemID) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("InstitutionSelectByItemID", connection, transaction, CustomSqlHelper.CreateInputParameter("ItemID", SqlDbType.Int, null, false, itemID))) { 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); } } } }
/// <summary> /// Delete values from Language by primary key(s). /// </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> /// <returns>true if successful otherwise false.</returns> public bool LanguageDeleteAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string languageCode) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("LanguageDeleteAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("LanguageCode", SqlDbType.NVarChar, 10, false, languageCode), 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> /// Select values from TitleTag by primary key(s). /// </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> /// <returns>Object of type TitleTag.</returns> public TitleTag TitleTagSelectAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, int titleID, string tagText) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleTagSelectAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("TitleID", SqlDbType.Int, null, false, titleID), CustomSqlHelper.CreateInputParameter("TagText", SqlDbType.NVarChar, 50, false, tagText))) { 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> /// Update values in PDFPage. Returns an object of type PDFPage. /// </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="pdfPageID"></param> /// <param name="pdfID"></param> /// <param name="pageID"></param> /// <returns>Object of type PDFPage.</returns> public PDFPage PDFPageUpdateAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string connectionKeyName, int pdfPageID, int pdfID, int pageID) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("PDFPageUpdateAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("PdfPageID", SqlDbType.Int, null, false, pdfPageID), CustomSqlHelper.CreateInputParameter("PdfID", SqlDbType.Int, null, false, pdfID), CustomSqlHelper.CreateInputParameter("PageID", SqlDbType.Int, null, false, pageID), CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false))) { using (CustomSqlHelper <PDFPage> helper = new CustomSqlHelper <PDFPage>()) { CustomGenericList <PDFPage> list = helper.ExecuteReader(command); if (list.Count > 0) { PDFPage o = list[0]; list = null; return(o); } else { return(null); } } } }
/// <summary> /// Select all Creators for a BibId. /// </summary> /// <param name="sqlConnection">Sql connection or null.</param> /// <param name="sqlTransaction">Sql transaction or null.</param> /// <returns>Object of type Creator.</returns> private Stats StatsSelect( SqlConnection sqlConnection, SqlTransaction sqlTransaction, bool expanded, bool names) { SqlConnection connection = CustomSqlHelper.CreateConnection( CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("StatsSelect", connection, transaction, CustomSqlHelper.CreateInputParameter("Expanded", SqlDbType.Bit, null, false, expanded), CustomSqlHelper.CreateInputParameter("Names", SqlDbType.Bit, null, false, names))) { CustomGenericList <CustomDataRow> list = CustomSqlHelper.ExecuteReaderAndReturnRows(command); CustomDataRow row = list[0]; Stats stats = new Stats(); stats.TitleCount = (int)row["TitleCount"].Value; stats.VolumeCount = (int)row["VolumeCount"].Value; stats.PageCount = (int)row["PageCount"].Value; stats.PageTotal = (int)row["PageTotal"].Value; stats.TitleTotal = (int)row["TitleTotal"].Value; stats.VolumeTotal = (int)row["VolumeTotal"].Value; stats.UniqueCount = (int)row["UniqueCount"].Value; stats.UniqueTotal = (int)row["UniqueTotal"].Value; return(stats); } }
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> /// 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> /// 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); } } }
/// <summary> /// Update values in TitleIdentifier. Returns an object of type 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="titleIdentifierID"></param> /// <param name="identifierName"></param> /// <param name="marcDataFieldTag"></param> /// <param name="marcSubFieldCode"></param> /// <returns>Object of type TitleIdentifier.</returns> public TitleIdentifier TitleIdentifierUpdateAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string connectionKeyName, int titleIdentifierID, string identifierName, string marcDataFieldTag, string marcSubFieldCode) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleIdentifierUpdateAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("TitleIdentifierID", SqlDbType.Int, null, false, titleIdentifierID), 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); } } } }
/// <summary> /// Select 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>Object of type IndicatedPage.</returns> public IndicatedPage IndicatedPageSelectAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, int pageID, short sequence) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("IndicatedPageSelectAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("PageID", SqlDbType.Int, null, false, pageID), CustomSqlHelper.CreateInputParameter("Sequence", SqlDbType.SmallInt, null, false, sequence))) { 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); } } } }
/// <summary> /// Update the ItemSequence for the specified TitleItem. /// </summary> /// <param name="sqlConnection">Sql connection or null</param> /// <param name="sqlTransaction">Sql transaction or null</param> /// <param name="titleID">Identifier of a specific title</param> /// <param name="itemID">Identifier of a specific item</param> /// <param name="itemSequence">ItemSequence value</param> /// <returns>The updated titleitem</returns> public TitleItem TitleItemUpdateItemSequence(SqlConnection sqlConnection, SqlTransaction sqlTransaction, int titleID, int itemID, short?itemSequence) { SqlConnection connection = CustomSqlHelper.CreateConnection( CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleItemUpdateItemSequence", connection, transaction, CustomSqlHelper.CreateInputParameter("TitleID", SqlDbType.Int, null, false, titleID), CustomSqlHelper.CreateInputParameter("ItemID", SqlDbType.Int, null, false, itemID), CustomSqlHelper.CreateInputParameter("ItemSequence", SqlDbType.SmallInt, null, true, itemSequence))) { using (CustomSqlHelper <TitleItem> helper = new CustomSqlHelper <TitleItem>()) { CustomGenericList <TitleItem> list = helper.ExecuteReader(command); if (list.Count > 0) { return(list[0]); } else { return(null); } } } }
/// <summary> /// Update values in ItemStatus. Returns an object of type 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 ItemStatusUpdateAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, int itemStatusID, string itemStatusName) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("ItemStatusUpdateAuto", 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> /// Select values from PageSummaryView by Item and Sequence /// </summary> /// <param name="sqlConnection">Sql connection or null.</param> /// <param name="sqlTransaction">Sql transaction or null.</param> /// <param name="itemID"></param> /// <param name="sequence"></param> /// <returns>Object of type Title.</returns> public PageSummaryView PageSummarySelectByItemAndSequence( SqlConnection sqlConnection, SqlTransaction sqlTransaction, int itemID, int sequence) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("PageSummarySelectByItemAndSequence", connection, transaction, CustomSqlHelper.CreateInputParameter("ItemID", SqlDbType.Int, null, false, itemID), CustomSqlHelper.CreateInputParameter("Sequence", SqlDbType.Int, null, false, sequence))) { using (CustomSqlHelper <PageSummaryView> helper = new CustomSqlHelper <PageSummaryView>()) { CustomGenericList <PageSummaryView> list = helper.ExecuteReader(command); if (list.Count > 0) { return(list[0]); } else { return(null); } } } }
/// <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); } } } }
public Title_TitleIdentifier Title_TitleIdentifierSelectByIdentifierValue( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string identifierValue) { SqlConnection connection = CustomSqlHelper.CreateConnection( CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("Title_TitleIdentifierSelectByIdentifierValue", connection, transaction, CustomSqlHelper.CreateInputParameter("IdentifierValue", SqlDbType.NVarChar, 125, false, identifierValue))) { using (CustomSqlHelper <Title_TitleIdentifier> helper = new CustomSqlHelper <Title_TitleIdentifier>()) { CustomGenericList <Title_TitleIdentifier> list = helper.ExecuteReader(command); if (list.Count > 0) { return(list[0]); } else { return(null); } } } }
public CustomGenericList <OpenUrlCitation> OpenUrlCitationSelectByTitleDetails( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string title, string authorLast, string authorFirst, string authorCorporation, string publisherName, string publisherPlace, string publisher) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("OpenUrlCitationSelectByTitleDetails", connection, transaction, CustomSqlHelper.CreateInputParameter("Title", SqlDbType.NVarChar, 2000, true, title), CustomSqlHelper.CreateInputParameter("AuthorLast", SqlDbType.NVarChar, 150, true, authorLast), CustomSqlHelper.CreateInputParameter("AuthorFirst", SqlDbType.NVarChar, 100, true, authorFirst), CustomSqlHelper.CreateInputParameter("AuthorCorporation", SqlDbType.NVarChar, 255, true, authorCorporation), CustomSqlHelper.CreateInputParameter("PublisherName", SqlDbType.NVarChar, 255, true, publisherName), CustomSqlHelper.CreateInputParameter("PublisherPlace", SqlDbType.NVarChar, 150, true, publisherPlace), CustomSqlHelper.CreateInputParameter("Publisher", SqlDbType.NVarChar, 255, true, publisher))) { CustomGenericList <CustomDataRow> list = CustomSqlHelper.ExecuteReaderAndReturnRows(command); return(this.GetOpenUrlCitationList(list)); } }
/// <summary> /// Select values from Creator by primary key(s). /// </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> /// <returns>Object of type Creator.</returns> public Creator CreatorSelectAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, int creatorID) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("CreatorSelectAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("CreatorID", SqlDbType.Int, null, false, creatorID))) { 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); } } } }
public static int PageNameCountUniqueConfirmedBetweenDates(SqlConnection sqlConnection, SqlTransaction sqlTransaction, DateTime startDate, DateTime endDate) { SqlConnection connection = sqlConnection; SqlTransaction transaction = sqlTransaction; if (connection == null) { connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL")); } using (SqlCommand command = CustomSqlHelper.CreateCommand("PageNameCountUniqueConfirmedBetweenDates", connection, transaction, CustomSqlHelper.CreateInputParameter("StartDate", SqlDbType.DateTime, null, false, startDate), CustomSqlHelper.CreateInputParameter("EndDate", SqlDbType.DateTime, null, false, endDate))) { using (CustomSqlHelper <int> helper = new CustomSqlHelper <int>()) { CustomGenericList <int> list = helper.ExecuteReader(command); if (list.Count == 0) { return(default(int)); } else { return(list[0]); } } } }
/// <summary> /// Select values from PDFStatus 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="pdfStatusID"></param> /// <returns>Object of type PDFStatus.</returns> public PDFStatus PDFStatusSelectAuto( SqlConnection sqlConnection, SqlTransaction sqlTransaction, string connectionKeyName, int pdfStatusID) { SqlConnection connection = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection); SqlTransaction transaction = sqlTransaction; using (SqlCommand command = CustomSqlHelper.CreateCommand("PDFStatusSelectAuto", connection, transaction, CustomSqlHelper.CreateInputParameter("PdfStatusID", SqlDbType.Int, null, false, pdfStatusID))) { 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); } } } }
/// <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); } } } }