Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Task3
- {
- public partial class Medication : Form
- {
- int nudAntibiotic7OldValue;
- int nudAntibiotic14OldValue;
- int nudFleeAndMiteOldValue;
- int nudHeartwormOldValue;
- int nudAnesGasto30mOldValue;
- int nudAnesgasafter30mOldValue;
- int nudFentanylOldValue;
- int nudFrontlineOldValue;
- int nudAnalgesiaOldValue;
- int nudBaytrillOldValue;
- int nudMetronidazoleOldValue;
- int nudRimadylOldValue;
- int nudDrontalSmalldogOldValue;
- int nudDrontalLargedogOldValue;
- int nudCanineRabiesOldValue;
- public Medication()
- {
- InitializeComponent();
- }
- public static string PriceMedication = "";
- private void btnExit_Click(object sender, EventArgs e) //Exit button
- {
- Application.Exit();
- }
- private void btnPrevious_Click(object sender, EventArgs e) //Previous button
- {
- Form Start = new ClientData();
- this.Hide();
- Start.Show();
- }
- private void btnNextForm3_Click(object sender, EventArgs e)
- {
- Form Start = new Procedures();
- this.Hide();
- Start.Show();
- PriceMedication = priceTotal.Text;
- }
- private decimal Calculate(int count, string nudName)
- {
- decimal price;
- decimal result = 0;
- switch (nudName)
- {
- case "UpdownAntibiotic7":
- count -= nudAntibiotic7OldValue;
- price = 19.60m;
- result = price * count;
- break;
- case "UpdownAntibiotic14":
- count -= nudAntibiotic14OldValue;
- price = 25.20m;
- result = price * count;
- break;
- case "UpdownFleeAndMite":
- count -= nudAntibiotic14OldValue;
- price = 6.75m;
- result = price * count;
- break;
- case "UpdownHeartworm":
- count -= nudHeartwormOldValue;
- price = 12.05m;
- result = price * count;
- break;
- case "UpdownAnesGasTo30min":
- count -= nudAnesGasto30mOldValue;
- price = 15.97m;
- result = price * count;
- break;
- case "UpdownAnesGasAfter30min":
- count -= nudAnesgasafter30mOldValue;
- price = 25.97m;
- result = price * count;
- break;
- case "UpdownFentanyl":
- count -= nudFentanylOldValue;
- price = 3.20m;
- result = price * count;
- break;
- case "UpdownFrontline":
- count -= nudAntibiotic14OldValue;
- price = 9.99m;
- result = price * count;
- break;
- case "UpDownAnalgesia":
- count -= nudAnalgesiaOldValue;
- price = 14.12m;
- result = price * count;
- break;
- case "UpDownBaytrill":
- count -= nudBaytrillOldValue;
- price = 5.00m;
- result = price * count;
- break;
- case "UpDownMetronidazole":
- count -= nudMetronidazoleOldValue;
- price = 3.88m;
- result = price * count;
- break;
- case "UpDownRimadyl":
- count -= nudRimadylOldValue;
- price = 7.60m;
- result = price * count;
- break;
- case "UpDownDrontalSmall":
- count -= nudDrontalSmalldogOldValue;
- price = 5.00m;
- result = price * count;
- break;
- case "UpDownDrontalLarge":
- count -= nudDrontalLargedogOldValue;
- price = 7.00m;
- result = price * count;
- break;
- case "UpDownCanineRabies":
- count -= nudCanineRabiesOldValue;
- price = 345m;
- result = price * count;
- break;
- //...add other cases for different medicine
- default:
- break;
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement