Advertisement
Guest User

Untitled

a guest
Apr 20th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.26 KB | None | 0 0
  1. //
  2. //START UP PROCCESS
  3. //
  4.  
  5. private void JobViewer_Load(object sender, EventArgs e)
  6. {
  7.  
  8.  
  9. timer1.Start(); //CLOCK
  10. int BrowserVer, RegVal;
  11.  
  12. // get the installed IE version
  13. using (WebBrowser Wb = new WebBrowser())
  14. BrowserVer = Wb.Version.Major;
  15.  
  16. // set the appropriate IE version
  17. if (BrowserVer >= 11)
  18. RegVal = 11001;
  19. else if (BrowserVer == 10)
  20. RegVal = 10001;
  21. else if (BrowserVer == 9)
  22. RegVal = 9999;
  23. else if (BrowserVer == 8)
  24. RegVal = 8888;
  25. else
  26. RegVal = 7000;
  27.  
  28. // set the actual key
  29. RegistryKey Key = Registry.CurrentUser.OpenSubKey(@"SOFTWAREMicrosoftInternet ExplorerMainFeatureControlFEATURE_BROWSER_EMULATION", true);
  30. Key.SetValue(System.Diagnostics.Process.GetCurrentProcess().ProcessName + ".exe", RegVal, RegistryValueKind.DWord);
  31. Key.Close();
  32.  
  33. contextMenuStrip1.Renderer = new ToolStripProfessionalRenderer(new ColorTable());
  34.  
  35. }
  36. //
  37. //OPEN PERSON'S FILE LOCATION
  38. //
  39. private void FLoc1_Click(object sender, EventArgs e)
  40. {
  41.  
  42. DisplayJobs.Navigate(@"F:Internal JobsJobsChad");
  43.  
  44. }
  45. private void FLoc2_Click(object sender, EventArgs e)
  46. {
  47.  
  48. DisplayJobs.Navigate(@"F:Internal JobsJobsDan");
  49. }
  50. private void FLoc3_Click(object sender, EventArgs e)
  51. {
  52.  
  53. DisplayJobs.Navigate(@"F:Internal JobsJobsErv");
  54. }
  55. private void FLoc4_Click(object sender, EventArgs e)
  56. {
  57.  
  58. DisplayJobs.Navigate(@"F:Internal JobsJobsJacob");
  59. }
  60. private void FLoc5_Click(object sender, EventArgs e)
  61. {
  62.  
  63. DisplayJobs.Navigate(@"F:Internal JobsJobsNate");
  64. }
  65. private void FLoc6_Click(object sender, EventArgs e)
  66. {
  67.  
  68. DisplayJobs.Navigate(@"F:Internal JobsJobsMiller");
  69.  
  70. }
  71. private void FLoc7_Click(object sender, EventArgs e)
  72. {
  73.  
  74. DisplayJobs.Navigate(@"F:Internal JobsJobsTerry");
  75.  
  76. }
  77. private void FLoc8_Click(object sender, EventArgs e)
  78. {
  79.  
  80. DisplayJobs.Navigate(@"F:Internal JobsJobsKelley");
  81. }
  82. private void FLoc9_Click(object sender, EventArgs e)
  83. {
  84.  
  85. DisplayJobs.Navigate(@"F:Internal JobsJobsJenny");
  86. }
  87. private void DisplayJobs_DocumentCompleted(object sender,
  88. WebBrowserDocumentCompletedEventArgs e)
  89. {
  90. JobPath.Text = DisplayJobs.Url.ToString();
  91.  
  92.  
  93. }
  94. private void JobPath_TextChanged(object sender, EventArgs e)
  95. {
  96.  
  97. textBox1.Text = JobPath.Text.Remove(0, 8);
  98.  
  99.  
  100. FilesMade();
  101.  
  102.  
  103.  
  104. try
  105. {
  106. lblContact.Text = File.ReadAllText((@textBox1.Text +
  107. @"PropertiesContact.txt"));
  108. lblJobName.Text = File.ReadAllText(@textBox1.Text +
  109. @"PropertiesJobName.txt");
  110. lblBidDate.Text = File.ReadAllText(@textBox1.Text +
  111. @"PropertiesBidDate.txt");
  112. lblEngineer.Text = File.ReadAllText(@textBox1.Text +
  113. @"PropertiesEngineer.txt");
  114. lblTakeOff.Text = File.ReadAllText(@textBox1.Text +
  115. @"PropertiesTakeOff.txt");
  116. lblReceived.Text = File.ReadAllText(@textBox1.Text +
  117. @"PropertiesReceived.txt");
  118. lblVendor.Text = File.ReadAllText(@textBox1.Text +
  119. @"PropertiesVendor.txt");
  120. //Specific Person Notes
  121. lblJDNotes.Text = File.ReadAllText(@textBox1.Text +
  122. @"PropertiesNotesJDNotes.txt");
  123. lblNotes.Text = File.ReadAllText(@textBox1.Text + @"PropertiesNotesGNotes.txt");
  124. ChadNotes.Text = File.ReadAllText(@textBox1.Text + @"PropertiesNotesCNotes.txt");
  125. DanNotes.Text = File.ReadAllText(@textBox1.Text + @"PropertiesNotesDNotes.txt");
  126. ErvNotes.Text = File.ReadAllText(@textBox1.Text + @"PropertiesNotesENotes.txt");
  127. NateNotes.Text = File.ReadAllText(@textBox1.Text + @"PropertiesNotesNNotes.txt");
  128. TerryMNotes.Text = File.ReadAllText(@textBox1.Text + @"PropertiesNotesTMNotes.txt");
  129. TerrySNotes.Text = File.ReadAllText(@textBox1.Text + @"PropertiesNotesTSNotes.txt");
  130. KelleyNotes.Text = File.ReadAllText(@textBox1.Text + @"PropertiesNotesKNotes.txt");
  131. JenNotes.Text = File.ReadAllText(@textBox1.Text + @"PropertiesNotesJenNotes.txt");
  132. lblPriorApp.Text = File.ReadAllText(@textBox1.Text + @"PropertiesPriorApp.txt");
  133.  
  134. lblProject.Text = File.ReadAllText(@textBox1.Text + @"PropertiesProject.txt");
  135. lblLocation.Text = File.ReadAllText(@textBox1.Text + @"PropertiesLocation.txt");
  136. }
  137. catch
  138. { }
  139.  
  140. //Converts The Bid Date To Long Date
  141. try
  142. {
  143.  
  144.  
  145. DateTime convertedtime = DateTime.Parse(lblBidDate.Text);
  146. JobName.Text = lblJobName.Text;
  147.  
  148.  
  149. JobLocation.Text = lblLocation.Text;
  150.  
  151. JobBidDate.Text = convertedtime.ToLongDateString();
  152. }
  153. catch { }
  154.  
  155. if (Directory.Exists(@textBox1.Text + @"Archive"))
  156. {
  157. JobName.Text = "";
  158. JobLocation.Text = "";
  159. JobBidDate.Text = "";
  160. }
  161. }
  162. private void JLCont_char(object sender, EventArgs e)
  163. {
  164.  
  165. }
  166. private void textBox1_TextChanged(object sender, EventArgs e)
  167. {
  168. // if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + "
  169. - " + lblJobName.Text))
  170. // btnEdit.Enabled = false;
  171. if (Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - "
  172. + lblJobName.Text))
  173. NewJob.Enabled = true;
  174. if (Directory.Exists(@textBox1.Text + "\6-Emails"))
  175. NewJob.Enabled = true;
  176. if (Directory.Exists(@textBox1.Text + "\6-Emails"))
  177. btnEdit.Enabled = true;
  178.  
  179. }
  180.  
  181. //
  182. //CREATE A NEW JOB
  183. //
  184. private wbNewJob wbNwJob = new wbNewJob();
  185. private void NewJob_Click(object sender, EventArgs e)
  186. {
  187. try
  188. {
  189. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text +
  190. " - " + lblJobName.Text))
  191. Directory.CreateDirectory(@textBox1.Text + "\" +
  192. lblBidDate.Text + " - " + lblJobName.Text);
  193.  
  194.  
  195.  
  196. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\0-Submittals"))
  197. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\0-Submittals");
  198. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\0-Submittals" + "\Properties"))
  199. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\0-Submittals" + "\Properties");
  200. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\0-Submittals" + "\Properties\Notes"))
  201. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\0-Submittals" + "\Properties\Notes");
  202.  
  203. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\1-Pricing"))
  204. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\1-Pricing");
  205. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\1-Pricing" + "\Properties"))
  206. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\1-Pricing" + "\Properties");
  207. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\1-Pricing" + "\Properties\Notes"))
  208. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\1-Pricing" + "\Properties\Notes");
  209.  
  210. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\2-Take Off"))
  211. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\2-Take Off");
  212. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\2-Take Off" + "\Properties"))
  213. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\2-Take Off" + "\Properties");
  214. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\2-Take Off" + "\Properties\Notes"))
  215. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\2-Take Off" + "\Properties\Notes");
  216.  
  217. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\3-Files"))
  218. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\3-Files");
  219. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\3-Files" + "\Properties"))
  220. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\3-Files" + "\Properties");
  221. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\3-Files" + "\Properties\Notes"))
  222. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\3-Files" + "\Properties\Notes");
  223.  
  224. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\4-Plans"))
  225. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\4-Plans");
  226. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\4-Plans" + "\Properties"))
  227. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\4-Plans" + "\Properties");
  228. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\4-Plans" + "\Properties\Notes"))
  229. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\4-Plans" + "\Properties\Notes");
  230.  
  231. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\5-Specs"))
  232. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\5-Specs");
  233. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\5-Specs" + "\Properties"))
  234. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\5-Specs" + "\Properties");
  235. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\5-Specs" + "\Properties\Notes"))
  236. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\5-Specs" + "\Properties\Notes");
  237.  
  238. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\6-Emails"))
  239. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\6-Emails");
  240. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\6-Emails" + "\Properties"))
  241. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\6-Emails" + "\Properties");
  242. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\6-Emails" + "\Properties\Notes"))
  243. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"\6-Emails" + "\Properties\Notes");
  244.  
  245. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\Properties"))
  246. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + "\Properties");
  247. if (!Directory.Exists(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"PropertiesNotes"))
  248. Directory.CreateDirectory(@textBox1.Text + "\" + lblBidDate.Text + " - " + lblJobName.Text + @"PropertiesNotes");
  249. }
  250. catch
  251. { }
  252. try
  253. {
  254. PriceAllInOnePricingCreate();
  255. ExcelTakeOffCreate();
  256. CapsPricingCreate();
  257. WriteToPropertiesNJ();
  258. WriteToEmailsNJ();
  259. WriteToFilesNJ();
  260. WriteToPlansNJ();
  261. WriteToPricingNJ();
  262. WriteToTakeOffNJ();
  263. WriteToSubmittals();
  264. WriteToSpecsNJ();
  265. }
  266. catch { }
  267.  
  268.  
  269.  
  270.  
  271.  
  272. try
  273. {
  274. wbNwJob.Show();
  275.  
  276. wbNwJob.lblContact.Text = lblContact.Text;
  277. wbNwJob.lblJobName.Text = lblJobName.Text;
  278. wbNwJob.lblLocation.Text = lblLocation.Text;
  279. wbNwJob.lblBidDate.Text = lblBidDate.Text;
  280. wbNwJob.lblEngineer.Text = lblEngineer.Text;
  281. wbNwJob.lblPriorApp.Text = lblPriorApp.Text;
  282. wbNwJob.lblTakeOff.Text = lblTakeOff.Text;
  283. wbNwJob.lblProject.Text = lblProject.Text;
  284. }
  285. catch { }
  286.  
  287.  
  288. }
  289. //
  290. //EDIT AN EXISTING JOB
  291. //
  292. private void btnEdit_Click_1(object sender, EventArgs e)
  293. {
  294.  
  295.  
  296.  
  297. try
  298. {
  299. WriteToPropertiesED();
  300. WriteToEmailsED();
  301. WriteToFilesED();
  302. WriteToPlansED();
  303. WriteToPricingED();
  304. WriteToTakeOffED();
  305. WriteToSubmittalsED();
  306. WriteToSpecsED();
  307.  
  308. }
  309. finally { MessageBox.Show("The Job Has Been Saved"); }
  310.  
  311. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement