本文整理汇总了C#中EngineAgnosticLayerDbAccess.EalDbParameter类的典型用法代码示例。如果您正苦于以下问题:C# EalDbParameter类的具体用法?C# EalDbParameter怎么用?C# EalDbParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EalDbParameter类属于EngineAgnosticLayerDbAccess命名空间,在下文中一共展示了EalDbParameter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Add_Parameter_Copy_Pair
/// <summary> Store the relationship between the EAL ( Engine Agnostic Level ) parameter and the database parameter. </summary>
/// <param name="EalParam"></param>
/// <param name="DbParam"></param>
/// <remarks> This is only used for parameters that include an output direction, so the returned parameter value
/// can be copied bac from the database parameter to the EAL parameter. </remarks>
public void Add_Parameter_Copy_Pair(EalDbParameter EalParam, DbParameter DbParam)
{
if (parameterCopy == null)
parameterCopy = new List<Tuple<EalDbParameter, DbParameter>>();
parameterCopy.Add(new Tuple<EalDbParameter, DbParameter>(EalParam, DbParam));
}
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:12,代码来源:EalDbReaderWrapper.cs
示例2: BeginExecuteNonQuery
/// <summary> Execute an asynchronous non-query SQL statement or stored procedure </summary>
/// <param name="DbType"> Type of database ( i.e., MSSQL, PostgreSQL ) </param>
/// <param name="DbConnectionString"> Database connection string </param>
/// <param name="DbCommandType"> Database command type </param>
/// <param name="DbCommandText"> Text of the database command, or name of the stored procedure to run </param>
/// <param name="DbParameters"> Parameters for the SQL statement </param>
public static void BeginExecuteNonQuery(EalDbTypeEnum DbType, string DbConnectionString, CommandType DbCommandType, string DbCommandText, EalDbParameter[] DbParameters)
{
if (DbType == EalDbTypeEnum.MSSQL)
{
// Create the SQL connection
SqlConnection sqlConnect = new SqlConnection(DbConnectionString);
try
{
sqlConnect.Open();
}
catch (Exception ex)
{
throw new ApplicationException("Unable to open connection to the database." + Environment.NewLine + ex.Message, ex);
}
// Create the SQL command
SqlCommand sqlCommand = new SqlCommand(DbCommandText, sqlConnect)
{
CommandType = DbCommandType
};
// Copy all the parameters to this adapter
sql_add_params_to_command(sqlCommand, DbParameters);
// Run the command itself
try
{
sqlCommand.BeginExecuteNonQuery();
}
catch (Exception ex)
{
throw new ApplicationException("Error executing non-query command." + Environment.NewLine + ex.Message, ex);
}
// Return
return;
}
if (DbType == EalDbTypeEnum.PostgreSQL)
{
throw new ApplicationException("Support for PostgreSQL with SobekCM is targeted for early 2016");
}
throw new ApplicationException("Unknown database type not supported");
}
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:52,代码来源:EalDbAccess.cs
示例3: Edit_Disposition_Advice
/// <summary> Update the disposition advice on what to do when the physical material leaves the digitization location </summary>
/// <param name="ItemID"> ItemID for which to update the disposition advice </param>
/// <param name="DispositionTypeID"> Primary key to the disposition type from the database </param>
/// <param name="Notes"> Any associated notes included about the disposition advice </param>
/// <returns> TRUE if successful, otherwise FALSE </returns>
/// <remarks> This method calls the stored procedure 'Tracking_Update_Disposition_Advice'. </remarks>
/// <exception cref="SobekCM_Database_Exception"> Exception is thrown if an error is caught during
/// the database work and the THROW_EXCEPTIONS internal flag is set to true. </exception>
public static bool Edit_Disposition_Advice(int ItemID, int DispositionTypeID, string Notes)
{
try
{
// Build the parameter list
EalDbParameter[] param_list = new EalDbParameter[3];
param_list[0] = new EalDbParameter("@Disposition_Advice", DispositionTypeID);
param_list[1] = new EalDbParameter("@Disposition_Advice_Notes", Notes);
param_list[2] = new EalDbParameter("@ItemID", ItemID);
// Execute this non-query stored procedure
EalDbAccess.ExecuteNonQuery(DatabaseType, connectionString, CommandType.StoredProcedure, "Tracking_Update_Disposition_Advice", param_list);
return true;
}
catch (Exception ee)
{
// Pass this exception onto the method to handle it
exception_caught("Tracking_Update_Disposition_Advice", ee);
return false;
}
}
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:30,代码来源:SobekCM_Database.cs
示例4: Save_Item_Behaviors
/// <summary> Saves the behaviors for a single item in a SobekCM digital library </summary>
/// <param name="ItemID">Item ID to associate these icons and downlaods with</param>
/// <param name="TextSearchable"> Flag indicates if this item is text searchable </param>
/// <param name="MainThumbnail"> Main thumbnail file name </param>
/// <param name="MainJPEG"> Main page jpeg image (for full results view) </param>
/// <param name="IP_Restriction_Mask">IP Restriction mask for this item </param>
/// <param name="CheckoutRequired"> Flag indicates if this is a single-use item which requires checkout</param>
/// <param name="Dark_Flag"> Flag indicates if this item is DARK and should not be made public or restricted (i.e., remains private)</param>
/// <param name="Born_Digital"> Flag indicates if this material was born digitally, rather than digitized </param>
/// <param name="DispositionAdvice"> Key to how this item will be disposed of once complete, or -1 for no advice </param>
/// <param name="DispositionAdviceNotes"> Notes to further explain how this item should be disposed of (i.e., return to whom, etc.)</param>
/// <param name="Material_Received_Date"> Day the material was received into the digitization office </param>
/// <param name="Material_Recd_Date_Estimated"> Flag indicates if the date above is an estimate </param>
/// <param name="Tracking_Box"> Tracking box this item currently resides in or is tracked with </param>
/// <param name="AggregationCode1"> Code for the first aggregation this item belongs to </param>
/// <param name="AggregationCode2"> Code for the second aggregation this item belongs to </param>
/// <param name="AggregationCode3"> Code for the third aggregation this item belongs to </param>
/// <param name="AggregationCode4"> Code for the fourth aggregation this item belongs to </param>
/// <param name="AggregationCode5"> Code for the fifth aggregation this item belongs to </param>
/// <param name="AggregationCode6"> Code for the sixth aggregation this item belongs to </param>
/// <param name="AggregationCode7"> Code for the seventh aggregation this item belongs to </param>
/// <param name="AggregationCode8"> Code for the eighth aggregation this item belongs to </param>
/// <param name="HoldingCode"> Holding code for this item's holding location aggregation </param>
/// <param name="SourceCode"> Source location code for this item's source location </param>
/// <param name="Icon1_Name">Name of the first icon</param>
/// <param name="Icon2_Name">Name of the second icon</param>
/// <param name="Icon3_Name">Name of the third icon</param>
/// <param name="Icon4_Name">Name of the fourth icon</param>
/// <param name="Icon5_Name">Name of the fifth icon</param>
/// <param name="Viewer1_Type"> Primary key for the first viewer type in the SobekCM database </param>
/// <param name="Viewer1_Label"> Label to be displayed for the first viewer of this item </param>
/// <param name="Viewer1_Attributes"> Optional attributes for the first viewer of this item </param>
/// <param name="Viewer2_Type"> Primary key for the second viewer type in the SobekCM database </param>
/// <param name="Viewer2_Label"> Label to be displayed for the second viewer of this item </param>
/// <param name="Viewer2_Attributes"> Optional attributes for the second viewer of this item </param>
/// <param name="Viewer3_Type"> Primary key for the third viewer type in the SobekCM database </param>
/// <param name="Viewer3_Label"> Label to be displayed for the third viewer of this item </param>
/// <param name="Viewer3_Attributes"> Optional attributes for the third viewer of this item </param>
/// <param name="Viewer4_Type"> Primary key for the fourth viewer type in the SobekCM database </param>
/// <param name="Viewer4_Label"> Label to be displayed for the fourth viewer of this item </param>
/// <param name="Viewer4_Attributes"> Optional attributes for the fourth viewer of this item </param>
/// <param name="Viewer5_Type"> Primary key for the fifth viewer type in the SobekCM database </param>
/// <param name="Viewer5_Label"> Label to be displayed for the fifth viewer of this item </param>
/// <param name="Viewer5_Attributes"> Optional attributes for the fifth viewer of this item </param>
/// <param name="Viewer6_Type"> Primary key for the sixth viewer type in the SobekCM database </param>
/// <param name="Viewer6_Label"> Label to be displayed for the sixth viewer of this item </param>
/// <param name="Viewer6_Attributes"> Optional attributes for the sixth viewer of this item </param>
/// <param name="Left_To_Right"> Flag indicates this item is read from Left-to-Right, rather than standard Right-to-Left</param>
/// <remarks> This method calls the stored procedure 'SobekCM_Save_Item_Behaviors'. </remarks>
/// <exception cref="SobekCM_Database_Exception"> Exception is thrown if an error is caught during
/// the database work and the THROW_EXCEPTIONS internal flag is set to true. </exception>
protected static bool Save_Item_Behaviors(int ItemID, bool TextSearchable, string MainThumbnail,
string MainJPEG, short IP_Restriction_Mask, bool CheckoutRequired, bool Dark_Flag, bool Born_Digital,
short DispositionAdvice, string DispositionAdviceNotes, Nullable<DateTime> Material_Received_Date, bool Material_Recd_Date_Estimated,
string Tracking_Box, string AggregationCode1, string AggregationCode2,
string AggregationCode3, string AggregationCode4, string AggregationCode5, string AggregationCode6,
string AggregationCode7, string AggregationCode8, string HoldingCode, string SourceCode,
string Icon1_Name, string Icon2_Name, string Icon3_Name, string Icon4_Name, string Icon5_Name,
int Viewer1_Type, string Viewer1_Label, string Viewer1_Attributes, int Viewer2_Type, string Viewer2_Label, string Viewer2_Attributes,
int Viewer3_Type, string Viewer3_Label, string Viewer3_Attributes, int Viewer4_Type, string Viewer4_Label, string Viewer4_Attributes,
int Viewer5_Type, string Viewer5_Label, string Viewer5_Attributes, int Viewer6_Type, string Viewer6_Label, string Viewer6_Attributes, bool Left_To_Right)
{
try
{
// Build the parameter list
EalDbParameter[] param_list = new EalDbParameter[47];
param_list[0] = new EalDbParameter("@ItemID", ItemID);
param_list[1] = new EalDbParameter("@TextSearchable", TextSearchable);
param_list[2] = new EalDbParameter("@MainThumbnail", MainThumbnail);
param_list[3] = new EalDbParameter("@MainJPEG", MainJPEG);
param_list[4] = new EalDbParameter("@IP_Restriction_Mask", IP_Restriction_Mask);
param_list[5] = new EalDbParameter("@CheckoutRequired", CheckoutRequired);
param_list[6] = new EalDbParameter("@Dark_Flag", Dark_Flag);
param_list[7] = new EalDbParameter("@Born_Digital", Born_Digital);
if (DispositionAdvice <= 0)
param_list[8] = new EalDbParameter("@Disposition_Advice", DBNull.Value);
else
param_list[8] = new EalDbParameter("@Disposition_Advice", DispositionAdvice);
param_list[9] = new EalDbParameter("@Disposition_Advice_Notes", DispositionAdviceNotes);
if (Material_Received_Date.HasValue)
param_list[10] = new EalDbParameter("@Material_Received_Date", Material_Received_Date.Value);
else
param_list[10] = new EalDbParameter("@Material_Received_Date", DBNull.Value);
param_list[11] = new EalDbParameter("@Material_Recd_Date_Estimated", Material_Recd_Date_Estimated);
param_list[12] = new EalDbParameter("@Tracking_Box", Tracking_Box);
param_list[13] = new EalDbParameter("@AggregationCode1", AggregationCode1);
param_list[14] = new EalDbParameter("@AggregationCode2", AggregationCode2);
param_list[15] = new EalDbParameter("@AggregationCode3", AggregationCode3);
param_list[16] = new EalDbParameter("@AggregationCode4", AggregationCode4);
param_list[17] = new EalDbParameter("@AggregationCode5", AggregationCode5);
param_list[18] = new EalDbParameter("@AggregationCode6", AggregationCode6);
param_list[19] = new EalDbParameter("@AggregationCode7", AggregationCode7);
param_list[20] = new EalDbParameter("@AggregationCode8", AggregationCode8);
param_list[21] = new EalDbParameter("@HoldingCode", HoldingCode);
param_list[22] = new EalDbParameter("@SourceCode", SourceCode);
param_list[23] = new EalDbParameter("@Icon1_Name", Icon1_Name);
param_list[24] = new EalDbParameter("@Icon2_Name", Icon2_Name);
param_list[25] = new EalDbParameter("@Icon3_Name", Icon3_Name);
param_list[26] = new EalDbParameter("@Icon4_Name", Icon4_Name);
//.........这里部分代码省略.........
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:101,代码来源:SobekCM_Database.cs
示例5: Delete_QC_Error
/// <summary> Delete the QC error for a single page of an item from the database </summary>
/// <param name="itemID"></param>
/// <param name="filename"></param>
public static void Delete_QC_Error(int itemID, string filename)
{
try
{
//Add the parameters to this command
EalDbParameter[] parameters = new EalDbParameter[2];
parameters[0] = new EalDbParameter("@itemID", itemID);
parameters[1] = new EalDbParameter("@filename", filename);
EalDbAccess.ExecuteNonQuery(DatabaseType, connectionString, CommandType.StoredProcedure, "SobekCM_QC_Delete_Error", parameters);
}
catch (Exception ee)
{
throw new ApplicationException("Error deleting QC error from the database." + ee.Message);
}
}
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:20,代码来源:SobekCM_Database.cs
示例6: sql_add_params_to_command
private static void sql_add_params_to_command(SqlCommand SqlCommand, EalDbParameter[] DbParameters)
{
// Copy all the parameters to this adapter
if ((DbParameters != null) && (DbParameters.Length > 0))
{
// Step through each parameter
foreach (EalDbParameter thisParam in DbParameters)
{
// Determine the appropriate SQL TYPE
SqlDbType sqlType = SqlDbType.NVarChar;
switch (thisParam.DbType)
{
case DbType.AnsiString:
sqlType = SqlDbType.VarChar;
break;
case DbType.String:
sqlType = SqlDbType.NVarChar;
break;
case DbType.DateTime:
sqlType = SqlDbType.DateTime;
break;
case DbType.Int16:
sqlType = SqlDbType.SmallInt;
break;
case DbType.Int32:
sqlType = SqlDbType.Int;
break;
case DbType.Int64:
sqlType = SqlDbType.BigInt;
break;
case DbType.Boolean:
sqlType = SqlDbType.Bit;
break;
}
// Create the sql parameter
SqlParameter sqlParam = new SqlParameter(thisParam.ParameterName, sqlType)
{
Direction = thisParam.Direction,
Value = thisParam.Value
};
// If this was null, use DBNull.Value
if (sqlParam.Value == null)
sqlParam.Value = DBNull.Value;
// Add this to the select command
SqlCommand.Parameters.Add(sqlParam);
}
}
}
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:57,代码来源:EalDbAccess.cs
示例7: sql_copy_returned_values_back_to_params
// Copy any output values back to the parameters
private static void sql_copy_returned_values_back_to_params(EalDbReaderWrapper Wrapper, SqlParameterCollection SqlParams, EalDbParameter[] EalParams)
{
// Copy over any values as necessary
int i = 0;
foreach (EalDbParameter thisParameter in EalParams)
{
if ((thisParameter.Direction == ParameterDirection.Output) || (thisParameter.Direction == ParameterDirection.InputOutput))
{
Wrapper.Add_Parameter_Copy_Pair(thisParameter, SqlParams[i]);
}
i++;
}
}
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:14,代码来源:EalDbAccess.cs
示例8: QC_Update_Item_Info
/// <summary>
/// Updates the relevant item info in the database after QC (main thumbnail info, pagecount, filecount, disksize)
/// </summary>
/// <param name="BibID"></param>BibID for the item
/// <param name="VID"></param>VID for this item
/// <param name="MainThumbnailFileName"></param>Filename of the main thumbnail image (.thm extension)
/// <param name="MainJpgFileName"></param>Filename of the main thumbnail JPEG image (.jpg extension)
/// <param name="PageCount"></param>Updated count of the pages for this item
/// <param name="FileCount"></param>Total count of all the files for the pages of this item
/// <param name="DisksizeMb"></param>Total disk space occupied by all the files of this item
/// <param name="Notes"></param>Notes/Comments entered by the user through the QC interface
/// <param name="User"></param>Logged in user info
/// <returns></returns>
public static bool QC_Update_Item_Info(string BibID, string VID, string User, string MainThumbnailFileName, string MainJpgFileName, int PageCount, int FileCount, double DisksizeMb, string Notes)
{
try
{
int itemID = Get_ItemID(BibID, VID);
//Build the parameter list
EalDbParameter[] param_list = new EalDbParameter[8];
param_list[0] = new EalDbParameter("@itemid", itemID);
param_list[1] = new EalDbParameter("@notes", Notes);
param_list[2] = new EalDbParameter("@onlineuser", User);
param_list[3] = new EalDbParameter("@mainthumbnail", MainThumbnailFileName);
param_list[4] = new EalDbParameter("@mainjpeg", MainJpgFileName);
param_list[5] = new EalDbParameter("@pagecount", PageCount);
param_list[6] = new EalDbParameter("@filecount", FileCount);
param_list[7] = new EalDbParameter("@disksize_kb", DisksizeMb);
//Execute this non-query stored procedure
EalDbAccess.ExecuteNonQuery(DatabaseType, connectionString, CommandType.StoredProcedure, "Tracking_Submit_Online_Page_Division", param_list);
return true;
}
catch (Exception e)
{
//Pass this exception onto the method to handle it
exception_caught("Tracking_Submit_Online_Page_Division", e);
return false;
}
}
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:42,代码来源:SobekCM_Database.cs
示例9: ExecuteDataset
/// <summary> Execute a SQL statement or stored procedure and return a DataSet </summary>
/// <param name="DbType"> Type of database ( i.e., MSSQL, PostgreSQL ) </param>
/// <param name="DbConnectionString"> Database connection string </param>
/// <param name="DbCommandType"> Database command type </param>
/// <param name="DbCommandText"> Text of the database command, or name of the stored procedure to run </param>
/// <param name="DbParameters"> Parameters for the SQL statement </param>
public static DataSet ExecuteDataset( EalDbTypeEnum DbType, string DbConnectionString, CommandType DbCommandType, string DbCommandText, EalDbParameter[] DbParameters)
{
if (DbType == EalDbTypeEnum.MSSQL)
{
DataSet returnedSet = new DataSet();
// Create the SQL connection
using (SqlConnection sqlConnect = new SqlConnection(DbConnectionString))
{
try
{
sqlConnect.Open();
}
catch (Exception ex)
{
throw new ApplicationException("Unable to open connection to the database." + Environment.NewLine + ex.Message, ex);
}
// Create the data adapter
SqlDataAdapter sqlAdapter = new SqlDataAdapter(DbCommandText, sqlConnect)
{
SelectCommand = { CommandType = DbCommandType }
};
// Copy all the parameters to this adapter
sql_add_params_to_command(sqlAdapter.SelectCommand, DbParameters);
// Fill the dataset to return
sqlAdapter.Fill(returnedSet);
// Copy any output values back to the parameters
sql_copy_returned_values_back_to_params(sqlAdapter.SelectCommand.Parameters, DbParameters);
}
// Return the dataset
return returnedSet;
}
if (DbType == EalDbTypeEnum.PostgreSQL)
{
throw new ApplicationException("Support for PostgreSQL with SobekCM is targeted for early 2016");
}
throw new ApplicationException("Unknown database type not supported");
}
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:51,代码来源:EalDbAccess.cs
示例10: Save_Serial_Hierarchy
/// <summary> Saves the serial hierarchy and link between an item and an item group </summary>
/// <param name="GroupID">Group ID this item belongs to</param>
/// <param name="ItemID">Item id for the individual item</param>
/// <param name="Level1_Text">Text to display for the first hierarchy</param>
/// <param name="Level1_Index">Order for this item within other first hierarchy items</param>
/// <param name="Level2_Text">Text to display for the second hierarchy</param>
/// <param name="Level2_Index">Order for this item within other second hierarchy items</param>
/// <param name="Level3_Text">Text to display for the third hierarchy</param>
/// <param name="Level3_Index">Order for this item within other third hierarchy items</param>
/// <param name="Level4_Text">Text to display for the fourth hierarchy</param>
/// <param name="Level4_Index">Order for this item within other fourth hierarchy items</param>
/// <param name="Level5_Text">Text to display for the fifth hierarchy</param>
/// <param name="Level5_Index">Order for this item within other fifth hierarchy items</param>
/// <param name="SerialHierarchy"> Serial hierarchy as a single</param>
/// <remarks> This method calls the stored procedure 'SobekCM_Save_Serial_Hierarchy'. </remarks>
/// <exception cref="SobekCM_Database_Exception"> Exception is thrown if an error is caught during
/// the database work and the THROW_EXCEPTIONS internal flag is set to true. </exception>
protected static void Save_Serial_Hierarchy(int GroupID, int ItemID, string Level1_Text, int Level1_Index, string Level2_Text, int Level2_Index, string Level3_Text, int Level3_Index, string Level4_Text, int Level4_Index, string Level5_Text, int Level5_Index, string SerialHierarchy)
{
try
{
// Build the parameter list
EalDbParameter[] param_list = new EalDbParameter[13];
param_list[0] = new EalDbParameter("@GroupID", GroupID);
param_list[1] = new EalDbParameter("@ItemID", ItemID);
if (Level1_Index >= 0)
{
param_list[2] = new EalDbParameter("@Level1_Text", Level1_Text);
param_list[3] = new EalDbParameter("@Level1_Index", Level1_Index);
}
else
{
param_list[2] = new EalDbParameter("@Level1_Text", DBNull.Value);
param_list[3] = new EalDbParameter("@Level1_Index", DBNull.Value);
}
if (Level2_Index >= 0)
{
param_list[4] = new EalDbParameter("@Level2_Text", Level2_Text);
param_list[5] = new EalDbParameter("@Level2_Index", Level2_Index);
}
else
{
param_list[4] = new EalDbParameter("@Level2_Text", DBNull.Value);
param_list[5] = new EalDbParameter("@Level2_Index", DBNull.Value);
}
if (Level3_Index >= 0)
{
param_list[6] = new EalDbParameter("@Level3_Text", Level3_Text);
param_list[7] = new EalDbParameter("@Level3_Index", Level3_Index);
}
else
{
param_list[6] = new EalDbParameter("@Level3_Text", DBNull.Value);
param_list[7] = new EalDbParameter("@Level3_Index", DBNull.Value);
}
if (Level4_Index >= 0)
{
param_list[8] = new EalDbParameter("@Level4_Text", Level4_Text);
param_list[9] = new EalDbParameter("@Level4_Index", Level4_Index);
}
else
{
param_list[8] = new EalDbParameter("@Level4_Text", DBNull.Value);
param_list[9] = new EalDbParameter("@Level4_Index", DBNull.Value);
}
if (Level5_Index >= 0)
{
param_list[10] = new EalDbParameter("@Level5_Text", Level5_Text);
param_list[11] = new EalDbParameter("@Level5_Index", Level5_Index);
}
else
{
param_list[10] = new EalDbParameter("@Level5_Text", DBNull.Value);
param_list[11] = new EalDbParameter("@Level5_Index", DBNull.Value);
}
param_list[12] = new EalDbParameter("@SerialHierarchy", SerialHierarchy);
// Execute this non-query stored procedure
EalDbAccess.ExecuteNonQuery(DatabaseType, connectionString, CommandType.StoredProcedure, "SobekCM_Save_Serial_Hierarchy", param_list);
}
catch (Exception ee)
{
// Pass this exception onto the method to handle it
exception_caught("SobekCM_Save_Serial_Hierarchy", ee);
}
}
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:91,代码来源:SobekCM_Database.cs
示例11: Check_For_Record_Existence
/// <summary> Checks for similar records within the database </summary>
/// <param name="BibID"> Bibliographic identifier to check </param>
/// <param name="VID"> Volume identifier to check </param>
/// <param name="OCLC"> OCLC Record number to look for existence </param>
/// <param name="Local_Catalog_ID"> Local catalog record number to look for existence </param>
/// <returns> DataTable with any matching results </returns>
/// <remarks> This calls the 'SobekCM_Check_For_Record_Existence' stored procedure </remarks>
public static DataTable Check_For_Record_Existence(string BibID, string VID, string OCLC, string Local_Catalog_ID)
{
// Get oclc and/or aleph number
long oclc = -999;
int aleph = -999;
if (OCLC.Length > 0)
{
long oclc_temp;
if (Int64.TryParse(OCLC, out oclc_temp))
oclc = oclc_temp;
}
if (Local_Catalog_ID.Length > 0)
{
int catalog_temp;
if (Int32.TryParse(Local_Catalog_ID, out catalog_temp))
aleph = catalog_temp;
}
try
{
// Build the parameter list
EalDbParameter[] param_list = new EalDbParameter[4];
param_list[0] = new EalDbParameter("@bibid", BibID);
param_list[1] = new EalDbParameter("@vid", VID);
param_list[2] = new EalDbParameter("@OCLC_Number", oclc);
param_list[3] = new EalDbParameter("@Local_Cat_Number", aleph);
// Execute this query stored procedure
DataSet resultSet = EalDbAccess.ExecuteDataset(DatabaseType, connectionString, CommandType.StoredProcedure, "SobekCM_Check_For_Record_Existence", param_list);
if (resultSet != null)
return resultSet.Tables[0];
}
catch (Exception ee)
{
// Pass this exception onto the method to handle it
exception_caught("SobekCM_Check_For_Record_Existence", ee);
}
return null;
}
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:48,代码来源:SobekCM_Database.cs
示例12: Save_Item_Metadata
/// <summary> Saves metadata from an item into the tables for searching metadata </summary>
/// <param name="ItemID"> Primary key for the item to which to tag this metadata </param>
/// <param name="Metadata_Type1"> Type string for the first metadata value </param>
/// <param name="Metadata_Value1"> Value of the first piece of metadata </param>
/// <param name="Metadata_Type2">Type string for the second metadata value</param>
/// <param name="Metadata_Value2"> Value of the second piece of metadata</param>
/// <param name="Metadata_Type3">Type string for the third metadata value</param>
/// <param name="Metadata_Value3"> Value of the third piece of metadata</param>
/// <param name="Metadata_Type4">Type string for the fourth metadata value</param>
/// <param name="Metadata_Value4"> Value of the fourth piece of metadata</param>
/// <param name="Metadata_Type5">Type string for the fifth metadata value</param>
/// <param name="Metadata_Value5"> Value of the fifth piece of metadata</param>
/// <param name="Metadata_Type6">Type string for the sixth metadata value</param>
/// <param name="Metadata_Value6"> Value of the sixth piece of metadata</param>
/// <param name="Metadata_Type7">Type string for the seventh metadata value</param>
/// <param name="Metadata_Value7"> Value of the seventh piece of metadata</param>
/// <param name="Metadata_Type8">Type string for the eight metadata value</param>
/// <param name="Metadata_Value8"> Value of the eight piece of metadata</param>
/// <param name="Metadata_Type9">Type string for the ninth metadata value</param>
/// <param name="Metadata_Value9"> Value of the ninth piece of metadata</param>
/// <param name="Metadata_Type10">Type string for the tenth metadata value</param>
/// <param name="Metadata_Value10"> Value of the tenth piece of metadata</param>
/// <returns> TRUE if successful, otherwise FALSE </returns>
/// <remarks> This calls the 'SobekCM_Metadata_Save' stored procedure in the SobekCM database </remarks>
protected static bool Save_Item_Metadata(int ItemID, string Metadata_Type1, string Metadata_Value1,
string Metadata_Type2, string Metadata_Value2, string Metadata_Type3, string Metadata_Value3,
string Metadata_Type4, string Metadata_Value4, string Metadata_Type5, string Metadata_Value5,
string Metadata_Type6, string Metadata_Value6, string Metadata_Type7, string Metadata_Value7,
string Metadata_Type8, string Metadata_Value8, string Metadata_Type9, string Metadata_Value9,
string Metadata_Type10, string Metadata_Value10)
{
try
{
// Build the parameter list
EalDbParameter[] param_list = new EalDbParameter[21];
param_list[0] = new EalDbParameter("@itemid", ItemID);
param_list[1] = new EalDbParameter("@metadata_type1", Metadata_Type1);
param_list[2] = new EalDbParameter("@metadata_value1", Metadata_Value1.Trim());
param_list[3] = new EalDbParameter("@metadata_type2", Metadata_Type2);
param_list[4] = new EalDbParameter("@metadata_value2", Metadata_Value2.Trim());
param_list[5] = new EalDbParameter("@metadata_type3", Metadata_Type3);
param_list[6] = new EalDbParameter("@metadata_value3", Metadata_Value3.Trim());
param_list[7] = new EalDbParameter("@metadata_type4", Metadata_Type4);
param_list[8] = new EalDbParameter("@metadata_value4", Metadata_Value4.Trim());
param_list[9] = new EalDbParameter("@metadata_type5", Metadata_Type5);
param_list[10] = new EalDbParameter("@metadata_value5", Metadata_Value5.Trim());
param_list[11] = new EalDbParameter("@metadata_type6", Metadata_Type6);
param_list[12] = new EalDbParameter("@metadata_value6", Metadata_Value6.Trim());
param_list[13] = new EalDbParameter("@metadata_type7", Metadata_Type7);
param_list[14] = new EalDbParameter("@metadata_value7", Metadata_Value7.Trim());
param_list[15] = new EalDbParameter("@metadata_type8", Metadata_Type8);
param_list[16] = new EalDbParameter("@metadata_value8", Metadata_Value8.Trim());
param_list[17] = new EalDbParameter("@metadata_type9", Metadata_Type9);
param_list[18] = new EalDbParameter("@metadata_value9", Metadata_Value9.Trim());
param_list[19] = new EalDbParameter("@metadata_type10", Metadata_Type10);
param_list[20] = new EalDbParameter("@metadata_value10", Metadata_Value10.Trim());
// Execute this non-query stored procedure
EalDbAccess.ExecuteNonQuery(DatabaseType, connectionString, CommandType.StoredProcedure, "SobekCM_Metadata_Save", param_list);
return true;
}
catch (Exception ee)
{
// Pass this exception onto the method to handle it
exception_caught("SobekCM_Metadata_Save", ee);
return false;
}
}
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:68,代码来源:SobekCM_Database.cs
示例13: Save_Item_Ticklers
/// <summary> Saves up to five ticklers for a single item in a SobekCM digital library </summary>
/// <param name="ItemID"> Item ID to associate these ticklers with </param>
/// <param name="Tickler1"> Tickler to save for this item </param>
/// <param name="Tickler2"> Tickler to save for this item </param>
/// <param name="Tickler3"> Tickler to save for this item </param>
/// <param name="Tickler4"> Tickler to save for this item </param>
/// <param name="Tickler5"> Tickler to save for this item </param>
/// <remarks> This method calls the stored procedure 'SobekCM_Save_Item_Ticklers'. </remarks>
/// <exception cref="SobekCM_Database_Exception"> Exception is thrown if an error is caught during
/// the database work and the THROW_EXCEPTIONS internal flag is set to true. </exception>
protected static bool Save_Item_Ticklers(int ItemID, string Tickler1, string Tickler2, string Tickler3, string Tickler4, string Tickler5)
{
try
{
// Build the parameter list
EalDbParameter[] param_list = new EalDbParameter[6];
param_list[0] = new EalDbParameter("@ItemID", ItemID);
param_list[1] = new EalDbParameter("@Tickler1", Tickler1);
param_list[2] = new EalDbParameter("@Tickler2", Tickler2);
param_list[3] = new EalDbParameter("@Tickler3", Tickler3);
param_list[4] = new EalDbParameter("@Tickler4", Tickler4);
param_list[5] = new EalDbParameter("@Tickler5", Tickler5);
// Execute this non-query stored procedure
EalDbAccess.ExecuteNonQuery(DatabaseType, connectionString, CommandType.StoredProcedure, "SobekCM_Save_Item_Ticklers", param_list);
return true;
}
catch (Exception ee)
{
// Pass this exception onto the method to handle it
exception_caught("SobekCM_Save_Item_Ticklers", ee);
return false;
}
}
开发者ID:Elkolt,项目名称:SobekCM-Web-Application,代码行数:35,代码来源:SobekCM_Database.cs
示例14: Save_Item_Group
/// <summary> Saves the main information about an item group in SobekCM </summary>
/// <param name="BibID">Bib ID for this group</param>
/// <param name="GroupTitle">Title for this group</param>
/// <param name="SortTitle">Sort title for this item group</param>
/// <param name="CreateDate"> Day this item was created </param>
/// <param name="File_Root"> File root for this item group's files </param>
/// <param name="Update_Existing"> Flag indicates to update this bib id if it exists</param>
/// <param name="Type">Resource type for this group</param>
/// <param name="ALEPH_Number"> ALEPH record number for this item group</param>
/// <param name="OCLC_Number"> OCLC record number for this item group</param>
/// <param name="Group_Thumbnail"> Thumbnail to use for this item group </param>
/// <param name="Large_Format"> Flag indicates if this a large format item, which will affect size of service image files </param>
/// <param name="Never_Overlay_Record"> Flag indicates to never overlay this record from the original ALEPH or OCLC record </param>
/// <param name="Track_By_Month"> Flag indicates this material should be tracked by month, along with other items within the same title </param>
/// <param name="Primary_Identifier_Type"> Primary identifier type for this item group </param>
/// <param name="Primary_Identifier"> Primary identifier for this item group </param>
/// <returns> Arguments which include the group id and bibid for this item group / title </returns>
/// <remarks> This method calls the stored procedure 'SobekCM_Save_Item_Group'. </remarks>
/// <exception cref="ApplicationException"> Exception is thrown if an error is caught during
/// the database work and the THROW_EXCEPTIONS internal flag is set to true. </exception>
protected static Save_Item_Group_Args Save_Item_Group(string BibID, string GroupTitle, string SortTitle, string Type, string File_Root, string Group_Thumbnail, bool Update_Existing, DateTime CreateDate, long OCLC_Number,
|
请发表评论