コード例 #1
0
 /// <summary> Adds an single item ( as a <see cref="Single_Item"/> object) to the collections of items </summary>
 /// <param name="Item"> Single digital resource to add to the collection of items </param>
 /// <param name="BibID"> Bibliographic identifier for the title this volume belongs to </param>
 public void Add_Item(Single_Item Item, string BibID )
 {
     if (titleLookupByBib.ContainsKey(BibID))
     {
         titleLookupByBib[BibID].Add_Item(Item);
     }
     else
     {
         Multiple_Volume_Item newTitle = new Multiple_Volume_Item(BibID);
         newTitle.Add_Item(Item);
         Add_Title(newTitle);
     }
 }
コード例 #2
0
        /// <summary> Adds an single item ( as a <see cref="SobekCM.Resource_Object.SobekCM_Item"/> object) to the collections of items </summary>
        /// <param name="Item"> Single digital resource to add to the collection of items </param>
        /// <param name="check_for_multiples"> Flag indicates whether to perform a multiple-check to see if volumes already exist for this title / item group </param>
        public void Add_SobekCM_Item(SobekCM_Item Item, bool check_for_multiples)
        {
            // Create this item
            Single_Item newItem = new Single_Item(Item.VID, Item.Behaviors.IP_Restriction_Membership, Item.Bib_Info.Main_Title.ToString());

            // Add this to the existing title, or add a new one
            string bibId = Item.BibID;
            if (titleLookupByBib.ContainsKey(bibId))
            {
                titleLookupByBib[bibId].Add_Item(newItem);
            }
            else
            {
                Multiple_Volume_Item newTitle = new Multiple_Volume_Item(bibId);
                newTitle.Add_Item(newItem);
                Add_Title(newTitle);
            }
        }
コード例 #3
0
        /// <summary> Gets a <see cref="Single_Item"/> object from the collection, by Bib ID and VID </summary>
        /// <param name="BibID"> Bibliographic identifier for the title / item group </param>
        /// <param name="VID"> Volume identifier for the individual volume within the title </param>
        /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
        /// <returns> Basic information about this item as a <see cref="Single_Item"/> object. </returns>
        public Single_Item Item_By_Bib_VID(string BibID, string VID, Custom_Tracer Tracer)
        {
            // Try to look this up in the database
            lock (thisLock)
            {
                if (titleLookupByBib.ContainsKey(BibID))
                {
                    if (titleLookupByBib[BibID].Contains_VID(VID))
                        return titleLookupByBib[BibID][VID];
                }

                // Try to pull this from the database
                DataRow itemRow = Engine_Database.Get_Item_Information(BibID, VID, Tracer);

                if (itemRow != null)
                {
                    // Get a reference to the item table first
                    DataTable itemTable = itemRow.Table;

                    // Get references to the datacolumn next
                    DataColumn vidColumn = itemTable.Columns["VID"];
                    DataColumn restrictionColumn = itemTable.Columns["IP_Restriction_Mask"];
                    DataColumn titleColumn = itemTable.Columns["Title"];

                    // Create this item object
                    Single_Item newItem = new Single_Item(itemRow[vidColumn].ToString(), Convert.ToInt16(itemRow[restrictionColumn]), itemRow[titleColumn].ToString());

                    // Add this to the existing title, or add a new one
                    if (titleLookupByBib.ContainsKey(BibID))
                    {
                        titleLookupByBib[BibID].Add_Item(newItem);
                    }
                    else
                    {
                        Multiple_Volume_Item newTitle = new Multiple_Volume_Item(BibID);
                        newTitle.Add_Item(newItem);
                        Add_Title(newTitle);
                    }

                    // Return the newly built item as well
                    return newItem;
                }

                return null;
            }
        }