private void createPrizeButton_Click(object sender, EventArgs e)
        {
            if (ValidateForm())
            {
                PrizeModel model = new PrizeModel(
                    placeNameValue.Text,
                    placeNumberValue.Text,
                    prizeAmountValue.Text,
                    prizePercentageValue.Text
                    );


                GlobalConfig.Connection.CreatePrize(model);

                callingForm.PrizeComplete(model);

                this.Close();

                //placeNameValue.Text = "";
                //placeNumberValue.Text = "";
                //prizeAmountValue.Text = "0";
                //prizePercentageValue.Text = "0";
            }
            else
            {
                MessageBox.Show("This form has invalid information. Please try again");
            }
        }
        private void createPrizeButton_Click(object sender, EventArgs e)
        {
            if (ValidateForm())
            {
                PrizeModel model = new PrizeModel(
                    placeNameValue.Text,
                    placeNumberValue.Text,
                    prizeAmountValue.Text,
                    prizePercentageValue.Text);

                GlobalConfig.Connection.CreatePrize(model);

                callingForm.PrizeComplete(model);

                this.Close();

                //clear out the form after saving data
                //placeNameValue.Text = "";
                //placeNumberValue.Text = "";
                //prizeAmountValue.Text = "0";
                //prizePercentageValue.Text = "0";
            }
            else
            {
                MessageBox.Show("Please, check the form!");
            }
        }
Esempio n. 3
0
        private void createPrizeButton_Click(object sender, EventArgs e)
        {
            if (ValidateForm())
            {
                Prize model = new Prize(
                    placeNumberValue.Text,
                    placeNameValue.Text,
                    prizeAmountValue.Text,
                    prizePercentageValue.Text);


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

                //placeNumberValue.Text = "";
                //placeNameValue.Text = "";
                //prizeAmountValue.Text = "0";
                //prizePercentageValue.Text = "0";
                Close();
            }
            else
            {
                MessageBox.Show("The form is invalid.", "Error");
            }
        }
        /// <summary>
        /// If all inputs are valid, create the specified prize model and
        /// send it to the calling form.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CreatePrizeButton_Click(object sender, EventArgs e)
        {
            if (ValidInputs())
            {
                // create prize model
                PrizeModel model = new PrizeModel(
                    placeNumberValue.Text,
                    placeNameValue.Text,
                    prizeAmountValue.Text,
                    prizePercentageValue.Text);

                // return model to caller and close this prize form
                callingForm.PrizeComplete(model);
                this.Close();
            }
            else
            {
                MessageBox.Show("This form has invalid information. Please check it and try again.");
            }
        }
Esempio n. 5
0
        private void createPrizeButton_Click(object sender, EventArgs e)
        {
            if (validateForm())
            {
                PrizeModel model = new PrizeModel(placeNumberValue.Text,
                                                  placeNameValue.Text,
                                                  prizeAmountValue.Text,
                                                  prizePercentageValue.Text);


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

                this.Close();
                //placeNameValue.Text = "";
                //placeNumberValue.Text = "";
                //prizeAmountValue.Text = "";
                //prizePercentageValue.Text = "";
            }
        }
        private void createPrizeButton_Click(object sender, EventArgs e)
        {
            if (ValidateForm())
            {
                PrizeModel model = new PrizeModel(
                    placeNumberValue.Text,
                    placeNameValue.Text,
                    placeAmountValue.Text,
                    prizePercentValue.Text);

                model = GlobalConfig.Connection.CreatePrize(model);

                //this model is being passed back through the constructor for use by any class that calls it
                callingForm.PrizeComplete(model);
                //closes form
                this.Close();
            }
            else
            {
                MessageBox.Show("This message has invalid information");
            }
        }
Esempio n. 7
0
        private void BtnCreatePrize_Click(object sender, EventArgs e)
        {
            if (ValidateForm())
            {
                PrizeModel model = new PrizeModel(
                    tbPlaceName.Text,
                    tbPlaceNumber.Text,
                    tbPrizeAmount.Text,
                    tbPrizePercentage.Text);

                GlobalConfig.Connection.CreatePrize(model);
                callingForm.PrizeComplete(model);
                this.Close();
                //tbPlaceName.Text = "";
                //tbPlaceNumber.Text = "";
                //tbPrizeAmount.Text = "0";
                //tbPrizePercentage.Text = "0";
            }

            else
            {
                MessageBox.Show("This box has invalid information, please check it and try again");
            }
        }