コード例 #1
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();
        }
コード例 #2
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="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);
 }
コード例 #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="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);
            }
        }
コード例 #4
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 );
 }
コード例 #5
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  );
 }