예제 #1
0
        private void Btnbuycow_Click(object sender, EventArgs e)
        {
            Cow    k    = new Cow();
            string mess = b.Newanimal(k);

            lbltest2.Text = mess;
        }
예제 #2
0
        private void Btnbuycow_Click(object sender, EventArgs e)
        {
            Cow c = new Cow();

            if (b.Full == false && w.Money >= c.Prize)
            {
                string mess = b.Newanimal(c);
                lblbuycow.Text = mess;
                w.Money       -= c.Prize;
                Checkmoney();
                lblspace.Text = b.Bcheckanimal();
            }
            else if (b.Full == true)
            {
                lblbuycow.Text = "Sorry the barn is full";
            }
            else
            {
                Nomoney();
            }
        }