Example #1
0
 /// <summary>
 /// Update values in TitleAssociationType. Returns an object of type TitleAssociationType.
 /// </summary>
 /// <param name="sqlConnection">Sql connection or null.</param>
 /// <param name="sqlTransaction">Sql transaction or null.</param>
 /// <param name="value">Object of type TitleAssociationType.</param>
 /// <returns>Object of type TitleAssociationType.</returns>
 public TitleAssociationType TitleAssociationTypeUpdateAuto(
     SqlConnection sqlConnection,
     SqlTransaction sqlTransaction,
     TitleAssociationType value)
 {
     return(TitleAssociationTypeUpdateAuto(sqlConnection, sqlTransaction, "BHL", value));
 }
Example #2
0
        /// <summary>
        /// Select values from TitleAssociationType 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="titleAssociationTypeID"></param>
        /// <returns>Object of type TitleAssociationType.</returns>
        public TitleAssociationType TitleAssociationTypeSelectAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int titleAssociationTypeID)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleAssociationTypeSelectAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("TitleAssociationTypeID", SqlDbType.Int, null, false, titleAssociationTypeID)))
            {
                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);
                    }
                }
            }
        }
Example #3
0
 /// <summary>
 /// Manage TitleAssociationType object.
 /// If the object is of type CustomObjectBase,
 /// then either insert values into, delete values from, or update values in TitleAssociationType.
 /// </summary>
 /// <param name="sqlConnection">Sql connection or null.</param>
 /// <param name="sqlTransaction">Sql transaction or null.</param>
 /// <param name="value">Object of type TitleAssociationType.</param>
 /// <returns>Object of type CustomDataAccessStatus<TitleAssociationType>.</returns>
 public CustomDataAccessStatus <TitleAssociationType> TitleAssociationTypeManageAuto(
     SqlConnection sqlConnection,
     SqlTransaction sqlTransaction,
     TitleAssociationType value)
 {
     return(TitleAssociationTypeManageAuto(sqlConnection, sqlTransaction, "BHL", value));
 }
Example #4
0
        /// <summary>
        /// Manage TitleAssociationType object.
        /// If the object is of type CustomObjectBase,
        /// then either insert values into, delete values from, or update values in 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="value">Object of type TitleAssociationType.</param>
        /// <returns>Object of type CustomDataAccessStatus<TitleAssociationType>.</returns>
        public CustomDataAccessStatus <TitleAssociationType> TitleAssociationTypeManageAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            TitleAssociationType value)
        {
            if (value.IsNew && !value.IsDeleted)
            {
                TitleAssociationType returnValue = TitleAssociationTypeInsertAuto(sqlConnection, sqlTransaction, connectionKeyName,
                                                                                  value.TitleAssociationName,
                                                                                  value.MARCTag,
                                                                                  value.MARCIndicator2,
                                                                                  value.TitleAssociationLabel);

                return(new CustomDataAccessStatus <TitleAssociationType>(
                           CustomDataAccessContext.Insert,
                           true, returnValue));
            }
            else if (!value.IsNew && value.IsDeleted)
            {
                if (TitleAssociationTypeDeleteAuto(sqlConnection, sqlTransaction, connectionKeyName,
                                                   value.TitleAssociationTypeID))
                {
                    return(new CustomDataAccessStatus <TitleAssociationType>(
                               CustomDataAccessContext.Delete,
                               true, value));
                }
                else
                {
                    return(new CustomDataAccessStatus <TitleAssociationType>(
                               CustomDataAccessContext.Delete,
                               false, value));
                }
            }
            else if (value.IsDirty && !value.IsDeleted)
            {
                TitleAssociationType returnValue = TitleAssociationTypeUpdateAuto(sqlConnection, sqlTransaction, connectionKeyName,
                                                                                  value.TitleAssociationTypeID,
                                                                                  value.TitleAssociationName,
                                                                                  value.MARCTag,
                                                                                  value.MARCIndicator2,
                                                                                  value.TitleAssociationLabel);

                return(new CustomDataAccessStatus <TitleAssociationType>(
                           CustomDataAccessContext.Update,
                           true, returnValue));
            }
            else
            {
                return(new CustomDataAccessStatus <TitleAssociationType>(
                           CustomDataAccessContext.NA,
                           false, value));
            }
        }
