示例#1
0
        private void btnCreatePrize_Click(object sender, EventArgs e)
        {
            if (ValidateForm())
            {
                PrizeModel model = new PrizeModel(
                    txtPlaceName.Text,
                    txtPlaceNumber.Text,
                    txtPrizeAmount.Text,
                    txtPrizePercentage.Text);

                IDataConnection tournamentRepo = SqlFactory.CreateTournamentRepo();
                tournamentRepo.CreatePrize(model);


                //GlobalConfig.Connection.CreatePrize(model);
                callingForm.PrizeComplete(model);
                Close();

                //txtPlaceName.Text = "";
                //txtPlaceNumber.Text = "";
                //txtPrizeAmount.Text = "0";
                //txtPrizePercentage.Text = "0";

                //TODO - comment this out
                MessageBox.Show("everything is awesome");
            }
            else
            {
                //TODO - comment this out
                MessageBox.Show("invalid information");
            }
        }