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 WindowsFormsApp1
- {
- public partial class frmDentistCost : Form
- {
- public frmDentistCost()
- {
- InitializeComponent();
- }
- private void GbxService_Enter(object sender, EventArgs e)
- {
- }
- private void BtnClear_Click(object sender, EventArgs e)
- {
- RadAdult.Checked = false;
- RadChild.Checked = false;
- ChkCheckUp.Checked = false;
- ChkFilling.Checked = false;
- ChkRootCanal.Checked = false;
- ChkHygienisttreatment.Checked = false;
- LblOutput.Text = "";
- }
- private void BtnExit_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void BtnCalc_Click(object sender, EventArgs e)
- {
- decimal decTotal=0m;
- decimal decTotalPrompt;
- bool bolServiceChecked = false;
- bool bolAgeChecked = false;
- if (ChkCheckUp.Checked == true)
- {
- decTotal += 100m;
- bolServiceChecked = true;
- }
- if (ChkFilling.Checked == true)
- {
- decTotal += 126.30m;
- bolServiceChecked = true;
- }
- if (ChkHygienisttreatment.Checked == true)
- {
- decTotal += 119.50m;
- bolServiceChecked = true;
- }
- if (ChkRootCanal.Checked == true)
- {
- decTotal += 465.90m;
- bolServiceChecked = true;
- }
- if (RadChild.Checked == true)
- {
- //setting all payments to $0 except Root canal
- if (ChkRootCanal.Checked == true)
- {
- decTotal = 465.90m;
- decTotalPrompt = (decTotal * 0.9m);
- LblOutput.Text = "Total fee: " + decTotal.ToString("c") + "\n" + decTotalPrompt.ToString("c") + "\n" + DateTime.Now.AddDays(+5).ToString();
- bolAgeChecked = true;
- }
- else
- decTotal = 0m;
- decTotalPrompt = (decTotal * 0.9m);
- LblOutput.Text = "Total fee: " + decTotal.ToString("c") + "\n" + decTotalPrompt.ToString("c") + "\n" + DateTime.Now.AddDays(+5).ToString();
- bolAgeChecked = true;
- }
- if (RadAdult.Checked == true)
- {
- decTotalPrompt = (decTotal * 0.9m);
- LblOutput.Text = "Total fee: " + decTotal.ToString("c") + "\n" + "Prompt payment Total: " + decTotalPrompt.ToString("c") + "\n" + "You are eligable for a 10% discount if payed before: " + DateTime.Now.AddDays(+5).ToString();
- bolAgeChecked = true;
- }
- if (bolAgeChecked == false)
- {
- MessageBox.Show("Please select an age");
- }
- if (bolServiceChecked == false)
- {
- MessageBox.Show("Please select a service");
- {
- }
- }
- }
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement