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.

733 lines
25 KiB

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Threading;
  7. using System.Text;
  8. namespace OCAReports
  9. {
  10. /// <summary>
  11. /// Summary description for frmSolutionStatus.
  12. /// </summary>
  13. public class frmSolutionStatus : System.Windows.Forms.Form
  14. {
  15. private System.Windows.Forms.TabControl tabControl1;
  16. private System.Windows.Forms.TabPage tabPage1;
  17. private AxMSChart20Lib.AxMSChart axMSChart1;
  18. private System.Windows.Forms.TabPage tabPage2;
  19. private System.Windows.Forms.TabPage tabPage3;
  20. private System.Windows.Forms.Label label5;
  21. private System.Windows.Forms.Label label7;
  22. private System.Windows.Forms.ProgressBar progressBar1;
  23. private System.Windows.Forms.Label lblPurpose;
  24. private System.Windows.Forms.StatusBar statusBar1;
  25. private System.Windows.Forms.Label lblStatement;
  26. private System.Windows.Forms.MonthCalendar monthCalendar1;
  27. private System.ComponentModel.Container components = null;
  28. /// <summary>
  29. /// Required designer variable.
  30. /// </summary>
  31. #region ########################Global Variables######################################33
  32. /*************************************************************************************
  33. * module: frmAnonCust.cs - Global varibles and objects
  34. *
  35. * author: Tim Ragain
  36. * date: Jan 22, 2002
  37. *
  38. * Purpose: All global threads and variables are declared.
  39. *
  40. *************************************************************************************/
  41. public long[] lSpecific = new long[7];
  42. public long[] lGeneral = new long[7];
  43. public long[] lStopCode = new long[7];
  44. public long[] lNoSolution = new long[7];
  45. public DateTime[] lDate = new DateTime[7];
  46. Thread t_DayOne;
  47. Thread t_DayTwo;
  48. Thread t_DayThree;
  49. Thread t_DayFour;
  50. Thread t_DayFive;
  51. Thread t_DaySix;
  52. Thread t_DaySeven;
  53. private bool bIsStillProcessing = false;
  54. private bool bHasProcessed = false;
  55. #endregion
  56. public frmSolutionStatus()
  57. {
  58. //
  59. // Required for Windows Form Designer support
  60. //
  61. InitializeComponent();
  62. //
  63. // TODO: Add any constructor code after InitializeComponent call
  64. //
  65. }
  66. /// <summary>
  67. /// Clean up any resources being used.
  68. /// </summary>
  69. protected override void Dispose( bool disposing )
  70. {
  71. if( disposing )
  72. {
  73. if(components != null)
  74. {
  75. components.Dispose();
  76. }
  77. }
  78. base.Dispose( disposing );
  79. }
  80. #region Windows Form Designer generated code
  81. /// <summary>
  82. /// Required method for Designer support - do not modify
  83. /// the contents of this method with the code editor.
  84. /// </summary>
  85. private void InitializeComponent()
  86. {
  87. System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmSolutionStatus));
  88. this.tabControl1 = new System.Windows.Forms.TabControl();
  89. this.tabPage1 = new System.Windows.Forms.TabPage();
  90. this.axMSChart1 = new AxMSChart20Lib.AxMSChart();
  91. this.tabPage2 = new System.Windows.Forms.TabPage();
  92. this.tabPage3 = new System.Windows.Forms.TabPage();
  93. this.label5 = new System.Windows.Forms.Label();
  94. this.label7 = new System.Windows.Forms.Label();
  95. this.progressBar1 = new System.Windows.Forms.ProgressBar();
  96. this.lblPurpose = new System.Windows.Forms.Label();
  97. this.statusBar1 = new System.Windows.Forms.StatusBar();
  98. this.lblStatement = new System.Windows.Forms.Label();
  99. this.monthCalendar1 = new System.Windows.Forms.MonthCalendar();
  100. this.tabControl1.SuspendLayout();
  101. this.tabPage1.SuspendLayout();
  102. ((System.ComponentModel.ISupportInitialize)(this.axMSChart1)).BeginInit();
  103. this.tabPage3.SuspendLayout();
  104. this.SuspendLayout();
  105. //
  106. // tabControl1
  107. //
  108. this.tabControl1.Controls.AddRange(new System.Windows.Forms.Control[] {
  109. this.tabPage1,
  110. this.tabPage2,
  111. this.tabPage3});
  112. this.tabControl1.Location = new System.Drawing.Point(8, 88);
  113. this.tabControl1.Name = "tabControl1";
  114. this.tabControl1.SelectedIndex = 0;
  115. this.tabControl1.Size = new System.Drawing.Size(736, 400);
  116. this.tabControl1.TabIndex = 92;
  117. //
  118. // tabPage1
  119. //
  120. this.tabPage1.Controls.AddRange(new System.Windows.Forms.Control[] {
  121. this.axMSChart1});
  122. this.tabPage1.Location = new System.Drawing.Point(4, 22);
  123. this.tabPage1.Name = "tabPage1";
  124. this.tabPage1.Size = new System.Drawing.Size(728, 374);
  125. this.tabPage1.TabIndex = 0;
  126. this.tabPage1.Text = "Graphical";
  127. //
  128. // axMSChart1
  129. //
  130. this.axMSChart1.ContainingControl = this;
  131. this.axMSChart1.DataSource = null;
  132. this.axMSChart1.Location = new System.Drawing.Point(8, 8);
  133. this.axMSChart1.Name = "axMSChart1";
  134. this.axMSChart1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMSChart1.OcxState")));
  135. this.axMSChart1.Size = new System.Drawing.Size(720, 344);
  136. this.axMSChart1.TabIndex = 71;
  137. this.axMSChart1.ChartSelected += new AxMSChart20Lib._DMSChartEvents_ChartSelectedEventHandler(this.axMSChart1_ChartSelected);
  138. //
  139. // tabPage2
  140. //
  141. this.tabPage2.Location = new System.Drawing.Point(4, 22);
  142. this.tabPage2.Name = "tabPage2";
  143. this.tabPage2.Size = new System.Drawing.Size(728, 374);
  144. this.tabPage2.TabIndex = 1;
  145. this.tabPage2.Text = "Statistical";
  146. this.tabPage2.Visible = false;
  147. this.tabPage2.Paint += new System.Windows.Forms.PaintEventHandler(this.tabPage2_Paint);
  148. //
  149. // tabPage3
  150. //
  151. this.tabPage3.Controls.AddRange(new System.Windows.Forms.Control[] {
  152. this.label5,
  153. this.label7});
  154. this.tabPage3.Location = new System.Drawing.Point(4, 22);
  155. this.tabPage3.Name = "tabPage3";
  156. this.tabPage3.Size = new System.Drawing.Size(728, 374);
  157. this.tabPage3.TabIndex = 2;
  158. this.tabPage3.Text = "Notes";
  159. this.tabPage3.Visible = false;
  160. //
  161. // label5
  162. //
  163. this.label5.Location = new System.Drawing.Point(32, 72);
  164. this.label5.Name = "label5";
  165. this.label5.Size = new System.Drawing.Size(576, 56);
  166. this.label5.TabIndex = 80;
  167. this.label5.Text = @"The Stop Code troubleshooter solutions are displayed should a specific or general solution not exist and the stop code associated with the stop error link to a known Knowledge Base article. There will eventually be replaced by general solutions when teh full set of general buckets have been identified and solutions developed.";
  168. //
  169. // label7
  170. //
  171. this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  172. this.label7.Location = new System.Drawing.Point(32, 32);
  173. this.label7.Name = "label7";
  174. this.label7.Size = new System.Drawing.Size(240, 24);
  175. this.label7.TabIndex = 76;
  176. this.label7.Text = "Notes";
  177. //
  178. // progressBar1
  179. //
  180. this.progressBar1.Location = new System.Drawing.Point(568, 502);
  181. this.progressBar1.Name = "progressBar1";
  182. this.progressBar1.Size = new System.Drawing.Size(384, 23);
  183. this.progressBar1.TabIndex = 89;
  184. this.progressBar1.Visible = false;
  185. //
  186. // lblPurpose
  187. //
  188. this.lblPurpose.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  189. this.lblPurpose.Location = new System.Drawing.Point(8, 2);
  190. this.lblPurpose.Name = "lblPurpose";
  191. this.lblPurpose.Size = new System.Drawing.Size(112, 24);
  192. this.lblPurpose.TabIndex = 91;
  193. this.lblPurpose.Text = "Purpose";
  194. //
  195. // statusBar1
  196. //
  197. this.statusBar1.Location = new System.Drawing.Point(0, 512);
  198. this.statusBar1.Name = "statusBar1";
  199. this.statusBar1.Size = new System.Drawing.Size(968, 22);
  200. this.statusBar1.TabIndex = 88;
  201. //
  202. // lblStatement
  203. //
  204. this.lblStatement.Location = new System.Drawing.Point(8, 32);
  205. this.lblStatement.Name = "lblStatement";
  206. this.lblStatement.Size = new System.Drawing.Size(744, 40);
  207. this.lblStatement.TabIndex = 90;
  208. this.lblStatement.Text = @"The information below outlines the relationship between files in our database and the associated solution status. The table header describes the type of solution displayed to the customer. In the case of no solution, the Online Crash Analysis Web site displays information indicating that our service is currently researching the issue in question.";
  209. //
  210. // monthCalendar1
  211. //
  212. this.monthCalendar1.Location = new System.Drawing.Point(760, 82);
  213. this.monthCalendar1.Name = "monthCalendar1";
  214. this.monthCalendar1.TabIndex = 86;
  215. this.monthCalendar1.DateSelected += new System.Windows.Forms.DateRangeEventHandler(this.monthCalendar1_DateSelected);
  216. //
  217. // frmSolutionStatus
  218. //
  219. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  220. this.ClientSize = new System.Drawing.Size(968, 534);
  221. this.Controls.AddRange(new System.Windows.Forms.Control[] {
  222. this.tabControl1,
  223. this.progressBar1,
  224. this.lblPurpose,
  225. this.statusBar1,
  226. this.lblStatement,
  227. this.monthCalendar1});
  228. this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  229. this.Name = "frmSolutionStatus";
  230. this.Text = "frmSolutionStatus";
  231. this.Resize += new System.EventHandler(this.frmSolutionStatus_Resize);
  232. this.Closing += new System.ComponentModel.CancelEventHandler(this.frmSolutionStatus_Closing);
  233. this.Load += new System.EventHandler(this.frmSolutionStatus_Load);
  234. this.tabControl1.ResumeLayout(false);
  235. this.tabPage1.ResumeLayout(false);
  236. ((System.ComponentModel.ISupportInitialize)(this.axMSChart1)).EndInit();
  237. this.tabPage3.ResumeLayout(false);
  238. this.ResumeLayout(false);
  239. }
  240. #endregion
  241. /*************************************************************************************
  242. * module: frmSolutionStatus.cs - frmSolutionStatus_Load
  243. *
  244. * author: Tim Ragain
  245. * date: Jan 23, 2002
  246. *
  247. * Purpose: Initialize the calendar control to display one week. Each day is represented
  248. * by a global thread. Set the form title bar to the appropriate start and end days.
  249. *************************************************************************************/
  250. private void frmSolutionStatus_Load(object sender, System.EventArgs e)
  251. {
  252. DateTime dDate = DateTime.Today;
  253. short x = 0, y = 0;
  254. for(x=7, y=1;x>=1;x--, y++)
  255. {
  256. axMSChart1.Row = y;
  257. axMSChart1.RowLabel = dDate.AddDays(-(x)).ToShortDateString(); //+ dDate.Date.ToString();
  258. }
  259. monthCalendar1.SelectionStart = dDate.AddDays(-7);
  260. monthCalendar1.SelectionEnd = dDate.AddDays(-1);
  261. this.Show();
  262. this.Refresh();
  263. axMSChart1.RowCount = 7;
  264. this.ParentForm.Refresh();
  265. this.Text = "Solutions Status " + monthCalendar1.SelectionStart.ToShortDateString() + " - " +
  266. monthCalendar1.SelectionEnd.ToShortDateString();
  267. }
  268. /*************************************************************************************
  269. * module: frmSolutionStatus.cs - frmSolutionStatus_Resize
  270. *
  271. * author: Tim Ragain
  272. * date: Jan 24, 2002
  273. *
  274. * Purpose: to set the controls to the proper position and resize after resizing
  275. * the form
  276. *************************************************************************************/
  277. private void frmSolutionStatus_Resize(object sender, System.EventArgs e)
  278. {
  279. int buf = 20;
  280. progressBar1.Top = statusBar1.Top;
  281. progressBar1.Left = this.Width - progressBar1.Width;
  282. monthCalendar1.Left = this.Width - (monthCalendar1.Width + buf);
  283. // cmdGetData.Left = monthCalendar1.Left;
  284. tabControl1.Width = this.Width - (monthCalendar1.Width + (buf * 3));
  285. tabControl1.Height = this.Height - (statusBar1.Height + lblPurpose.Height + lblStatement.Height + (buf * 4));
  286. axMSChart1.Height = tabPage1.Height - buf;
  287. axMSChart1.Width = tabPage1.Width - buf;
  288. }
  289. /*************************************************************************************
  290. * module: frmSolutionStatus.cs - monthCalendar1_DateSelected
  291. *
  292. * author: Tim Ragain
  293. * date: Jan 24, 2002
  294. *
  295. * Purpose: To set the selection dates for one week after the user selects an ending
  296. * date. Also resets the title bar of the form for the new dates.
  297. *************************************************************************************/
  298. private void monthCalendar1_DateSelected(object sender, System.Windows.Forms.DateRangeEventArgs e)
  299. {
  300. System.DateTime dDate = new System.DateTime(monthCalendar1.SelectionStart.Year, monthCalendar1.SelectionStart.Month,
  301. monthCalendar1.SelectionStart.Day);
  302. monthCalendar1.SelectionStart = dDate.AddDays(-6);
  303. monthCalendar1.SelectionEnd = dDate.Date;
  304. this.Text = "Executive Summary Weekly Report " + monthCalendar1.SelectionStart.ToShortDateString() + " - " +
  305. monthCalendar1.SelectionEnd.ToShortDateString();
  306. tabPage2.Refresh();
  307. }
  308. public void GetData()
  309. {
  310. short x = 0;
  311. System.DateTime dDate = new System.DateTime(monthCalendar1.SelectionStart.Year, monthCalendar1.SelectionStart.Month,
  312. monthCalendar1.SelectionStart.Day);
  313. axMSChart1.ColumnCount = 4;
  314. axMSChart1.RowCount = 7;
  315. // cmdGetData.Enabled = false;
  316. bIsStillProcessing = true;
  317. progressBar1.Visible = true;
  318. progressBar1.Minimum = 0;
  319. progressBar1.Maximum = 35;
  320. progressBar1.Value = 0;
  321. progressBar1.Refresh();
  322. axMSChart1.ShowLegend = true;
  323. axMSChart1.Plot.SeriesCollection[1].LegendText = "Specific";
  324. axMSChart1.Plot.SeriesCollection[2].LegendText = "General";
  325. axMSChart1.Plot.SeriesCollection[3].LegendText = "Stop Code";
  326. axMSChart1.Plot.SeriesCollection[4].LegendText = "No Solution";
  327. for(x=1;x<8;x++)
  328. {
  329. axMSChart1.Row = x;
  330. axMSChart1.RowLabel = dDate.AddDays(x-1).ToShortDateString(); //+ dDate.Date.ToString();
  331. }
  332. ThreadStart s_DayOne = new ThreadStart(this.TDayOne);
  333. t_DayOne = new Thread(s_DayOne);
  334. t_DayOne.Name = "Thread One";
  335. ThreadStart s_DayTwo = new ThreadStart(this.TDayTwo);
  336. t_DayTwo = new Thread(s_DayTwo);
  337. t_DayTwo.Name = "Thread Two";
  338. ThreadStart s_DayThree = new ThreadStart(this.TDayThree);
  339. t_DayThree = new Thread(s_DayThree);
  340. t_DayThree.Name = "Thread Three";
  341. ThreadStart s_DayFour = new ThreadStart(this.TDayFour);
  342. t_DayFour = new Thread(s_DayFour);
  343. t_DayFour.Name = "Thread Four";
  344. ThreadStart s_DayFive = new ThreadStart(this.TDayFive);
  345. t_DayFive = new Thread(s_DayFive);
  346. t_DayFive.Name = "Thread Five";
  347. ThreadStart s_DaySix = new ThreadStart(this.TDaySix);
  348. t_DaySix = new Thread(s_DaySix);
  349. t_DaySix.Name = "Thread Six";
  350. ThreadStart s_DaySeven = new ThreadStart(this.TDaySeven);
  351. t_DaySeven = new Thread(s_DaySeven);
  352. t_DaySeven.Name = "Thread Seven";
  353. t_DayOne.Start();
  354. t_DayTwo.Start();
  355. t_DayThree.Start();
  356. t_DayFour.Start();
  357. t_DayFive.Start();
  358. t_DaySix.Start();
  359. t_DaySeven.Start();
  360. }
  361. /*************************************************************************************
  362. * module: frmSolutionStatus.cs - All procedures
  363. *
  364. * author: Tim Ragain
  365. * date: Jan 24, 2002
  366. *
  367. * Purpose: calls TLoadData and sends the appropriate day and count information.
  368. *
  369. *************************************************************************************/
  370. private void TDayOne()
  371. {
  372. this.TLoadData(0, 1);
  373. }
  374. private void TDayTwo()
  375. {
  376. this.TLoadData(1, 2);
  377. }
  378. private void TDayThree()
  379. {
  380. this.TLoadData(2, 3);
  381. }
  382. private void TDayFour()
  383. {
  384. this.TLoadData(3, 4);
  385. }
  386. private void TDayFive()
  387. {
  388. this.TLoadData(4, 5);
  389. }
  390. private void TDaySix()
  391. {
  392. this.TLoadData(5, 6);
  393. }
  394. private void TDaySeven()
  395. {
  396. this.TLoadData(6, 7);
  397. }
  398. /*************************************************************************************
  399. * module: frmSolutionStatus.cs - TLoadData
  400. *
  401. * author: Tim Ragain
  402. * date: Jan 24, 2002
  403. *
  404. * Purpose: Takes two variables the x represents the day as an integer and the sCount is a
  405. * short representing the column of the Calendar control. This initializes the OCAData.dll
  406. * control and calls the GetDailyCount and GetDailyAnon procedures. The anonymous count is
  407. * subtracted from the total count to get the customer count. The appropriate column
  408. * and row is updated.
  409. *************************************************************************************/
  410. private void TLoadData(int x, short sCount)
  411. {
  412. OCAData.CCountDailyClass rpt = new OCAData.CCountDailyClass();
  413. System.DateTime dDate = new System.DateTime(monthCalendar1.SelectionStart.Year, monthCalendar1.SelectionStart.Month,
  414. monthCalendar1.SelectionStart.Day);
  415. long l_SpecificSolutions = 0, l_GeneralSolutions = 0, l_StopCodes = 0, l_TotalRecords = 0;
  416. //***********Total Record Count***************
  417. UpdateStatus();
  418. statusBar1.Text = "Getting Specific Solutions for " + dDate.AddDays(x).Date.ToString();
  419. lDate[x] = dDate.AddDays(x);
  420. try
  421. {
  422. l_SpecificSolutions = rpt.GetSpecificSolutions(dDate.AddDays(x));
  423. }
  424. catch
  425. {
  426. l_SpecificSolutions = -1;
  427. }
  428. lock(this)
  429. {
  430. axMSChart1.Row = sCount;
  431. axMSChart1.Column = (short)1;
  432. axMSChart1.RowLabel = dDate.AddDays(x).ToShortDateString(); //+ dDate.Date.ToString();
  433. axMSChart1.Data = l_SpecificSolutions.ToString();
  434. lSpecific[x] = l_SpecificSolutions;
  435. }
  436. UpdateStatus();
  437. statusBar1.Text = "Getting General Solutions for " + dDate.AddDays(x).Date.ToString();
  438. try
  439. {
  440. l_GeneralSolutions = rpt.GetGeneralSolutions(dDate.AddDays(x));
  441. }
  442. catch
  443. {
  444. l_GeneralSolutions = -1;
  445. }
  446. lock(this)
  447. {
  448. axMSChart1.Row = sCount;
  449. axMSChart1.Column = (short)2;
  450. axMSChart1.Data = l_GeneralSolutions.ToString();
  451. lGeneral[x] = l_GeneralSolutions;
  452. }
  453. UpdateStatus();
  454. statusBar1.Text = "Getting Stop Code Troubleshooters for " + dDate.AddDays(x).Date.ToString();
  455. try
  456. {
  457. l_StopCodes = rpt.GetStopCodeSolutions(dDate.AddDays(x));
  458. }
  459. catch
  460. {
  461. l_StopCodes = -1;
  462. }
  463. lock(this)
  464. {
  465. axMSChart1.Row = sCount;
  466. axMSChart1.Column = (short)3;
  467. axMSChart1.Data = l_StopCodes.ToString();
  468. lStopCode[x] = l_StopCodes;
  469. }
  470. UpdateStatus();
  471. statusBar1.Text = "Getting No Solution incidents for " + dDate.AddDays(x).Date.ToString();
  472. try
  473. {
  474. l_TotalRecords = rpt.GetDailyCount(dDate.AddDays(x));
  475. }
  476. catch
  477. {
  478. l_TotalRecords = -1;
  479. }
  480. lock(this)
  481. {
  482. axMSChart1.Row = sCount;
  483. axMSChart1.Column = (short)4;
  484. l_TotalRecords = l_TotalRecords - (l_StopCodes + l_GeneralSolutions + l_SpecificSolutions);
  485. axMSChart1.Data = l_TotalRecords.ToString();
  486. lNoSolution[x] = l_TotalRecords;
  487. }
  488. UpdateStatus();
  489. this.Refresh();
  490. }
  491. /*************************************************************************************
  492. * module: frmSolutionStatus.cs - UpdateStatus
  493. *
  494. * author: Tim Ragain
  495. * date: Jan 24, 2002
  496. *
  497. * Purpose: This updates the progress bar and when all threads are returned the
  498. * status bar is updated to done and the cmdGetData button is enabled.
  499. *************************************************************************************/
  500. private void UpdateStatus()
  501. {
  502. progressBar1.Value = progressBar1.Value + 1;
  503. axMSChart1.Refresh();
  504. progressBar1.Refresh();
  505. if(progressBar1.Value >= 34)
  506. {
  507. statusBar1.Text = "Done";
  508. progressBar1.Visible = false;
  509. // cmdGetData.Enabled = true;
  510. bIsStillProcessing = false;
  511. bHasProcessed = true;
  512. }
  513. }
  514. /*************************************************************************************
  515. * module: frmSolutionStatus.cs - tabPage2_Paint
  516. *
  517. * author: Tim Ragain
  518. * date: Jan 24, 2002
  519. *
  520. * Purpose: Paints the grid for the tab2 control. The global variables lAnonymous[x] and
  521. * lCustomer[x] are used to display the appropriate information to the grid.
  522. *************************************************************************************/
  523. private void tabPage2_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
  524. {
  525. Pen curvePen = new Pen(Color.Blue);
  526. Pen dbPen = new Pen(Color.DarkBlue);
  527. Pen whPen = new Pen(Color.White);
  528. float row = .05F;
  529. int x = 0, y = 0, min = 3, max = 12, pad = 10, top = 5, cols=5;
  530. int colwidth = 0;
  531. PointF pt = new PointF(0, 0);
  532. Font ft = new Font("Verdona", 12);
  533. SolidBrush sb = new SolidBrush(Color.Black);
  534. StringBuilder strTemp = new StringBuilder(40);
  535. System.DateTime dDate = new System.DateTime(monthCalendar1.SelectionEnd.Year, monthCalendar1.SelectionEnd.Month,
  536. monthCalendar1.SelectionEnd.Day);
  537. colwidth = tabPage2.Width / cols;
  538. for(x=min;x<max;x++)
  539. {
  540. if(x > (min - 1) && x < top)
  541. {
  542. e.Graphics.DrawLine(dbPen, pad, tabPage2.Height * (row * x),
  543. tabPage2.Width - pad, tabPage2.Height * (row * x));
  544. }
  545. else
  546. {
  547. e.Graphics.DrawLine(curvePen, pad, tabPage2.Height * (row * x),
  548. tabPage2.Width - pad, tabPage2.Height * (row * x));
  549. }
  550. }
  551. //x y x1 y1
  552. for(x=0;x<cols;x++)
  553. {
  554. //left side light blue
  555. e.Graphics.DrawLine(curvePen, pad + (colwidth * x),
  556. tabPage2.Height * (row * (min + 1)),
  557. pad + (colwidth * x), tabPage2.Height * (row * (max - 1)));
  558. //right side light blue
  559. e.Graphics.DrawLine(curvePen, tabPage2.Width - pad,
  560. tabPage2.Height * (row * (min + 1)),
  561. tabPage2.Width - pad, tabPage2.Height * (row * (max - 1)));
  562. //left side upper dark blue
  563. e.Graphics.DrawLine(dbPen, pad + (colwidth * x),
  564. tabPage2.Height * (row * min),
  565. pad + (colwidth * x), tabPage2.Height * (row * (min + 1)));
  566. //right side upper dark blue
  567. e.Graphics.DrawLine(dbPen, tabPage2.Width - pad,
  568. tabPage2.Height * (row * min),
  569. tabPage2.Width - pad, tabPage2.Height * (row * (min + 1)));
  570. }
  571. for(x=0,y=6;x<7;x++,y--)
  572. {
  573. pt.X = pad + (colwidth * x);
  574. pt.Y = tabPage2.Height * (row * min);
  575. strTemp.Remove(0, strTemp.Length);
  576. switch(x)
  577. {
  578. case 0:
  579. strTemp.Append("Date");
  580. break;
  581. case 1:
  582. strTemp.Append("Specific");
  583. break;
  584. case 2:
  585. strTemp.Append("General");
  586. break;
  587. case 3:
  588. strTemp.Append("Stop Code");
  589. break;
  590. case 4:
  591. strTemp.Append("No Solution");
  592. break;
  593. default:
  594. strTemp.Append("");
  595. break;
  596. }
  597. e.Graphics.DrawString(strTemp.ToString(), ft, sb, pt, System.Drawing.StringFormat.GenericDefault);
  598. pt.X = pad + (colwidth * 0);
  599. pt.Y = ((tabPage2.Height * row) * (min + (x + 1)));
  600. e.Graphics.DrawString(dDate.AddDays(-y).Date.ToShortDateString(), ft, sb, pt, System.Drawing.StringFormat.GenericDefault);
  601. pt.X = pad + (colwidth * 1);
  602. pt.Y = ((tabPage2.Height * row) * (min + (x + 1)));
  603. e.Graphics.DrawString(lSpecific[x].ToString(), ft, sb, pt, System.Drawing.StringFormat.GenericDefault);
  604. pt.X = pad + (colwidth * 2);
  605. pt.Y = ((tabPage2.Height * row) * (min + (x + 1)));
  606. e.Graphics.DrawString(lGeneral[x].ToString(), ft, sb, pt, System.Drawing.StringFormat.GenericDefault);
  607. pt.X = pad + (colwidth * 3);
  608. pt.Y = ((tabPage2.Height * row) * (min + (x + 1)));
  609. e.Graphics.DrawString(lStopCode[x].ToString(), ft, sb, pt, System.Drawing.StringFormat.GenericDefault);
  610. pt.X = pad + (colwidth * 4);
  611. pt.Y = ((tabPage2.Height * row) * (min + (x + 1)));
  612. e.Graphics.DrawString(lNoSolution[x].ToString(), ft, sb, pt, System.Drawing.StringFormat.GenericDefault);
  613. }
  614. curvePen.Dispose();
  615. dbPen.Dispose();
  616. whPen.Dispose();
  617. }
  618. /*************************************************************************************
  619. * module: frmAnonCust.cs - frmAnonCust_Closing
  620. *
  621. * author: Tim Ragain
  622. * date: Jan 22, 2002
  623. *
  624. * Purpose: If any threads are still alive meaning the user prematurely closes the form
  625. * before all threads are returned then the threads are checked to see if they are still
  626. * running and if so then the thread is aborted.
  627. *************************************************************************************/
  628. private void frmSolutionStatus_Closing(object sender, System.ComponentModel.CancelEventArgs e)
  629. {
  630. if(t_DayOne != null)
  631. {
  632. if(t_DayOne.IsAlive)
  633. {
  634. t_DayOne.Abort();
  635. }
  636. }
  637. if(t_DayTwo != null)
  638. {
  639. if(t_DayTwo.IsAlive)
  640. {
  641. t_DayTwo.Abort();
  642. }
  643. }
  644. if(t_DayThree != null)
  645. {
  646. if(t_DayThree.IsAlive)
  647. {
  648. t_DayThree.Abort();
  649. }
  650. }
  651. if(t_DayFour != null)
  652. {
  653. if(t_DayFour.IsAlive)
  654. {
  655. t_DayFour.Abort();
  656. }
  657. }
  658. if(t_DayFive != null)
  659. {
  660. if(t_DayFive.IsAlive)
  661. {
  662. t_DayFive.Abort();
  663. }
  664. }
  665. if(t_DaySix != null)
  666. {
  667. if(t_DaySix.IsAlive)
  668. {
  669. t_DaySix.Abort();
  670. }
  671. }
  672. if(t_DaySeven != null)
  673. {
  674. if(t_DaySeven.IsAlive)
  675. {
  676. t_DaySeven.Abort();
  677. }
  678. }
  679. }
  680. public bool HasProcessed
  681. {
  682. get
  683. {
  684. return bHasProcessed;
  685. }
  686. }
  687. public bool StillProcessing
  688. {
  689. get
  690. {
  691. return bIsStillProcessing;
  692. }
  693. }
  694. private void axMSChart1_ChartSelected(object sender, AxMSChart20Lib._DMSChartEvents_ChartSelectedEvent e)
  695. {
  696. }
  697. }
  698. }