/// <summary> Build the information to display about the street, depending on what /// values are present in the Strongly typed street datarow </summary> /// <param name="thisStreet"> Strongly typed street datarow </param> /// <returns> text string (non-HTML) </returns> private string street_display(Map_Streets_DataSet.StreetsRow thisStreet) { // Start the return StringBuilder html = new StringBuilder(5000); // If there is a start and end streets, start with that if ((!thisStreet.IsStartAddressNull()) && (thisStreet.StartAddress > 0) && (!thisStreet.IsEndAddressNull()) && (thisStreet.EndAddress > 0)) { // Add this to the string html.Append(thisStreet.StartAddress + " - " + thisStreet.EndAddress); } // Add segment info if there is some if ((!thisStreet.IsSegmentDescriptionNull()) && (thisStreet.SegmentDescription.Length > 0)) { // If there is already start and end info, add a comma if (html.Length > 0) { html.Append(", "); } // Add this segment info html.Append(thisStreet.SegmentDescription); } // Return this built string return(html.ToString()); }
/// <summary> Insert the HTML for a single street column into the Stringbuilder </summary> /// <param name="streets"> Dataset containig all of the streets linked to this item </param> /// <param name="Output"> Response stream to write directly to </param> /// <param name="startRow"> Row of the set of streets to begin on </param> /// <param name="endRow"> Last row in the set of streets </param> protected internal void Insert_One_Street_Column(TextWriter Output, Map_Streets_DataSet streets, int startRow, int endRow) { // Declare some variables for looping string lastStreetName = "%"; // Start the table for this row Output.WriteLine("\t\t\t<table width=\"100%\"> <!-- Table to display a single column of street information -->"); // Now, loop through all the results int i = startRow; while (i < endRow) { // Get this street Map_Streets_DataSet.StreetsRow thisStreet = streets.Streets[i++]; // If this street name starts with a new letter, add the letter now if (thisStreet.StreetName.Trim()[0] != lastStreetName[0]) { // Add a row for the letter Output.WriteLine("\t\t\t\t<tr> <td colspan=\"3\" class=\"bigletter\" align=\"center\">" + (thisStreet.StreetName.Trim())[0] + "</td> </tr>"); lastStreetName = thisStreet.StreetName.Trim(); } // Start this row Output.WriteLine("\t\t\t\t<tr class=\"index\">"); // Add the street name and direction if ((!thisStreet.IsStreetDirectionNull()) && (thisStreet.StreetDirection.Length > 0)) { Output.WriteLine("\t\t\t\t\t<td>" + thisStreet.StreetName + ", " + thisStreet.StreetDirection + "<td>"); } else { Output.WriteLine("\t\t\t\t\t<td>" + thisStreet.StreetName + "<td>"); } // Determine the second column of data and add it Output.WriteLine("\t\t\t\t\t<td align=\"right\">" + street_display(thisStreet) + "</td>"); // Add the link to the sheet CurrentMode.ViewerCode = thisStreet.PageSequence.ToString(); Output.WriteLine("\t\t\t\t\t<td><a href=\"" + CurrentMode.Redirect_URL() + "\">" + thisStreet.PageName.Replace("Sheet", "").Trim() + "</a></td>"); // End this row Output.WriteLine("\t\t\t\t</tr>"); } // End this table Output.WriteLine("\t\t\t</table>"); }