/// <summary> Add the HTML to be displayed below the search box </summary> /// <param name="Output"> Textwriter to write the HTML for this viewer</param> /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param> /// <remarks> This writes the HTML from the static browse or info page here </remarks> public override void Add_Secondary_HTML(TextWriter Output, Custom_Tracer Tracer) { if (Tracer != null) { Tracer.Add_Trace("Private_Items_AggregationViewer.Add_Secondary_HTML", "Adding HTML"); } if (privateItems == null) { Output.WriteLine("<div class=\"SobekText\">"); Output.WriteLine("<p><strong>ERROR PULLING INFORMATION FROM DATABASE</strong></p>"); Output.WriteLine("</div>"); return; } if (privateItems.TotalItems == 0) { Output.WriteLine("<div class=\"SobekText\">"); Output.WriteLine("<br />"); Output.WriteLine("<p><strong>This collection does not include any PRIVATE or DARK items.</strong></p>"); Output.WriteLine("<br />"); Output.WriteLine("</div>"); return; } // Get the URL for the sort options short sort = RequestSpecificValues.Current_Mode.Sort.HasValue ? RequestSpecificValues.Current_Mode.Sort.Value : ((short)0); RequestSpecificValues.Current_Mode.Sort = 0; string url = UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode); RequestSpecificValues.Current_Mode.Sort = sort; if (privateItems.TotalItems > 0) { Output.WriteLine("<span class=\"SobekResultsSort\">"); Output.WriteLine(" " + UI_ApplicationCache_Gateway.Translation.Get_Translation("Sort By", RequestSpecificValues.Current_Mode.Language) + ": "); Output.WriteLine(" <select name=\"sorter_input\" onchange=\"javascript:sort_private_list('" + url + "')\" id=\"sorter_input\">"); if (RequestSpecificValues.Current_Mode.Sort == 0) { Output.WriteLine(" <option value=\"0\" selected=\"selected\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("BibID / VID", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } else { Output.WriteLine(" <option value=\"0\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("BibID / VID", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } if (RequestSpecificValues.Current_Mode.Sort == 1) { Output.WriteLine(" <option value=\"1\" selected=\"selected\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("Title / VID", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } else { Output.WriteLine(" <option value=\"1\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("Title / VID", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } if (RequestSpecificValues.Current_Mode.Sort == 2) { Output.WriteLine(" <option value=\"2\" selected=\"selected\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("Last Activity Date (most recent first)", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } else { Output.WriteLine(" <option value=\"2\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("Last Activity Date (most recent first)", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } if (RequestSpecificValues.Current_Mode.Sort == 3) { Output.WriteLine(" <option value=\"3\" selected=\"selected\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("Last Milestone Date (most recent first)", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } else { Output.WriteLine(" <option value=\"3\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("Last Milestone Date (most recent first)", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } if (RequestSpecificValues.Current_Mode.Sort == 4) { Output.WriteLine(" <option value=\"4\" selected=\"selected\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("Last Activity Date (oldest first)", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } else { Output.WriteLine(" <option value=\"4\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("Last Activity Date (oldest first)", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } if (RequestSpecificValues.Current_Mode.Sort == 5) { Output.WriteLine(" <option value=\"5\" selected=\"selected\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("Last Milestone Date (oldest first)", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } else { Output.WriteLine(" <option value=\"5\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("Last Milestone Date (oldest first)", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } if (RequestSpecificValues.Current_Mode.Sort == 6) { Output.WriteLine(" <option value=\"6\" selected=\"selected\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("Embargo Date", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } else { Output.WriteLine(" <option value=\"6\">" + UI_ApplicationCache_Gateway.Translation.Get_Translation("Embargo Date", RequestSpecificValues.Current_Mode.Language) + "</option>" + Environment.NewLine); } Output.WriteLine(" </select>"); Output.WriteLine("</span>"); } const string EMBARGO_DATE_STRING = "Embargoed until {0}"; Output.WriteLine("<div class=\"SobekText\">"); Output.WriteLine("<br />"); Output.WriteLine("<p>Below is the list of all items linked to this aggregation which are either private (in process) or dark.</p>"); if (privateItems.TotalItems == 1) { Output.WriteLine("<p>There is only one matching item.</p>"); } else { if (privateItems.TotalTitles == privateItems.TotalItems) { Output.WriteLine("<p>There are a total of " + privateItems.TotalItems + " titles.</p>"); } else { Output.Write("<p>There are a total of " + privateItems.TotalItems + " items in "); if (privateItems.TotalTitles == 1) { Output.WriteLine("one title.</p>"); } else { Output.WriteLine(privateItems.TotalTitles + " titles.</p>"); } } } Output.WriteLine("<br />"); Output.WriteLine("</div>"); // Should buttons be added here for additional pages? if (privateItems.TotalTitles > RESULTS_PER_PAGE) { // Get the language suffix for the buttons string language_suffix = RequestSpecificValues.Current_Mode.Language_Code; if (language_suffix.Length > 0) { language_suffix = "_" + language_suffix; } // Get the text for the buttons string first_page = "First Page"; string previous_page = "Previous Page"; string next_page = "Next Page"; string last_page = "Last Page"; if (RequestSpecificValues.Current_Mode.Language == Web_Language_Enum.Spanish) { first_page = "Primera Página"; previous_page = "Página Anterior"; next_page = "Página Siguiente"; last_page = "Última Página"; } if (RequestSpecificValues.Current_Mode.Language == Web_Language_Enum.French) { first_page = "Première Page"; previous_page = "Page Précédente"; next_page = "Page Suivante"; last_page = "Dernière Page"; } // Get the current page ushort current_page = RequestSpecificValues.Current_Mode.Page.HasValue ? RequestSpecificValues.Current_Mode.Page.Value : ((ushort)1); // Should the previous and first buttons be enabled? Output.WriteLine(" <span class=\"leftButtons\">"); if (current_page > 1) { RequestSpecificValues.Current_Mode.Page = 1; Output.WriteLine(" <button title=\"" + first_page + "\" class=\"roundbutton\" onclick=\"window.location='" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "'; return false;\"><img src=\"" + Static_Resources_Gateway.Button_First_Arrow_Png + "\" class=\"roundbutton_img_left\" alt=\"\" /> " + first_page + " </button> "); RequestSpecificValues.Current_Mode.Page = (ushort)(current_page - 1); Output.WriteLine(" <button title=\"" + previous_page + "\" class=\"roundbutton\" onclick=\"window.location='" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "'; return false;\"><img src=\"" + Static_Resources_Gateway.Button_Previous_Arrow_Png + "\" class=\"roundbutton_img_left\" alt=\"\" /> " + previous_page + " </button>"); } else { Output.WriteLine(" <div style=\"width:160px\"> </div>"); } Output.WriteLine(" </span>"); // Calculate the maximum number of pages ushort pages = (ushort)(Math.Ceiling(privateItems.TotalTitles / RESULTS_PER_PAGE)); int start_title = (int)(1 + ((current_page - 1) * RESULTS_PER_PAGE)); int end_title = (int)(Math.Min(start_title + RESULTS_PER_PAGE, privateItems.TotalTitles)); Output.WriteLine("<span style=\"text-align:center;margin-left:auto; margin-right:auto\">" + start_title + " - " + end_title + " of " + privateItems.TotalTitles + " matching titles</span>"); // Should the next and last buttons be enabled? Output.WriteLine(" <span class=\"rightButtons\">"); if (current_page < pages) { RequestSpecificValues.Current_Mode.Page = (ushort)(current_page + 1); Output.WriteLine(" <button title=\"" + next_page + "\" class=\"roundbutton\" onclick=\"window.location='" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "'; return false;\"> " + next_page + " <img src=\"" + Static_Resources_Gateway.Button_Next_Arrow_Png + "\" class=\"roundbutton_img_right\" alt=\"\" /></button> "); RequestSpecificValues.Current_Mode.Page = pages; Output.WriteLine(" <button title=\"" + last_page + "\" class=\"roundbutton\" onclick=\"window.location='" + UrlWriterHelper.Redirect_URL(RequestSpecificValues.Current_Mode) + "'; return false;\"> " + last_page + " <img src=\"" + Static_Resources_Gateway.Button_Last_Arrow_Png + "\" class=\"roundbutton_img_right\" alt=\"\" /></button>"); } else { Output.WriteLine(" <div style=\"width:160px\"> </div>"); } Output.WriteLine(" </span>"); RequestSpecificValues.Current_Mode.Page = current_page; Output.WriteLine("<br />"); } Output.WriteLine("<br />"); // Start the table to display Output.WriteLine("</div>"); Output.WriteLine("<center>"); // Start the table and add the header Output.WriteLine("<table width=\"1100px\" border=\"0px\" cellspacing=\"0px\" class=\"privateTable\">"); Output.WriteLine(" <tr align=\"left\" bgcolor=\"#0022a7\">"); Output.WriteLine(" <th align=\"left\" colspan=\"2\"><span style=\"color: White\"> <b>TITLE</b></span></th>"); Output.WriteLine(" <th align=\"center\"><span style=\"color: White\"><b>LAST ACTIVITY</b></span></th>"); Output.WriteLine(" <th align=\"center\"><span style=\"color: White\"><b>LAST MILESTONE</b></span></th>"); Output.WriteLine(" </tr>"); // Draw each title/item in this page of results foreach (Private_Items_List_Title thisTitle in privateItems.TitleResults) { // Is this a single item, or are there multiple items under this title? if (thisTitle.Item_Count > 1) { // Draw the title row individually first Output.WriteLine(" <tr align=\"left\" onmouseover=\"this.className='tableRowHighlight'\" onmouseout=\"this.className='tableRowNormal'\" onmousedown=\"window.location.href='" + RequestSpecificValues.Current_Mode.Base_URL + thisTitle.BibID + "'\">"); Output.WriteLine(" <td width=\"700px\" colspan=\"2\">"); Output.WriteLine(" <table>"); Output.WriteLine(" <tr><td colspan=\"3\"><a href=\"" + RequestSpecificValues.Current_Mode.Base_URL + thisTitle.BibID + "\"><span class=\"privateTableBibTitle\">" + thisTitle.Group_Title + "</span></a></td></tr>"); Output.WriteLine(" <tr><td width=\"180px\"><a href=\"" + RequestSpecificValues.Current_Mode.Base_URL + thisTitle.BibID + "\">" + thisTitle.BibID + "</a></td><td width=\"180px\">" + thisTitle.Type + "</td><td>( " + thisTitle.Item_Count + " volumes out of " + thisTitle.CompleteItemCount + " total volumes )</td></tr>"); Output.WriteLine(" </table>"); Output.WriteLine(" </td>"); Output.WriteLine(" <td align=\"center\" width=\"200px\"><span class=\"privateTableBibDaysNumber\">" + Math.Floor(DateTime.Now.Subtract(thisTitle.LastActivityDate).TotalDays) + "</span><br />days ago</td>"); Output.WriteLine(" <td align=\"center\" width=\"200px\"><span class=\"privateTableBibDaysNumber\">" + Math.Floor(DateTime.Now.Subtract(thisTitle.LastMilestoneDate).TotalDays) + "</span><br />days ago</td>"); Output.WriteLine(" </tr>"); // Now, draw each item row foreach (Private_Items_List_Item thisItem in thisTitle.Items) { Output.WriteLine(" <tr><td width=\"125px\"></td><td bgcolor=\"#e7e7e7\" colspan=\"3\"></td></tr>"); Output.WriteLine(" <tr align=\"left\" onmouseover=\"this.className='tableRowHighlight'\" onmouseout=\"this.className='tableRowNormal'\" onmousedown=\"window.location.href='" + RequestSpecificValues.Current_Mode.Base_URL + thisTitle.BibID + "/" + thisItem.VID + "'\">"); Output.WriteLine(" <td width=\"125px\">"); Output.WriteLine(" <td width=\"575px\">"); Output.WriteLine(" <table>"); Output.Write(" <tr><td colspan=\"3\"><a href=\"" + RequestSpecificValues.Current_Mode.Base_URL + thisTitle.BibID + "/" + thisItem.VID + "\"><span class=\"privateTableItemTitle\">" + thisItem.Title + "</span></a>"); if ((!String.IsNullOrEmpty(thisItem.Creator)) && (thisItem.Creator.Length > 2)) { Output.Write(" ( " + thisItem.Creator.Substring(2) + " )"); } Output.WriteLine("</td></tr>"); Output.Write(" <tr><td width=\"180px\"><a href=\"" + RequestSpecificValues.Current_Mode.Base_URL + thisTitle.BibID + "/" + thisItem.VID + "\">" + thisTitle.BibID + " : " + thisItem.VID + "</a></td>"); if (!String.IsNullOrEmpty(thisItem.PubDate)) { Output.WriteLine("<td>Dated " + thisItem.PubDate + "</td><td></td></tr>"); } else { Output.WriteLine("<td></td><td></td></tr>"); } if (!String.IsNullOrEmpty(thisItem.Internal_Comments)) { Output.WriteLine(" <tr><td colspan=\"3\">“" + thisItem.Internal_Comments + "”</td></tr>"); } if (thisItem.EmbargoDate.HasValue) { Output.WriteLine(" <tr><td colspan=\"3\">" + String.Format(EMBARGO_DATE_STRING, thisItem.EmbargoDate.Value.ToShortDateString()) + "</td></tr>"); } Output.WriteLine(" </table>"); Output.WriteLine(" </td>"); Output.WriteLine(" <td align=\"center\" width=\"200px\">" + thisItem.LastActivityType.ToLower() + "<br /><span class=\"privateTableItemDaysNumber\">" + Math.Floor(DateTime.Now.Subtract(thisItem.LastActivityDate).TotalDays) + "</span><br />days ago</td>"); Output.WriteLine(" <td align=\"center\" width=\"200px\">" + thisItem.Last_Milestone_String + "<br /><span class=\"privateTableItemDaysNumber\">" + Math.Floor(DateTime.Now.Subtract(thisItem.LastMilestoneDate).TotalDays) + "</span><br />days ago</td>"); Output.WriteLine(" </tr>"); } } else { // Get the single item Private_Items_List_Item thisItem = thisTitle.Items[0]; // Draw the integrated title/item row Output.WriteLine(" <tr align=\"left\" onmouseover=\"this.className='tableRowHighlight'\" onmouseout=\"this.className='tableRowNormal'\" onmousedown=\"window.location.href='" + RequestSpecificValues.Current_Mode.Base_URL + thisTitle.BibID + "/" + thisItem.VID + "'\">"); Output.WriteLine(" <td width=\"700px\" colspan=\"2\">"); Output.WriteLine(" <table>"); Output.WriteLine(" <tr><td colspan=\"3\"><a href=\"" + RequestSpecificValues.Current_Mode.Base_URL + thisTitle.BibID + "/" + thisItem.VID + "\"><span class=\"privateTableBibTitle\">" + thisItem.Title + "</span></a>"); if ((!String.IsNullOrEmpty(thisItem.Creator)) && (thisItem.Creator.Length > 2)) { Output.Write(" ( " + thisItem.Creator.Substring(2) + " )"); } Output.WriteLine("</td></tr>"); Output.Write(" <tr><td width=\"180px\"><a href=\"" + RequestSpecificValues.Current_Mode.Base_URL + thisTitle.BibID + "/" + thisItem.VID + "\">" + thisTitle.BibID + " : " + thisItem.VID + "</a></td><td width=\"180px\">" + thisTitle.Type + "</td>"); if (!String.IsNullOrEmpty(thisItem.PubDate)) { Output.WriteLine("<td>Dated " + thisItem.PubDate + "</td></tr>"); } else { Output.WriteLine("<td></td></tr>"); } if (!String.IsNullOrEmpty(thisItem.Internal_Comments)) { Output.WriteLine(" <tr><td colspan=\"3\">“" + thisItem.Internal_Comments + "”</td></tr>"); } if (thisItem.EmbargoDate.HasValue) { Output.WriteLine(" <tr><td colspan=\"3\">" + String.Format(EMBARGO_DATE_STRING, thisItem.EmbargoDate.Value.ToShortDateString()) + "</td></tr>"); } Output.WriteLine(" </table>"); Output.WriteLine(" </td>"); Output.WriteLine(" <td align=\"center\" width=\"200px\">" + thisItem.LastActivityType.ToLower() + "<br /><span class=\"privateTableItemDaysNumber\">" + Math.Floor(DateTime.Now.Subtract(thisItem.LastActivityDate).TotalDays) + "</span><br />days ago</td>"); Output.WriteLine(" <td align=\"center\" width=\"200px\">" + thisItem.Last_Milestone_String + "<br /><span class=\"privateTableItemDaysNumber\">" + Math.Floor(DateTime.Now.Subtract(thisItem.LastMilestoneDate).TotalDays) + "</span><br />days ago</td>"); Output.WriteLine(" </tr>"); } // Add a final line in the table Output.WriteLine(" <tr><td bgcolor=\"#e7e7e7\" colspan=\"4\"></td></tr>"); } // End the table Output.WriteLine("</table>"); Output.WriteLine("</center>"); Output.WriteLine("<div id=\"pagecontainer_resumed\">"); Output.WriteLine("<br /> <br />"); }
/// <summary> Add the HTML to be displayed below the search box </summary> /// <param name="Output"> Textwriter to write the HTML for this viewer</param> /// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering</param> /// <remarks> This writes the HTML from the static browse or info page here </remarks> public override void Add_Secondary_HTML(TextWriter Output, Custom_Tracer Tracer) { if (Tracer != null) { Tracer.Add_Trace("Private_Items_AggregationViewer.Add_Secondary_HTML", "Adding HTML"); } if (privateItems == null) { Output.WriteLine("<div class=\"SobekText\">"); Output.WriteLine("<p><strong>ERROR PULLING INFORMATION FROM DATABASE</strong></p>"); Output.WriteLine("</div>"); return; } if (privateItems.Total_Items == 0) { Output.WriteLine("<div class=\"SobekText\">"); Output.WriteLine("<br />"); Output.WriteLine("<p><strong>This collection does not include any PRIVATE or DARK items.</strong></p>"); Output.WriteLine("<br />"); Output.WriteLine("</div>"); return; } Output.WriteLine("<div class=\"SobekText\">"); Output.WriteLine("<br />"); Output.WriteLine("<p>Below is the list of all items linked to this aggregation which are either private (in process) or dark.</p>"); if (privateItems.Total_Items == 1) { Output.WriteLine("<p>There is only one matching item.</p>"); } else { if (privateItems.Total_Titles == privateItems.Total_Items) { Output.WriteLine("<p>There are a total of " + privateItems.Total_Items + " titles.</p>"); } else { Output.Write("<p>There are a total of " + privateItems.Total_Items + " items in "); if (privateItems.Total_Titles == 1) { Output.WriteLine("one title.</p>"); } else { Output.WriteLine(privateItems.Total_Titles + " titles.</p>"); } } } Output.WriteLine("<br />"); Output.WriteLine("</div>"); // Start the table to display Output.WriteLine("</div>"); Output.WriteLine("<center>"); // Start the table and add the header Output.WriteLine("<table width=\"1100px\" border=\"0px\" cellspacing=\"0px\" class=\"privateTable\">"); Output.WriteLine(" <tr align=\"left\" bgcolor=\"#0022a7\">"); Output.WriteLine(" <th align=\"left\" colspan=\"2\"><span style=\"color: White\"> <b>TITLE</b></span></th>"); Output.WriteLine(" <th align=\"center\"><span style=\"color: White\"><b>LAST ACTIVITY</b></span></th>"); Output.WriteLine(" <th align=\"center\"><span style=\"color: White\"><b>LAST MILESTONE</b></span></th>"); Output.WriteLine(" </tr>"); // Draw each title/item in this page of results foreach (Private_Items_List_Title thisTitle in privateItems.Title_Results) { // Is this a single item, or are there multiple items under this title? if (thisTitle.Item_Count > 1) { // Draw the title row individually first Output.WriteLine(" <tr align=\"left\" onmouseover=\"this.className='tableRowHighlight'\" onmouseout=\"this.className='tableRowNormal'\" onmousedown=\"window.location.href='" + currentMode.Base_URL + thisTitle.BibID + "'\">"); Output.WriteLine(" <td width=\"700px\" colspan=\"2\">"); Output.WriteLine(" <table>"); Output.WriteLine(" <tr><td colspan=\"3\"><a href=\"" + currentMode.Base_URL + thisTitle.BibID + "\"><span class=\"privateTableBibTitle\">" + thisTitle.Group_Title + "</span></a></td></tr>"); Output.WriteLine(" <tr><td width=\"180px\"><a href=\"" + currentMode.Base_URL + thisTitle.BibID + "\">" + thisTitle.BibID + "</a></td><td width=\"180px\">" + thisTitle.Type + "</td><td>( " + thisTitle.Item_Count + " volumes out of " + thisTitle.Complete_Item_Count + " total volumes )</td></tr>"); Output.WriteLine(" </table>"); Output.WriteLine(" </td>"); Output.WriteLine(" <td align=\"center\" width=\"200px\"><span class=\"privateTableBibDaysNumber\">" + Math.Floor(DateTime.Now.Subtract(thisTitle.Last_Activity_Date).TotalDays) + "</span><br />days ago</td>"); Output.WriteLine(" <td align=\"center\" width=\"200px\"><span class=\"privateTableBibDaysNumber\">" + Math.Floor(DateTime.Now.Subtract(thisTitle.Last_Milestone_Date).TotalDays) + "</span><br />days ago</td>"); Output.WriteLine(" </tr>"); // Now, draw each item row foreach (Private_Items_List_Item thisItem in thisTitle.Items) { Output.WriteLine(" <tr><td width=\"125px\"></td><td bgcolor=\"#e7e7e7\" colspan=\"3\"></td></tr>"); Output.WriteLine(" <tr align=\"left\" onmouseover=\"this.className='tableRowHighlight'\" onmouseout=\"this.className='tableRowNormal'\" onmousedown=\"window.location.href='" + currentMode.Base_URL + thisTitle.BibID + "/" + thisItem.VID + "'\">"); Output.WriteLine(" <td width=\"125px\">"); Output.WriteLine(" <td width=\"575px\">"); Output.WriteLine(" <table>"); Output.WriteLine(" <tr><td colspan=\"3\"><a href=\"" + currentMode.Base_URL + thisTitle.BibID + "/" + thisItem.VID + "\"><span class=\"privateTableItemTitle\">" + thisItem.Title + "</span></a></td></tr>"); Output.Write(" <tr><td width=\"180px\"><a href=\"" + currentMode.Base_URL + thisTitle.BibID + "/" + thisItem.VID + "\">" + thisTitle.BibID + " : " + thisItem.VID + "</a></td>"); if (thisItem.PubDate.Length > 0) { Output.WriteLine("<td>Dated " + thisItem.PubDate + "</td><td></td></tr>"); } else { Output.WriteLine("<td></td><td></td></tr>"); } if (thisItem.Internal_Comments.Length > 0) { Output.WriteLine(" <tr><td colspan=\"3\">“" + thisItem.Internal_Comments + "”</td></tr>"); } Output.WriteLine(" </table>"); Output.WriteLine(" </td>"); Output.WriteLine(" <td align=\"center\" width=\"200px\">" + thisItem.Last_Activity_Type.ToLower() + "<br /><span class=\"privateTableItemDaysNumber\">" + Math.Floor(DateTime.Now.Subtract(thisItem.Last_Activity_Date).TotalDays) + "</span><br />days ago</td>"); Output.WriteLine(" <td align=\"center\" width=\"200px\">" + thisItem.Last_Milestone_String + "<br /><span class=\"privateTableItemDaysNumber\">" + Math.Floor(DateTime.Now.Subtract(thisItem.Last_Milestone_Date).TotalDays) + "</span><br />days ago</td>"); Output.WriteLine(" </tr>"); } } else { // Get the single item Private_Items_List_Item thisItem = thisTitle.Items[0]; // Draw the integrated title/item row Output.WriteLine(" <tr align=\"left\" onmouseover=\"this.className='tableRowHighlight'\" onmouseout=\"this.className='tableRowNormal'\" onmousedown=\"window.location.href='" + currentMode.Base_URL + thisTitle.BibID + "/" + thisItem.VID + "'\">"); Output.WriteLine(" <td width=\"700px\" colspan=\"2\">"); Output.WriteLine(" <table>"); Output.WriteLine(" <tr><td colspan=\"3\"><a href=\"" + currentMode.Base_URL + thisTitle.BibID + "/" + thisItem.VID + "\"><span class=\"privateTableBibTitle\">" + thisItem.Title + "</span></a></td></tr>"); Output.Write(" <tr><td width=\"180px\"><a href=\"" + currentMode.Base_URL + thisTitle.BibID + "/" + thisItem.VID + "\">" + thisTitle.BibID + " : " + thisItem.VID + "</a></td><td width=\"180px\">" + thisTitle.Type + "</td>"); if (thisItem.PubDate.Length > 0) { Output.WriteLine("<td>Dated " + thisItem.PubDate + "</td></tr>"); } else { Output.WriteLine("<td></td></tr>"); } if (thisItem.Internal_Comments.Length > 0) { Output.WriteLine(" <tr><td colspan=\"3\">“" + thisItem.Internal_Comments + "”</td></tr>"); } Output.WriteLine(" </table>"); Output.WriteLine(" </td>"); Output.WriteLine(" <td align=\"center\" width=\"200px\">" + thisItem.Last_Activity_Type.ToLower() + "<br /><span class=\"privateTableItemDaysNumber\">" + Math.Floor(DateTime.Now.Subtract(thisItem.Last_Activity_Date).TotalDays) + "</span><br />days ago</td>"); Output.WriteLine(" <td align=\"center\" width=\"200px\">" + thisItem.Last_Milestone_String + "<br /><span class=\"privateTableItemDaysNumber\">" + Math.Floor(DateTime.Now.Subtract(thisItem.Last_Milestone_Date).TotalDays) + "</span><br />days ago</td>"); Output.WriteLine(" </tr>"); } // Add a final line in the table Output.WriteLine(" <tr><td bgcolor=\"#e7e7e7\" colspan=\"4\"></td></tr>"); } // End the table Output.WriteLine("</table>"); Output.WriteLine("</center>"); Output.WriteLine("<div id=\"pagecontainer_resumed\">"); Output.WriteLine("<br /> <br />"); }
private static List<Private_Items_List_Title> DataReader_To_Private_Items_List(DbDataReader Reader) { // Create return list List<Private_Items_List_Title> returnValue = new List<Private_Items_List_Title>(); Dictionary<int, int> lookup = new Dictionary<int, int>(); // Get all the main title values first while (Reader.Read()) { // Create new database title object for this Private_Items_List_Title result = new Private_Items_List_Title { RowNumber = Reader.GetInt32(0), BibID = Reader.GetString(1), Group_Title = Reader.GetString(2), Type = Reader.GetString(3), LastActivityDate = Reader.GetDateTime(6), LastMilestoneDate = Reader.GetDateTime(7), CompleteItemCount = Reader.GetInt32(8), PrimaryIdentifierType = Reader.GetString(9), PrimaryIdentifier = Reader.GetString(10) }; returnValue.Add(result); lookup.Add(result.RowNumber, returnValue.Count - 1); } // Move to the item table Reader.NextResult(); // If there were no titles, then there are no results if (returnValue.Count == 0) return returnValue; // Step through all the item rows, build the item, and add to the title Private_Items_List_Title titleResult = returnValue[0]; int lastRownumber = titleResult.RowNumber; while (Reader.Read()) { // Ensure this is the right title for this item int thisRownumber = Reader.GetInt32(0); if (thisRownumber != lastRownumber) { titleResult = returnValue[lookup[thisRownumber]]; lastRownumber = thisRownumber; } // Create new database item object for this Private_Items_List_Item result = new Private_Items_List_Item { VID = Reader.GetString(1), Title = Reader.GetString(2), LocallyArchived = Reader.GetBoolean(5), RemotelyArchived = Reader.GetBoolean(6), AggregationCodes = Reader.GetString(7), LastActivityDate = Reader.GetDateTime(8), LastActivityType = Reader.GetString(9), LastMilestone = Reader.GetInt32(10), LastMilestoneDate = Reader.GetDateTime(11) }; // Pull the values that are nullable string comments = Reader.GetString(3); string pubdate = Reader.GetString(4); string creator = Reader.GetString(19); // Assign the values if there are values if (comments.Length > 0) result.Internal_Comments = comments; if (pubdate.Length > 0) result.PubDate = pubdate; if (creator.Length > 0) result.Creator = creator; // Assign the embargo end if (!Reader.IsDBNull(18)) { DateTime embargoEnd = Reader.GetDateTime(18); if (embargoEnd.Year < 9999) result.EmbargoDate = embargoEnd; } // Add this to the title object titleResult.Add_Item_Result(result); } return returnValue; }