namespace hotel_project { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { const double price1=70.00; const double price2=140.00; const double price3=210.00; const double price4=280.00; const double price5=350.00; double price; int days; if (listBox1.GetSelected(0)) price = price1; else if (listBox1.GetSelected(1)) price = price2; else if (listBox1.GetSelected(2)) price = price3; else if (listBox1.GetSelected(3)) price = price4; else price = price5; if (radioButton1.Checked) days = 1; else if (radioButton2.Checked) days = 2; else if (radioButton3.Checked) days = 3; else if (radioButton4.Checked) days = 4; else if (radioButton5.Checked) days = 5; else if (radioButton6.Checked) days = 6; else days = 7; price = price * days ; label9.Text = "Total is" + price.ToString("C") } private void label1_Click(object sender, EventArgs e) { } private void textBox2_TextChanged(object sender, EventArgs e) { } private void textBox4_TextChanged(object sender, EventArgs e) { } private void radioButton2_CheckedChanged(object sender, EventArgs e) { } private void textBox5_TextChanged(object sender, EventArgs e) { } private void label6_Click(object sender, EventArgs e) { } private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { } private void listBox2_SelectedIndexChanged(object sender, EventArgs e) { } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)