}//public void ButtonNew_Click() /// <summary>ButtonInsert_Open().</summary> public void ButtonOpen_Click ( Object sender, EventArgs e ) { string exceptionMessage = null; string filenameXml = null; filenameXml = URIFile; UtilityXml.ReadXml ( ref DataSetDataGrid, ref exceptionMessage, ref filenameXml ); if ( exceptionMessage != null ) { Feedback = exceptionMessage; } DataSourceBind(); }
/// <summary>ReadXml</summary> public static void ReadXml ( ref string filenameXml, ref DataSet dataSet, ref string exceptionMessage, ref string[] columnName ) { HttpContext httpContext = HttpContext.Current; try { UtilityXml.ReadXml ( ref dataSet, ref exceptionMessage, ref filenameXml ); if ( exceptionMessage != null ) { return; } if ( dataSet != null ) { UtilityDatabase.DataSetColumn ( ref dataSet, ref columnName, ref exceptionMessage ); if ( exceptionMessage != null ) { return; } } }//try catch ( Exception exception ) { exceptionMessage = "Exception: " + exception.Message; } if ( httpContext == null ) { System.Console.WriteLine( exceptionMessage ); } }//public static void ReadXml()
}//public static void Main /// <summary>GraphChart().</summary> public static void GraphChart ( ref DataSet dataSet, ref String chartGraphType, ref String xAxis, ref String yAxis ) { NameValueCollection nameValueCollectionRequest = null; int nameValueCollectionKeyIndexChartGraphType = -1; int nameValueCollectionKeyIndexFilenameXml = -1; int nameValueCollectionKeyIndexXAxis = -1; int nameValueCollectionKeyIndexYAxis = -1; String exceptionMessage = null; String[] nameValueCollectionKey = null; String[][] nameValueCollectionValue = null; HttpContext httpContext = HttpContext.Current; dataSet = new DataSet(); // Load NameValueCollection object. nameValueCollectionRequest = httpContext.Request.QueryString; UtilityCollection.NameValueCollectionExtract ( nameValueCollectionRequest, ref nameValueCollectionKey, ref nameValueCollectionValue ); nameValueCollectionKeyIndexFilenameXml = Array.IndexOf( nameValueCollectionKey, ArgumentValues[0] ); nameValueCollectionKeyIndexChartGraphType = Array.IndexOf( nameValueCollectionKey, ArgumentValues[1] ); nameValueCollectionKeyIndexXAxis = Array.IndexOf( nameValueCollectionKey, ArgumentValues[2] ); nameValueCollectionKeyIndexYAxis = Array.IndexOf( nameValueCollectionKey, ArgumentValues[3] ); if ( nameValueCollectionKeyIndexChartGraphType >= 0 ) { chartGraphType = nameValueCollectionValue[nameValueCollectionKeyIndexChartGraphType][0]; }//if ( nameValueCollectionKeyIndexChartGraphType >= 0 ) if ( nameValueCollectionKeyIndexXAxis >= 0 ) { xAxis = nameValueCollectionValue[nameValueCollectionKeyIndexXAxis][0]; }//if ( nameValueCollectionKeyIndexXAxis >= 0 ) if ( nameValueCollectionKeyIndexYAxis >= 0 ) { yAxis = nameValueCollectionValue[nameValueCollectionKeyIndexYAxis][0]; }//if ( nameValueCollectionKeyIndexYAxis >= 0 ) for ( int nameValueCollectionValueIndex = 0; nameValueCollectionValueIndex < nameValueCollectionValue[nameValueCollectionKeyIndexFilenameXml].Length; ++nameValueCollectionValueIndex ) { #if (DEBUG) if ( httpContext == null ) { System.Console.WriteLine( nameValueCollectionValue[nameValueCollectionKeyIndexFilenameXml][nameValueCollectionValueIndex] ); } else { httpContext.Response.Write( nameValueCollectionValue[nameValueCollectionKeyIndexFilenameXml][nameValueCollectionValueIndex] ); } #endif UtilityXml.ReadXml ( ref dataSet, ref exceptionMessage, ref nameValueCollectionValue[nameValueCollectionKeyIndexFilenameXml][nameValueCollectionValueIndex] ); }//foreach ( String filenameXml in nameValueCollectionValue ) UtilityDatabase.PrintValues ( dataSet ); }//public static void GraphChart()