Exemplo n.º 1
0
        public static Title TitleSelectExtended(SqlConnection sqlConnection, SqlTransaction sqlTransaction, int titleId)
        {
            SqlConnection connection = CustomSqlHelper.CreateConnection(
                CustomSqlHelper.GetConnectionStringFromConnectionStrings("BHL"), sqlConnection);
            SqlTransaction transaction = sqlTransaction;

            Title title = new TitleDAL().TitleSelectAuto(connection, transaction, titleId);

            if (title != null)
            {
                title.TitleCreators = Title_CreatorDAL.Title_CreatorSelectByTitle(connection, transaction, titleId);
                if (title.TitleCreators != null && title.TitleCreators.Count > 0)
                {
                    CreatorDAL creatorDAL = new CreatorDAL();
                    foreach (Title_Creator titleCreator in title.TitleCreators)
                    {
                        titleCreator.Creator = creatorDAL.CreatorSelectAuto(connection, transaction, titleCreator.CreatorID);
                    }
                }

                title.TitleIdentifiers = new Title_TitleIdentifierDAL().Title_TitleIdentifierSelectByTitleID(connection, transaction, titleId);

                title.TitleTypes = Title_TitleTypeDAL.SelectByTitle(connection, transaction, titleId);

                title.Items = ItemDAL.ItemSelectByTitleID(connection, transaction, titleId);

                title.TitleItems = new TitleItemDAL().TitleItemSelectByTitle(connection, transaction, titleId);

                title.TitleTags = TitleTagDAL.TitleTagSelectByTitle(connection, transaction, titleId);

                title.TitleAssociations = new TitleAssociationDAL().TitleAssociationSelectExtendedForTitle(connection, transaction, titleId);

                title.TitleLanguages = new TitleLanguageDAL().TitleLanguageSelectByTitleID(connection, transaction, titleId);
            }

            return(title);
        }
Exemplo n.º 2
0
        public static Title TitleSelectExtended( SqlConnection sqlConnection, SqlTransaction sqlTransaction, int titleId )
        {
            SqlConnection connection = CustomSqlHelper.CreateConnection(
                CustomSqlHelper.GetConnectionStringFromConnectionStrings( "BHL" ), sqlConnection );
            SqlTransaction transaction = sqlTransaction;

            Title title = new TitleDAL().TitleSelectAuto( connection, transaction, titleId );

            if ( title != null )
            {
                title.TitleCreators = Title_CreatorDAL.Title_CreatorSelectByTitle( connection, transaction, titleId );
                if ( title.TitleCreators != null && title.TitleCreators.Count > 0 )
                {
                    CreatorDAL creatorDAL = new CreatorDAL();
                    foreach ( Title_Creator titleCreator in title.TitleCreators )
                    {
                        titleCreator.Creator = creatorDAL.CreatorSelectAuto( connection, transaction, titleCreator.CreatorID );
                    }
                }

                title.TitleIdentifiers = new Title_TitleIdentifierDAL().Title_TitleIdentifierSelectByTitleID(connection, transaction, titleId);

                title.TitleTypes = Title_TitleTypeDAL.SelectByTitle( connection, transaction, titleId );

                title.Items = ItemDAL.ItemSelectByTitleID( connection, transaction, titleId );

                title.TitleItems = new TitleItemDAL().TitleItemSelectByTitle(connection, transaction, titleId);

                title.TitleTags = TitleTagDAL.TitleTagSelectByTitle(connection, transaction, titleId);

                title.TitleAssociations = new TitleAssociationDAL().TitleAssociationSelectExtendedForTitle(connection, transaction, titleId);

                title.TitleLanguages = new TitleLanguageDAL().TitleLanguageSelectByTitleID(connection, transaction, titleId);
            }

            return title;
        }