Exemplo n.º 1
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            var model   = new ProgramModel();
            var message = IsValid();

            if (!message.IsNull())
            {
                _service.showErrorMessage(message);
                return;
            }

            model.Name         = txtName.Text;
            model.Time         = int.Parse(txtTime.Text);
            model.Potency      = int.Parse(txtPotency.Text);
            model.HeatChar     = txtHeatChar.Text;
            model.Instructions = txtInstructions.Text;
            _service.CreateProgram(model);

            this.Close();
        }