C# code need to be more generic for all directions seleted

May 27 2009 4:44 PM

Hi all,

The following code is looking only for 2 directions. I need to be look directions more generic as many directions as there.Could anyone help me?

Thanks in advance.

 

#region Set Site And Direction Lanes

/// <summary>

/// Set site name and if the lane grouping is direction

/// add string representation of all selected lanes for each direction

/// to _laneHeaderSelectedLanes hashtable where the keys are 1 and 2

/// </summary>

private void SetSiteAndDirectionLanes(IRD.EnterpriseReporting.Framework.ReportingFramework

.ReportingUnits.LaneGroupingType laneGroupingType)

{

_siteShortName = Convert.ToString(_siteData.Rows[0]["site_name"]);

if (laneGroupingType == IRD.EnterpriseReporting.Framework.ReportingFramework

.ReportingUnits.LaneGroupingType.Direction)

{

string lane_numbers_d1 = Convert.ToString(_siteData.Rows[0]["lane_numbers_d1"]);

string lane_numbers_d2 = Convert.ToString(_siteData.Rows[0]["lane_numbers_d2"]);

if (lane_numbers_d1.Trim() != "")

{

lane_numbers_d1 = "#" + lane_numbers_d1.Replace(",", ", #");

}

if (lane_numbers_d2.Trim() != "")

{

lane_numbers_d2 = "#" + lane_numbers_d2.Replace(",", ", #");

}

_laneHeaderSelectedLanes.Add(1, lane_numbers_d1);

_laneHeaderSelectedLanes.Add(2, lane_numbers_d2);

}

}

#endregion