Ejemplo n.º 1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            string evaluacion, objetivo;
            int    maxScore, idTipo;

            if (string.IsNullOrEmpty(txtEvaluacion.Text))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(txtObjetivo.Text))
            {
                emptyFields = true;
            }
            else if (txtMaxScore.Value == 0)
            {
                emptyFields = true;
            }
            else
            {
                emptyFields = false;
            }

            if (emptyFields)
            {
                MessageBox.Show("Debe llenar todos los campos, el puntaje maximo no puede ser cero");
            }
            else
            {
                evaluacion = txtEvaluacion.Text;
                objetivo   = txtObjetivo.Text;
                maxScore   = int.Parse(txtMaxScore.Value.ToString());
                idTipo     = int.Parse(cmbTipoEval.SelectedValue.ToString());

                evaluaciones.insertEvaluacion(evaluacion, idTipo, objetivo, maxScore);

                Control pnlContent = ParentForm.Controls.Find("pnlContent", true)[0];
                ControlUtils.abrirFormEnPanel(pnlContent, new Evaluaciones());
                Close();
            }
        }