Example #5
0
 /// <summary>
 /// Insert values into TitleAssociationType. Returns an object of type TitleAssociationType.
 /// </summary>
 /// <param name="sqlConnection">Sql connection or null.</param>
 /// <param name="sqlTransaction">Sql transaction or null.</param>
 /// <param name="connectionKeyName">Connection key name located in config file.</param>
 /// <param name="value">Object of type TitleAssociationType.</param>
 /// <returns>Object of type TitleAssociationType.</returns>
 public TitleAssociationType TitleAssociationTypeInsertAuto(
     SqlConnection sqlConnection,
     SqlTransaction sqlTransaction,
     string connectionKeyName,
     TitleAssociationType value)
 {
     return(TitleAssociationTypeInsertAuto(sqlConnection, sqlTransaction, connectionKeyName,
                                           value.TitleAssociationName,
                                           value.MARCTag,
                                           value.MARCIndicator2,
                                           value.TitleAssociationLabel));
 }
Example #6
0
        private void fillCombos()
        {
            BHLProvider bp = new BHLProvider();

            CustomGenericList <TitleAssociationType> types = bp.TitleAssociationTypeSelectAll();

            foreach (TitleAssociationType type in types)
            {
                type.TitleAssociationName = type.TitleAssociationName + " (MARC " + (type.MARCTag + " " + type.MARCIndicator2).Trim() + ")";
            }

            TitleAssociationType emptyType = new TitleAssociationType();

            emptyType.TitleAssociationTypeID = 0;
            emptyType.TitleAssociationName   = "";
            types.Insert(0, emptyType);

            ddlType.DataSource     = types;
            ddlType.DataTextField  = "TitleAssociationName";
            ddlType.DataValueField = "TitleAssociationTypeID";
            ddlType.DataBind();
        }
