Esempio n. 1
0
 /// <summary>
 /// Update values in Marc. Returns an object of type Marc.
 /// </summary>
 /// <param name="sqlConnection">Sql connection or null.</param>
 /// <param name="sqlTransaction">Sql transaction or null.</param>
 /// <param name="connectionKeyName">Connection key name located in config file.</param>
 /// <param name="value">Object of type Marc.</param>
 /// <returns>Object of type Marc.</returns>
 public Marc MarcUpdateAuto(
     SqlConnection sqlConnection,
     SqlTransaction sqlTransaction,
     string connectionKeyName,
     Marc value)
 {
     return MarcUpdateAuto(sqlConnection, sqlTransaction, connectionKeyName,
         value.MarcID,
         value.MarcImportStatusID,
         value.MarcImportBatchID,
         value.MarcFileLocation,
         value.InstitutionCode,
         value.Leader,
         value.TitleID);
 }
Esempio n. 2
0
        /// <summary>
        /// Manage Marc object.
        /// If the object is of type CustomObjectBase, 
        /// then either insert values into, delete values from, or update values in Marc.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="connectionKeyName">Connection key name located in config file.</param>
        /// <param name="value">Object of type Marc.</param>
        /// <returns>Object of type CustomDataAccessStatus<Marc>.</returns>
        public CustomDataAccessStatus<Marc> MarcManageAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            Marc value)
        {
            if (value.IsNew && !value.IsDeleted)
            {

                Marc returnValue = MarcInsertAuto(sqlConnection, sqlTransaction, connectionKeyName,
                    value.MarcImportStatusID,
                        value.MarcImportBatchID,
                        value.MarcFileLocation,
                        value.InstitutionCode,
                        value.Leader,
                        value.TitleID);

                return new CustomDataAccessStatus<Marc>(
                    CustomDataAccessContext.Insert,
                    true, returnValue);
            }
            else if (!value.IsNew && value.IsDeleted)
            {
                if (MarcDeleteAuto(sqlConnection, sqlTransaction, connectionKeyName,
                    value.MarcID))
                {
                return new CustomDataAccessStatus<Marc>(
                    CustomDataAccessContext.Delete,
                    true, value);
                }
                else
                {
                return new CustomDataAccessStatus<Marc>(
                    CustomDataAccessContext.Delete,
                    false, value);
                }
            }
            else if (value.IsDirty && !value.IsDeleted)
            {

                Marc returnValue = MarcUpdateAuto(sqlConnection, sqlTransaction, connectionKeyName,
                    value.MarcID,
                        value.MarcImportStatusID,
                        value.MarcImportBatchID,
                        value.MarcFileLocation,
                        value.InstitutionCode,
                        value.Leader,
                        value.TitleID);

                return new CustomDataAccessStatus<Marc>(
                    CustomDataAccessContext.Update,
                    true, returnValue);
            }
            else
            {
                return new CustomDataAccessStatus<Marc>(
                    CustomDataAccessContext.NA,
                    false, value);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Update values in Marc. Returns an object of type Marc.
 /// </summary>
 /// <param name="sqlConnection">Sql connection or null.</param>
 /// <param name="sqlTransaction">Sql transaction or null.</param>
 /// <param name="value">Object of type Marc.</param>
 /// <returns>Object of type Marc.</returns>
 public Marc MarcUpdateAuto(
     SqlConnection sqlConnection,
     SqlTransaction sqlTransaction,
     Marc value)
 {
     return MarcUpdateAuto(sqlConnection, sqlTransaction, "BHL", value );
 }
Esempio n. 4
0
 /// <summary>
 /// Manage Marc object.
 /// If the object is of type CustomObjectBase, 
 /// then either insert values into, delete values from, or update values in Marc.
 /// </summary>
 /// <param name="sqlConnection">Sql connection or null.</param>
 /// <param name="sqlTransaction">Sql transaction or null.</param>
 /// <param name="value">Object of type Marc.</param>
 /// <returns>Object of type CustomDataAccessStatus<Marc>.</returns>
 public CustomDataAccessStatus<Marc> MarcManageAuto(
     SqlConnection sqlConnection,
     SqlTransaction sqlTransaction,
     Marc value)
 {
     return MarcManageAuto( sqlConnection, sqlTransaction, "BHL", value  );
 }