Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
3.7 KiB

  1. using System;
  2. using System.Collections;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Web;
  7. using System.Web.SessionState;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.HtmlControls;
  11. namespace OCAWReports
  12. {
  13. /// <summary>
  14. /// Summary description for solutionstatus.
  15. /// </summary>
  16. public class solutionstatus : System.Web.UI.Page
  17. {
  18. protected System.Web.UI.WebControls.Table tblWeeklySolution;
  19. protected System.Web.UI.WebControls.Image imgDailySolution;
  20. protected System.Web.UI.WebControls.Image imgWeeklySolution;
  21. private void Page_Load(object sender, System.EventArgs e)
  22. {
  23. int x = -1;
  24. // int y = 0;
  25. // int rowCnt = 7;
  26. // int rowCtr=0;
  27. // int cellCtr=0;
  28. // int cellCnt = 3;
  29. string sFName;
  30. long[] LASpecific = new long[7];
  31. long[] LAGeneral = new long[7];
  32. long[] LAStopCode = new long[7];
  33. // long lTemp=0,lTotalAnon=0,lTotalCustomer=0;
  34. Object[] yValues = new Object[7];
  35. Object[] xValues = new Object[7];
  36. Object[] yValues1 = new Object[3];
  37. Object[] xValues1 = new Object[3];
  38. OCAData.CCountDailyClass rpt = new OCAData.CCountDailyClass();
  39. System.DateTime dDate = new System.DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month,
  40. System.DateTime.Now.Day);
  41. OWC.WCChart oChart;
  42. // OWC.WCChart oChart1;
  43. OWC.ChartSpaceClass oSpace = new OWC.ChartSpaceClass();
  44. OWC.ChartSpaceClass oSpace1 = new OWC.ChartSpaceClass();
  45. OWC.WCSeries oSeries;
  46. // OWC.WCSeries oSeries1;
  47. // OWC.WCDataLabels oLabels;
  48. // OWC.WCDataLabelsCollection oLabelCollection;
  49. //System.Array xValues = System.Array.CreateInstance(typeof(Object), 7, 1);
  50. //Array xValues = Array.CreateInstance(typeof(Object),3);
  51. Server.ScriptTimeout = 360;
  52. oSpace.Clear();
  53. oSpace.Refresh();
  54. oChart = oSpace.Charts.Add(0);
  55. oChart.Type = OWC.ChartChartTypeEnum.chChartTypeBarClustered;
  56. oChart.HasLegend = true;
  57. //Begin Image One
  58. for(x=0;x<7;x++)
  59. {
  60. oSeries = oChart.SeriesCollection.Add(x);
  61. try
  62. {
  63. LASpecific[x] = rpt.GetSpecificSolutions(dDate.AddDays(-(x + 1)));
  64. }
  65. catch
  66. {
  67. LASpecific[x] = 0;
  68. }
  69. try
  70. {
  71. LAGeneral[x] = rpt.GetGeneralSolutions(dDate.AddDays(-(x + 1)));
  72. }
  73. catch
  74. {
  75. LAGeneral[x] = 0;
  76. }
  77. try
  78. {
  79. LAStopCode[x] = rpt.GetStopCodeSolutions(dDate.AddDays(-(x + 1)));
  80. }
  81. catch
  82. {
  83. LAStopCode[x] = 0;
  84. }
  85. xValues.SetValue(LASpecific[x], 0);
  86. xValues.SetValue(LAGeneral[x], 1);
  87. xValues.SetValue(LAStopCode[x], 2);
  88. yValues.SetValue("Specific", 0);
  89. yValues.SetValue("General", 1);
  90. yValues.SetValue("StopCode", 2);
  91. oChart.HasTitle = true;
  92. oChart.Title.Caption = "Daily Solution Status";
  93. oSeries.Caption = dDate.AddDays(-(x + 1)).Date.ToString(); //chDimCategories
  94. oSeries.SetData(OWC.ChartDimensionsEnum.chDimCategories, -1, yValues);
  95. oSeries.SetData(OWC.ChartDimensionsEnum.chDimValues, -1, xValues);
  96. oSeries.Type = OWC.ChartChartTypeEnum.chChartTypeColumnClustered;
  97. }
  98. sFName = "DailySolution";
  99. oSpace.ExportPicture(Server.MapPath(sFName), "gif", 1000, 512);
  100. imgDailySolution.ImageUrl = sFName;
  101. }
  102. #region Web Form Designer generated code
  103. override protected void OnInit(EventArgs e)
  104. {
  105. //
  106. // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  107. //
  108. InitializeComponent();
  109. base.OnInit(e);
  110. }
  111. /// <summary>
  112. /// Required method for Designer support - do not modify
  113. /// the contents of this method with the code editor.
  114. /// </summary>
  115. private void InitializeComponent()
  116. {
  117. this.Load += new System.EventHandler(this.Page_Load);
  118. }
  119. #endregion
  120. }
  121. }