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.

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