예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            decimal DailyCost, OtherCharges, TotalCharges;

            if (txtPreapproved.Text == "yes")
            {
                DailyCost = 200;
            }
            else
            {
                DailyCost = 500;
            }

            decimal NumberOfHospitalDays = Convert.ToDecimal(txtNumberofdays.Text);
            decimal MedicationChargers   = Convert.ToDecimal(txtMedication.Text);
            decimal SurgicalCharges      = Convert.ToDecimal(txtSurgical.Text);
            decimal LabFees      = Convert.ToDecimal(txtLab.Text);
            decimal RehabCharges = Convert.ToDecimal(txtRehab.Text);


            OtherCharges = MedicationChargers + SurgicalCharges + LabFees + RehabCharges;
            TotalCharges = OtherCharges + (NumberOfHospitalDays * DailyCost);

            txtTotal.Text = TotalCharges.ToString("c");
        }
예제 #2
0
        public string ShowInfo()
        {
            StringBuilder textResult = new StringBuilder();

            textResult.AppendLine($"*** Case Id: {IdCase} ***");
            textResult.AppendLine($"Start Date: {StartDate.ToShortDateString()}");
            textResult.AppendLine($"Total charges: {TotalCharges.ToString("C")}");
            textResult.AppendLine($"Lawyer's ID: {LawyerId}");
            textResult.AppendLine($"Client's ID: {ClientId}");
            textResult.AppendLine("*** ******** ***");

            return(textResult.ToString());
        }