Example #7
0
        /// <summary>
        /// Update values in TitleAssociationType. Returns an object of type TitleAssociationType.
        /// </summary>
        /// <param name="sqlConnection">Sql connection or null.</param>
        /// <param name="sqlTransaction">Sql transaction or null.</param>
        /// <param name="connectionKeyName">Connection key name located in config file.</param>
        /// <param name="titleAssociationTypeID"></param>
        /// <param name="titleAssociationName"></param>
        /// <param name="mARCTag"></param>
        /// <param name="mARCIndicator2"></param>
        /// <param name="titleAssociationLabel"></param>
        /// <returns>Object of type TitleAssociationType.</returns>
        public TitleAssociationType TitleAssociationTypeUpdateAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            int titleAssociationTypeID,
            string titleAssociationName,
            string mARCTag,
            string mARCIndicator2,
            string titleAssociationLabel)
        {
            SqlConnection  connection  = CustomSqlHelper.CreateConnection(CustomSqlHelper.GetConnectionStringFromConnectionStrings(connectionKeyName), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            using (SqlCommand command = CustomSqlHelper.CreateCommand("TitleAssociationTypeUpdateAuto", connection, transaction,
                                                                      CustomSqlHelper.CreateInputParameter("TitleAssociationTypeID", SqlDbType.Int, null, false, titleAssociationTypeID),
                                                                      CustomSqlHelper.CreateInputParameter("TitleAssociationName", SqlDbType.NVarChar, 60, false, titleAssociationName),
                                                                      CustomSqlHelper.CreateInputParameter("MARCTag", SqlDbType.NVarChar, 20, false, mARCTag),
                                                                      CustomSqlHelper.CreateInputParameter("MARCIndicator2", SqlDbType.NChar, 1, false, mARCIndicator2),
                                                                      CustomSqlHelper.CreateInputParameter("TitleAssociationLabel", SqlDbType.NVarChar, 30, false, titleAssociationLabel),
                                                                      CustomSqlHelper.CreateReturnValueParameter("ReturnCode", SqlDbType.Int, null, false)))
            {
                using (CustomSqlHelper <TitleAssociationType> helper = new CustomSqlHelper <TitleAssociationType>())
                {
                    CustomGenericList <TitleAssociationType> list = helper.ExecuteReader(command);
                    if (list.Count > 0)
                    {
                        TitleAssociationType o = list[0];
                        list = null;
                        return(o);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
        private void fillCombos()
        {
            BHLProvider bp = new BHLProvider();

            CustomGenericList<TitleAssociationType> types = bp.TitleAssociationTypeSelectAll();

            foreach (TitleAssociationType type in types)
            {
                type.TitleAssociationName = type.TitleAssociationName + " (MARC " + (type.MARCTag + " " + type.MARCIndicator2).Trim() + ")";
            }

            TitleAssociationType emptyType = new TitleAssociationType();
            emptyType.TitleAssociationTypeID = 0;
            emptyType.TitleAssociationName = "";
            types.Insert(0, emptyType);

            ddlType.DataSource = types;
            ddlType.DataTextField = "TitleAssociationName";
            ddlType.DataValueField = "TitleAssociationTypeID";
            ddlType.DataBind();
        }
 /// <summary>
 /// Update values in TitleAssociationType. Returns an object of type TitleAssociationType.
 /// </summary>
 /// <param name="sqlConnection">Sql connection or null.</param>
 /// <param name="sqlTransaction">Sql transaction or null.</param>
 /// <param name="connectionKeyName">Connection key name located in config file.</param>
 /// <param name="value">Object of type TitleAssociationType.</param>
 /// <returns>Object of type TitleAssociationType.</returns>
 public TitleAssociationType TitleAssociationTypeUpdateAuto(
     SqlConnection sqlConnection,
     SqlTransaction sqlTransaction,
     string connectionKeyName,
     TitleAssociationType value)
 {
     return TitleAssociationTypeUpdateAuto(sqlConnection, sqlTransaction, connectionKeyName,
         value.TitleAssociationTypeID,
         value.TitleAssociationName,
         value.MARCTag,
         value.MARCIndicator2,
         value.TitleAssociationLabel);
 }
 /// <summary>
 /// Update values in TitleAssociationType. Returns an object of type TitleAssociationType.
 /// </summary>
 /// <param name="sqlConnection">Sql connection or null.</param>
 /// <param name="sqlTransaction">Sql transaction or null.</param>
 /// <param name="value">Object of type TitleAssociationType.</param>
 /// <returns>Object of type TitleAssociationType.</returns>
 public TitleAssociationType TitleAssociationTypeUpdateAuto(
     SqlConnection sqlConnection,
     SqlTransaction sqlTransaction,
     TitleAssociationType value)
 {
     return TitleAssociationTypeUpdateAuto(sqlConnection, sqlTransaction, "BHL", value );
 }
        /// <summary>
        /// Manage TitleAssociationType object.
        /// If the object is of type CustomObjectBase, 
        /// then either insert values into, delete values from, or update values in 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="value">Object of type TitleAssociationType.</param>
        /// <returns>Object of type CustomDataAccessStatus<TitleAssociationType>.</returns>
        public CustomDataAccessStatus<TitleAssociationType> TitleAssociationTypeManageAuto(
            SqlConnection sqlConnection,
            SqlTransaction sqlTransaction,
            string connectionKeyName,
            TitleAssociationType value)
        {
            if (value.IsNew && !value.IsDeleted)
            {

                TitleAssociationType returnValue = TitleAssociationTypeInsertAuto(sqlConnection, sqlTransaction, connectionKeyName,
                    value.TitleAssociationName,
                        value.MARCTag,
                        value.MARCIndicator2,
                        value.TitleAssociationLabel);

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

                TitleAssociationType returnValue = TitleAssociationTypeUpdateAuto(sqlConnection, sqlTransaction, connectionKeyName,
                    value.TitleAssociationTypeID,
                        value.TitleAssociationName,
                        value.MARCTag,
                        value.MARCIndicator2,
                        value.TitleAssociationLabel);

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