/*设计了一个Dinnerparty的类,来为Dinnerparty的花费做一个预算
题目要求:
1、食物每人25¥/人
2、饮料:
  喝酒方案:每人20¥
  不喝酒方案:每人5¥,并且总共的花费可以打九五折
3、装饰:
   特别装饰:每人7.5¥  总花费再加30¥
   普通装饰:每人15¥并且 总花费再加50¥用到  numbericupdown     textbox     checkbox 这些控件
  如下为我的程序:
类的设计:*/
using System;
using System.Collections.Generic;
using System.Text;namespace DinnerParty
{
    class DinnerParty
    {
      //  public float TotalCost;
        //private float FoodCostPerPerson;
        private float DrinkCostPerPerson;
        private float DecorationCostPerPerson;
        private int numberofpeople;
        private float foodcostperperson;
        public   float TotalCost;
        public float FoodCostPerPerson
        {
            set
            {
                foodcostperperson = 25.0f;
            }
            get
            {
                return foodcostperperson;
            }
        }
        public int Numberofpeople
        {
            get 
            {
                return numberofpeople;
            }
            set
            {
                numberofpeople=value;
            }
        }
        private bool isfancydecoration;
        public bool Isfancydecoration
        {
            set
            {
                isfancydecoration = value;
                if (isfancydecoration)
                {
                    DecorationCostPerPerson = 15.0f;
                }
                else
                {
                    DecorationCostPerPerson = 7.5f;
                }
            }
                
            get 
            { 
                return isfancydecoration; 
                
            }
        }
        private bool ishealthyoption;
        public bool Ishealthyoption
        {
            set
            {
                ishealthyoption = value;
                if (ishealthyoption)
                {
                    DrinkCostPerPerson = 5.0f;
                }
                else
                { DrinkCostPerPerson = 20.0f; }
            }
            get
            {
                return ishealthyoption;
            }
        }
       public DinnerParty()
        {
            this.TotalCost = (this.Numberofpeople * FoodCostPerPerson);
            if (Isfancydecoration == true)
            {
                this.TotalCost += (this.Numberofpeople * DecorationCostPerPerson) + 50;
            }
            else
            {
                this.TotalCost += (this.Numberofpeople * DecorationCostPerPerson) + 30;
            }
            if (Ishealthyoption == true)
            {
                this.TotalCost = (this.Numberofpeople * DrinkCostPerPerson + TotalCost) * 0.95f;
            }
            else
            {
                this.TotalCost += this.Numberofpeople * DrinkCostPerPerson;
            }        }
       
     }
}
       /*form1 的代码*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace DinnerParty
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            DinnerParty dinner=new DinnerParty();
            dinner.Numberofpeople = Convert.ToInt16(this.numericUpDown1.Value);
            dinner.Isfancydecoration = Convert.ToBoolean(checkBox1.Checked);
            dinner.Ishealthyoption = Convert.ToBoolean(checkBox2.Checked);
            this.textBox1.Text = dinner.TotalCost.ToString();
        }
            private void textBox1_TextChanged(object sender, EventArgs e)
        {
            DinnerParty dinner = new DinnerParty();
            textBox1.Text = Convert.ToString(dinner.TotalCost);
        }        private void checkBox1_Click(object sender, EventArgs e)
        {
            DinnerParty dinner = new DinnerParty();
            if(checkBox1.Checked)
            {
              dinner.Isfancydecoration = Convert.ToBoolean(checkBox1.Checked); 
            }
        }        private void checkBox2_Click(object sender, EventArgs e)
        {
            DinnerParty dinner = new DinnerParty();
            if (checkBox2.Checked)
            {
                dinner.Ishealthyoption = Convert.ToBoolean(checkBox2.Checked);
            }
        }
    }       
}
为什么最终运行以后不管点什么控件,最后的textbox里面的数都是恒定不变的??大家谁知道是为什么??、
都来找一下错误吧……不知道怎么改??