Exemplo n.º 1
0
 private void pbxCreate_Click(object sender, EventArgs e)
 {
     name = txtFarmName.Text;
     if (size == 0)
     {
         MessageBox.Show("Please Select a Farm Size");
     }
     else if (txtFarmName.ForeColor.Name == "GrayText" || txtFarmName.ForeColor.Name == "Gray" || name == "")
     {
         MessageBox.Show("Please enter a Farm Name");
     }
     else
     {
         Farm f = new Farm(name, size);
         // f.insertFarm();
         MessageObject FarmToInsert = new MessageObject();
         FarmToInsert.Data             = f.BinarySerialization();
         FarmToInsert.FormIdentifier   = 3;
         FarmToInsert.ObjectIdentifier = 2;
         FarmToInsert.ActionIdentifier = 2;
         Client.SendData(FarmToInsert);
         Animal_Selection form = new Animal_Selection(farmer.ID, (int)size);
         this.Hide();
         form.ShowDialog();
         this.Close();
     }
 }