Advertisement
Guest User

Procedures.cs

a guest
Jan 23rd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.37 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace Task3
  12. {
  13. public partial class Procedures : Form
  14. {
  15.  
  16. int nudEarsCleanAndFlushOldValue;
  17. int nudLuxationOldValue;
  18. int nudSlingOldValue;
  19. int nudWoundSoreOldValue;
  20. int nudLacerationsOldValue;
  21. int nudBloodPressureOldValue;
  22. int nudECGOldValue;
  23. int nudTeethExtractionOldValue;
  24. int nudCatheterOldValue;
  25. int nudBiopsyOldValue;
  26. int nudRadiographOldValue;
  27. int nudPotassiumOldValue;
  28. int nudIVOldValue;
  29.  
  30. public static string ProceduresTotal = "";
  31.  
  32. public Procedures()
  33. {
  34. InitializeComponent();
  35. }
  36.  
  37. private void btnPrevious_Click(object sender, EventArgs e) //Previous button
  38. {
  39. Form Start = new Medication();
  40. this.Hide();
  41. Start.Show();
  42. }
  43.  
  44. private void btnExit_Click(object sender, EventArgs e)
  45. {
  46. Application.Exit();
  47. }
  48.  
  49. private void btnNextForm4_Click(object sender, EventArgs e)
  50. {
  51. Form finish = new Receipt();
  52. this.Hide();
  53. finish.Show();
  54.  
  55. ProceduresTotal = price.Text;
  56. }
  57.  
  58. private decimal Calculate(int count, string nudName)
  59. {
  60. decimal price;
  61. decimal result = 0;
  62.  
  63. switch (nudName)
  64. {
  65. case "UpdownEarsCleanAndFlush":
  66. count -= nudEarsCleanAndFlushOldValue;
  67. price = 8.00m;
  68. result = price * count;
  69. break;
  70.  
  71. case "UpdownLuxation":
  72. count -= nudLuxationOldValue;
  73. price = 48.67m;
  74. result = price * count;
  75. break;
  76.  
  77. case "UpdownSling":
  78. count -= nudSlingOldValue;
  79. price = 1.20m;
  80. result = price * count;
  81. break;
  82.  
  83. case "UpdownWoundsore":
  84. count -= nudWoundSoreOldValue;
  85. price = 2.99m;
  86. result = price * count;
  87. break;
  88.  
  89. case "UpdownLacerations":
  90. count -= nudLacerationsOldValue;
  91. price = 98.00m;
  92. result = price * count;
  93. break;
  94.  
  95. case "UpDownBloodPressure":
  96. count -= nudBloodPressureOldValue;
  97. price = 0.95m;
  98. result = price * count;
  99. break;
  100.  
  101. case "UpDownECG":
  102. count -= nudECGOldValue;
  103. price = 133.45m;
  104. result = price * count;
  105. break;
  106.  
  107. case "UpDownTeethExtraction":
  108. count -= nudTeethExtractionOldValue;
  109. price = 96.55m;
  110. result = price * count;
  111. break;
  112.  
  113. case "UpDownCatheter":
  114. count -= nudCatheterOldValue;
  115. price = 35.00m;
  116. result = price * count;
  117. break;
  118.  
  119. case "UpDownBiopsy":
  120. count -= nudBiopsyOldValue;
  121. price = 389.00m;
  122. result = price * count;
  123. break;
  124.  
  125. case "UpDownRadiograph":
  126. count -= nudRadiographOldValue;
  127. price = 10.29m;
  128. result = price * count;
  129. break;
  130.  
  131. case "UpDownPotassium":
  132. count -= nudPotassiumOldValue;
  133. price = 0.45m;
  134. result = price * count;
  135. break;
  136.  
  137. case "UpDownIV":
  138. count -= nudIVOldValue;
  139. price = 3.90m;
  140. result = price * count;
  141. break;
  142.  
  143. //...add other cases for different medicine
  144.  
  145. default:
  146. break;
  147. }
  148.  
  149. return result;
  150. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement