Advertisement
Guest User

medication.cs

a guest
Jan 23rd, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.95 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.  
  14. public partial class Medication : Form
  15. {
  16. int nudAntibiotic7OldValue;
  17. int nudAntibiotic14OldValue;
  18. int nudFleeAndMiteOldValue;
  19. int nudHeartwormOldValue;
  20. int nudAnesGasto30mOldValue;
  21. int nudAnesgasafter30mOldValue;
  22. int nudFentanylOldValue;
  23. int nudFrontlineOldValue;
  24. int nudAnalgesiaOldValue;
  25. int nudBaytrillOldValue;
  26. int nudMetronidazoleOldValue;
  27. int nudRimadylOldValue;
  28. int nudDrontalSmalldogOldValue;
  29. int nudDrontalLargedogOldValue;
  30. int nudCanineRabiesOldValue;
  31.  
  32. public Medication()
  33. {
  34. InitializeComponent();
  35. }
  36.  
  37. public static string PriceMedication = "";
  38.  
  39.  
  40. private void btnExit_Click(object sender, EventArgs e) //Exit button
  41. {
  42. Application.Exit();
  43. }
  44.  
  45. private void btnPrevious_Click(object sender, EventArgs e) //Previous button
  46. {
  47. Form Start = new ClientData();
  48. this.Hide();
  49. Start.Show();
  50. }
  51.  
  52. private void btnNextForm3_Click(object sender, EventArgs e)
  53. {
  54. Form Start = new Procedures();
  55. this.Hide();
  56. Start.Show();
  57.  
  58. PriceMedication = priceTotal.Text;
  59. }
  60.  
  61. private decimal Calculate(int count, string nudName)
  62. {
  63. decimal price;
  64. decimal result = 0;
  65.  
  66. switch (nudName)
  67. {
  68. case "UpdownAntibiotic7":
  69. count -= nudAntibiotic7OldValue;
  70. price = 19.60m;
  71. result = price * count;
  72. break;
  73.  
  74. case "UpdownAntibiotic14":
  75. count -= nudAntibiotic14OldValue;
  76. price = 25.20m;
  77. result = price * count;
  78. break;
  79.  
  80. case "UpdownFleeAndMite":
  81. count -= nudAntibiotic14OldValue;
  82. price = 6.75m;
  83. result = price * count;
  84. break;
  85.  
  86. case "UpdownHeartworm":
  87. count -= nudHeartwormOldValue;
  88. price = 12.05m;
  89. result = price * count;
  90. break;
  91.  
  92. case "UpdownAnesGasTo30min":
  93. count -= nudAnesGasto30mOldValue;
  94. price = 15.97m;
  95. result = price * count;
  96. break;
  97.  
  98. case "UpdownAnesGasAfter30min":
  99. count -= nudAnesgasafter30mOldValue;
  100. price = 25.97m;
  101. result = price * count;
  102. break;
  103.  
  104. case "UpdownFentanyl":
  105. count -= nudFentanylOldValue;
  106. price = 3.20m;
  107. result = price * count;
  108. break;
  109.  
  110. case "UpdownFrontline":
  111. count -= nudAntibiotic14OldValue;
  112. price = 9.99m;
  113. result = price * count;
  114. break;
  115.  
  116. case "UpDownAnalgesia":
  117. count -= nudAnalgesiaOldValue;
  118. price = 14.12m;
  119. result = price * count;
  120. break;
  121.  
  122. case "UpDownBaytrill":
  123. count -= nudBaytrillOldValue;
  124. price = 5.00m;
  125. result = price * count;
  126. break;
  127.  
  128. case "UpDownMetronidazole":
  129. count -= nudMetronidazoleOldValue;
  130. price = 3.88m;
  131. result = price * count;
  132. break;
  133.  
  134. case "UpDownRimadyl":
  135. count -= nudRimadylOldValue;
  136. price = 7.60m;
  137. result = price * count;
  138. break;
  139.  
  140. case "UpDownDrontalSmall":
  141. count -= nudDrontalSmalldogOldValue;
  142. price = 5.00m;
  143. result = price * count;
  144. break;
  145.  
  146. case "UpDownDrontalLarge":
  147. count -= nudDrontalLargedogOldValue;
  148. price = 7.00m;
  149. result = price * count;
  150. break;
  151.  
  152. case "UpDownCanineRabies":
  153. count -= nudCanineRabiesOldValue;
  154. price = 345m;
  155. result = price * count;
  156. break;
  157.  
  158.  
  159. //...add other cases for different medicine
  160.  
  161. default:
  162. break;
  163. }
  164.  
  165. return result;
  166. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement