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.

584 lines
18 KiB

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Data;
  7. using System.Reflection;
  8. using System.Threading;
  9. namespace OCAReports
  10. {
  11. /// <summary>
  12. /// Summary description for Form1.
  13. /// </summary>
  14. public class frmMain : System.Windows.Forms.Form
  15. {
  16. private System.Windows.Forms.MainMenu mainMenu1;
  17. private System.Windows.Forms.MenuItem mnuFile;
  18. private System.Windows.Forms.MenuItem mnuFileExit;
  19. private System.Windows.Forms.MenuItem menuItem1;
  20. private System.Windows.Forms.MenuItem mnuDataDaily;
  21. private System.Windows.Forms.MenuItem mnuDataWeekly;
  22. private System.Windows.Forms.MenuItem menuItem2;
  23. private System.Windows.Forms.MenuItem mnuAnonCustomer;
  24. private System.Windows.Forms.MenuItem mnuAutoMan;
  25. private System.Windows.Forms.MenuItem mnuSolutionStatus;
  26. private System.Windows.Forms.MenuItem mnuAbout;
  27. private System.Windows.Forms.ToolBar toolBar1;
  28. private System.Windows.Forms.ToolBarButton toolBarButton1;
  29. private System.Windows.Forms.ToolBarButton toolBarButton2;
  30. private System.Windows.Forms.ToolBarButton toolBarButton3;
  31. private System.Windows.Forms.ToolBarButton toolBarButton4;
  32. private System.Windows.Forms.ToolBarButton toolBarButton5;
  33. private System.Windows.Forms.ToolBarButton toolBarButton6;
  34. private System.Windows.Forms.ToolBarButton toolBarButton7;
  35. private System.Windows.Forms.ToolBarButton toolBarButton8;
  36. private System.Windows.Forms.ToolBarButton toolBarButton9;
  37. private System.Windows.Forms.ImageList imageList1;
  38. private System.Windows.Forms.MenuItem menuItem3;
  39. private System.Windows.Forms.MenuItem mnuOptions;
  40. private System.Windows.Forms.MenuItem mnuExport;
  41. private System.Windows.Forms.MenuItem menuItem5;
  42. private System.Windows.Forms.ToolBarButton toolBarButton10;
  43. private System.Windows.Forms.ToolBarButton cmdExport;
  44. private System.Windows.Forms.ToolBarButton toolBarButton11;
  45. private System.Windows.Forms.ToolBarButton toolBarButton12;
  46. private System.Windows.Forms.MenuItem mnuRefresh;
  47. private System.Windows.Forms.ToolBarButton toolBarButton15;
  48. private System.Windows.Forms.Timer timer1;
  49. private System.Windows.Forms.ToolBarButton toolBarButton16;
  50. private System.Windows.Forms.ToolBarButton toolBarButton17;
  51. private System.Windows.Forms.ToolBarButton toolBarButton18;
  52. private System.Windows.Forms.MenuItem menuItem4;
  53. private System.ComponentModel.IContainer components;
  54. public frmMain()
  55. {
  56. //
  57. // Required for Windows Form Designer support
  58. //
  59. InitializeComponent();
  60. //
  61. // TODO: Add any constructor code after InitializeComponent call
  62. //
  63. }
  64. /// <summary>
  65. /// Clean up any resources being used.
  66. /// </summary>
  67. protected override void Dispose( bool disposing )
  68. {
  69. if( disposing )
  70. {
  71. if (components != null)
  72. {
  73. components.Dispose();
  74. }
  75. }
  76. base.Dispose( disposing );
  77. }
  78. #region Windows Form Designer generated code
  79. /// <summary>
  80. /// Required method for Designer support - do not modify
  81. /// the contents of this method with the code editor.
  82. /// </summary>
  83. private void InitializeComponent()
  84. {
  85. this.components = new System.ComponentModel.Container();
  86. System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmMain));
  87. this.mainMenu1 = new System.Windows.Forms.MainMenu();
  88. this.mnuFile = new System.Windows.Forms.MenuItem();
  89. this.mnuRefresh = new System.Windows.Forms.MenuItem();
  90. this.mnuExport = new System.Windows.Forms.MenuItem();
  91. this.menuItem5 = new System.Windows.Forms.MenuItem();
  92. this.mnuFileExit = new System.Windows.Forms.MenuItem();
  93. this.menuItem1 = new System.Windows.Forms.MenuItem();
  94. this.mnuDataDaily = new System.Windows.Forms.MenuItem();
  95. this.mnuDataWeekly = new System.Windows.Forms.MenuItem();
  96. this.mnuAnonCustomer = new System.Windows.Forms.MenuItem();
  97. this.mnuAutoMan = new System.Windows.Forms.MenuItem();
  98. this.mnuSolutionStatus = new System.Windows.Forms.MenuItem();
  99. this.menuItem3 = new System.Windows.Forms.MenuItem();
  100. this.mnuOptions = new System.Windows.Forms.MenuItem();
  101. this.menuItem2 = new System.Windows.Forms.MenuItem();
  102. this.mnuAbout = new System.Windows.Forms.MenuItem();
  103. this.toolBar1 = new System.Windows.Forms.ToolBar();
  104. this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
  105. this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
  106. this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
  107. this.toolBarButton5 = new System.Windows.Forms.ToolBarButton();
  108. this.toolBarButton15 = new System.Windows.Forms.ToolBarButton();
  109. this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
  110. this.toolBarButton6 = new System.Windows.Forms.ToolBarButton();
  111. this.cmdExport = new System.Windows.Forms.ToolBarButton();
  112. this.toolBarButton10 = new System.Windows.Forms.ToolBarButton();
  113. this.toolBarButton7 = new System.Windows.Forms.ToolBarButton();
  114. this.toolBarButton11 = new System.Windows.Forms.ToolBarButton();
  115. this.toolBarButton12 = new System.Windows.Forms.ToolBarButton();
  116. this.toolBarButton17 = new System.Windows.Forms.ToolBarButton();
  117. this.toolBarButton16 = new System.Windows.Forms.ToolBarButton();
  118. this.toolBarButton18 = new System.Windows.Forms.ToolBarButton();
  119. this.toolBarButton8 = new System.Windows.Forms.ToolBarButton();
  120. this.toolBarButton9 = new System.Windows.Forms.ToolBarButton();
  121. this.imageList1 = new System.Windows.Forms.ImageList(this.components);
  122. this.timer1 = new System.Windows.Forms.Timer(this.components);
  123. this.menuItem4 = new System.Windows.Forms.MenuItem();
  124. this.SuspendLayout();
  125. //
  126. // mainMenu1
  127. //
  128. this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
  129. this.mnuFile,
  130. this.menuItem1,
  131. this.menuItem3,
  132. this.menuItem2});
  133. //
  134. // mnuFile
  135. //
  136. this.mnuFile.Index = 0;
  137. this.mnuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
  138. this.mnuRefresh,
  139. this.menuItem4,
  140. this.mnuExport,
  141. this.menuItem5,
  142. this.mnuFileExit});
  143. this.mnuFile.Text = "&File";
  144. //
  145. // mnuRefresh
  146. //
  147. this.mnuRefresh.Index = 0;
  148. this.mnuRefresh.Shortcut = System.Windows.Forms.Shortcut.F5;
  149. this.mnuRefresh.Text = "&Refresh";
  150. this.mnuRefresh.Click += new System.EventHandler(this.mnuRefresh_Click);
  151. //
  152. // mnuExport
  153. //
  154. this.mnuExport.Index = 2;
  155. this.mnuExport.Text = "&Export...";
  156. this.mnuExport.Click += new System.EventHandler(this.mnuExport_Click);
  157. //
  158. // menuItem5
  159. //
  160. this.menuItem5.Index = 3;
  161. this.menuItem5.Text = "-";
  162. //
  163. // mnuFileExit
  164. //
  165. this.mnuFileExit.Index = 4;
  166. this.mnuFileExit.Text = "E&xit";
  167. this.mnuFileExit.Click += new System.EventHandler(this.mnuFileExit_Click);
  168. //
  169. // menuItem1
  170. //
  171. this.menuItem1.Index = 1;
  172. this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
  173. this.mnuDataDaily,
  174. this.mnuDataWeekly,
  175. this.mnuAnonCustomer,
  176. this.mnuAutoMan,
  177. this.mnuSolutionStatus});
  178. this.menuItem1.Text = "&Data";
  179. //
  180. // mnuDataDaily
  181. //
  182. this.mnuDataDaily.Index = 0;
  183. this.mnuDataDaily.Text = "&Daily";
  184. this.mnuDataDaily.Click += new System.EventHandler(this.mnuDataDaily_Click);
  185. //
  186. // mnuDataWeekly
  187. //
  188. this.mnuDataWeekly.Index = 1;
  189. this.mnuDataWeekly.Text = "&Weekly";
  190. this.mnuDataWeekly.Click += new System.EventHandler(this.mnuDataWeekly_Click);
  191. //
  192. // mnuAnonCustomer
  193. //
  194. this.mnuAnonCustomer.Index = 2;
  195. this.mnuAnonCustomer.Text = "Anon/Customer";
  196. this.mnuAnonCustomer.Click += new System.EventHandler(this.mnuAnonCustomer_Click);
  197. //
  198. // mnuAutoMan
  199. //
  200. this.mnuAutoMan.Index = 3;
  201. this.mnuAutoMan.Text = "Auto/Manual";
  202. this.mnuAutoMan.Click += new System.EventHandler(this.mnuAutoMan_Click);
  203. //
  204. // mnuSolutionStatus
  205. //
  206. this.mnuSolutionStatus.Index = 4;
  207. this.mnuSolutionStatus.Text = "Solution Status";
  208. this.mnuSolutionStatus.Click += new System.EventHandler(this.mnuSolutionStatus_Click);
  209. //
  210. // menuItem3
  211. //
  212. this.menuItem3.Index = 2;
  213. this.menuItem3.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
  214. this.mnuOptions});
  215. this.menuItem3.Text = "&Tools";
  216. //
  217. // mnuOptions
  218. //
  219. this.mnuOptions.Index = 0;
  220. this.mnuOptions.Text = "Options...";
  221. this.mnuOptions.Click += new System.EventHandler(this.mnuOptions_Click);
  222. //
  223. // menuItem2
  224. //
  225. this.menuItem2.Index = 3;
  226. this.menuItem2.MdiList = true;
  227. this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
  228. this.mnuAbout});
  229. this.menuItem2.Text = "&Help";
  230. //
  231. // mnuAbout
  232. //
  233. this.mnuAbout.Index = 0;
  234. this.mnuAbout.Text = "&About";
  235. this.mnuAbout.Click += new System.EventHandler(this.mnuAbout_Click);
  236. //
  237. // toolBar1
  238. //
  239. this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
  240. this.toolBarButton1,
  241. this.toolBarButton2,
  242. this.toolBarButton4,
  243. this.toolBarButton5,
  244. this.toolBarButton15,
  245. this.toolBarButton3,
  246. this.toolBarButton6,
  247. this.cmdExport,
  248. this.toolBarButton10,
  249. this.toolBarButton7,
  250. this.toolBarButton11,
  251. this.toolBarButton12,
  252. this.toolBarButton17,
  253. this.toolBarButton16,
  254. this.toolBarButton18,
  255. this.toolBarButton8,
  256. this.toolBarButton9});
  257. this.toolBar1.DropDownArrows = true;
  258. this.toolBar1.ImageList = this.imageList1;
  259. this.toolBar1.Name = "toolBar1";
  260. this.toolBar1.ShowToolTips = true;
  261. this.toolBar1.Size = new System.Drawing.Size(1028, 25);
  262. this.toolBar1.TabIndex = 1;
  263. this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
  264. //
  265. // toolBarButton1
  266. //
  267. this.toolBarButton1.ImageIndex = 1;
  268. this.toolBarButton1.ToolTipText = "Anonymous vs Customer Report";
  269. //
  270. // toolBarButton2
  271. //
  272. this.toolBarButton2.ImageIndex = 7;
  273. this.toolBarButton2.ToolTipText = "Auto vs Manual Uploads Report";
  274. //
  275. // toolBarButton4
  276. //
  277. this.toolBarButton4.ImageIndex = 2;
  278. this.toolBarButton4.ToolTipText = "Solution Status Report";
  279. //
  280. // toolBarButton5
  281. //
  282. this.toolBarButton5.ImageIndex = 4;
  283. this.toolBarButton5.ToolTipText = "Weekly Report";
  284. //
  285. // toolBarButton15
  286. //
  287. this.toolBarButton15.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
  288. //
  289. // toolBarButton3
  290. //
  291. this.toolBarButton3.ImageIndex = 3;
  292. this.toolBarButton3.ToolTipText = "Daily Count Report";
  293. //
  294. // toolBarButton6
  295. //
  296. this.toolBarButton6.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
  297. //
  298. // cmdExport
  299. //
  300. this.cmdExport.ImageIndex = 8;
  301. this.cmdExport.ToolTipText = "Export Graphs To Excel Spreadsheet";
  302. //
  303. // toolBarButton10
  304. //
  305. this.toolBarButton10.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
  306. //
  307. // toolBarButton7
  308. //
  309. this.toolBarButton7.ImageIndex = 0;
  310. this.toolBarButton7.ToolTipText = "Set locations for Watson and Archive Servers";
  311. //
  312. // toolBarButton11
  313. //
  314. this.toolBarButton11.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
  315. //
  316. // toolBarButton12
  317. //
  318. this.toolBarButton12.ImageIndex = 9;
  319. this.toolBarButton12.ToolTipText = "Refresh Current Report";
  320. //
  321. // toolBarButton17
  322. //
  323. this.toolBarButton17.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
  324. //
  325. // toolBarButton16
  326. //
  327. this.toolBarButton16.ImageIndex = 12;
  328. this.toolBarButton16.ToolTipText = "One Touch Reporting";
  329. //
  330. // toolBarButton18
  331. //
  332. this.toolBarButton18.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
  333. //
  334. // toolBarButton8
  335. //
  336. this.toolBarButton8.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
  337. //
  338. // toolBarButton9
  339. //
  340. this.toolBarButton9.ImageIndex = 6;
  341. this.toolBarButton9.ToolTipText = "About";
  342. //
  343. // imageList1
  344. //
  345. this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
  346. this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
  347. this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
  348. this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
  349. //
  350. // timer1
  351. //
  352. this.timer1.Interval = 6000;
  353. //
  354. // menuItem4
  355. //
  356. this.menuItem4.Index = 1;
  357. this.menuItem4.Text = "-";
  358. //
  359. // frmMain
  360. //
  361. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  362. this.ClientSize = new System.Drawing.Size(1028, 470);
  363. this.Controls.AddRange(new System.Windows.Forms.Control[] {
  364. this.toolBar1});
  365. this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  366. this.IsMdiContainer = true;
  367. this.Menu = this.mainMenu1;
  368. this.Name = "frmMain";
  369. this.Text = "OCA Reports";
  370. this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
  371. this.Load += new System.EventHandler(this.frmMain_Load);
  372. this.ResumeLayout(false);
  373. }
  374. #endregion
  375. #region Public Variables
  376. #endregion
  377. /// <summary>
  378. /// The main entry point for the application.
  379. /// </summary>
  380. [STAThread]
  381. static void Main()
  382. {
  383. Application.Run(new frmMain());
  384. }
  385. private void mnuDataDaily_Click(object sender, System.EventArgs e)
  386. {
  387. frmDaily fDaily = new frmDaily();
  388. fDaily.MdiParent = this;
  389. fDaily.Show();
  390. }
  391. private void mnuDataWeekly_Click(object sender, System.EventArgs e)
  392. {
  393. frmWeekly fWeekly = new frmWeekly();
  394. fWeekly.MdiParent = this;
  395. fWeekly.Show();
  396. }
  397. private void frmMain_Load(object sender, System.EventArgs e)
  398. {
  399. this.Show();
  400. frmWeekly fWeekly = new frmWeekly();
  401. fWeekly.MdiParent = this;
  402. fWeekly.Show();
  403. }
  404. private void mnuAnonCustomer_Click(object sender, System.EventArgs e)
  405. {
  406. frmAnonCust fAnon = new frmAnonCust();
  407. fAnon.MdiParent = this;
  408. fAnon.Show();
  409. }
  410. private void mnuAutoMan_Click(object sender, System.EventArgs e)
  411. {
  412. frmAutoMan fAuto = new frmAutoMan();
  413. fAuto.MdiParent = this;
  414. fAuto.Show();
  415. }
  416. private void mnuSolutionStatus_Click(object sender, System.EventArgs e)
  417. {
  418. frmSolutionStatus fSol = new frmSolutionStatus();
  419. fSol.MdiParent = this;
  420. fSol.Show();
  421. }
  422. private void mnuAbout_Click(object sender, System.EventArgs e)
  423. {
  424. frmAbout fAbout = new frmAbout();
  425. fAbout.ShowDialog(this);
  426. }
  427. private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
  428. {
  429. switch(toolBar1.Buttons.IndexOf(e.Button))
  430. {
  431. case 0:
  432. frmAnonCust fAnon = new frmAnonCust();
  433. fAnon.MdiParent = this;
  434. fAnon.Show();
  435. break;
  436. case 1:
  437. frmAutoMan fAuto = new frmAutoMan();
  438. fAuto.MdiParent = this;
  439. fAuto.Show();
  440. break;
  441. case 5:
  442. frmDaily fDaily = new frmDaily();
  443. fDaily.MdiParent = this;
  444. fDaily.Show();
  445. break;
  446. case 2:
  447. frmSolutionStatus fSol = new frmSolutionStatus();
  448. fSol.MdiParent = this;
  449. fSol.Show();
  450. break;
  451. case 3:
  452. frmWeekly fWeekly = new frmWeekly();
  453. fWeekly.MdiParent = this;
  454. fWeekly.Show();
  455. break;
  456. case 7:
  457. frmExport fExp = new frmExport();
  458. fExp.ShowDialog(this);
  459. break;
  460. case 9:
  461. frmLocation fLoc = new frmLocation();
  462. fLoc.ShowDialog(this);
  463. break;
  464. case 16:
  465. frmAbout fAbout = new frmAbout();
  466. fAbout.ShowDialog(this);
  467. break;
  468. case 13:
  469. OneTouch();
  470. break;
  471. case 11:
  472. if(this.ActiveMdiChild.Name == "frmWeekly")
  473. {
  474. frmWeekly oWeekly = (frmWeekly) this.ActiveMdiChild;
  475. oWeekly.GetData();
  476. }
  477. else if(this.ActiveMdiChild.Name == "frmDaily")
  478. {
  479. frmDaily oDaily = (frmDaily) this.ActiveMdiChild;
  480. oDaily.GetData();
  481. }
  482. else if(this.ActiveMdiChild.Name == "frmAnonCust")
  483. {
  484. frmAnonCust oAnonCust = (frmAnonCust) this.ActiveMdiChild;
  485. oAnonCust.GetData();
  486. }
  487. else if(this.ActiveMdiChild.Name == "frmAutoMan")
  488. {
  489. frmAutoMan oAutoMan = (frmAutoMan) this.ActiveMdiChild;
  490. oAutoMan.GetData();
  491. }
  492. else if(this.ActiveMdiChild.Name == "frmSolutionStatus")
  493. {
  494. frmSolutionStatus oSolutionStatus = (frmSolutionStatus) this.ActiveMdiChild;
  495. oSolutionStatus.GetData();
  496. }
  497. break;
  498. }
  499. }
  500. private void mnuOptions_Click(object sender, System.EventArgs e)
  501. {
  502. frmLocation fLoc = new frmLocation();
  503. fLoc.ShowDialog(this);
  504. }
  505. private void mnuExport_Click(object sender, System.EventArgs e)
  506. {
  507. frmExport fExp = new frmExport();
  508. fExp.ShowDialog(this);
  509. }
  510. private void mnuFileExit_Click(object sender, System.EventArgs e)
  511. {
  512. this.Close();
  513. }
  514. private void mnuRefresh_Click(object sender, System.EventArgs e)
  515. {
  516. if(this.ActiveMdiChild.Name == "frmWeekly")
  517. {
  518. frmWeekly oWeekly = (frmWeekly) this.ActiveMdiChild;
  519. oWeekly.GetData();
  520. }
  521. else if(this.ActiveMdiChild.Name == "frmDaily")
  522. {
  523. frmDaily oDaily = (frmDaily) this.ActiveMdiChild;
  524. oDaily.GetData();
  525. }
  526. else if(this.ActiveMdiChild.Name == "frmAnonCust")
  527. {
  528. frmAnonCust oAnonCust = (frmAnonCust) this.ActiveMdiChild;
  529. oAnonCust.GetData();
  530. }
  531. else if(this.ActiveMdiChild.Name == "frmAutoMan")
  532. {
  533. frmAutoMan oAutoMan = (frmAutoMan) this.ActiveMdiChild;
  534. oAutoMan.GetData();
  535. }
  536. else if(this.ActiveMdiChild.Name == "frmSolutionStatus")
  537. {
  538. frmSolutionStatus oSolutionStatus = (frmSolutionStatus) this.ActiveMdiChild;
  539. oSolutionStatus.GetData();
  540. }
  541. }
  542. public void OneTouch()
  543. {
  544. foreach(Form oForm in this.MdiChildren)
  545. {
  546. oForm.Close();
  547. }
  548. frmAutoReport oAutoReports = new frmAutoReport();
  549. oAutoReports.ShowDialog(this);
  550. }
  551. }
  552. }