コード例 #1
0
        private void BtnIngresar_Click(object sender, EventArgs e)
        {
            if (this.texId.Text != string.Empty && this.textGolEqui1.Text != string.Empty && this.textGolEqui2.Text != string.Empty && this.cbxPartidos.SelectedItem.ToString() != string.Empty)
            {
                int    idResult  = int.Parse(this.texId.Text);
                int    idPartido = int.Parse(this.cbxPartidos.SelectedItem.ToString());
                int    golesEq1  = int.Parse(this.textGolEqui1.Text);
                int    golesEq2  = int.Parse(this.textGolEqui2.Text);
                string clima     = this.textClima.Text;
                string desc      = this.richTextBoxDescripcion.Text;

                VOResultado res = new VOResultado();
                res.Id           = idResult;
                res.GolesEquipo1 = golesEq1;
                res.GolesEquipo2 = golesEq2;
                res.Clima        = clima;
                res.Descripcion  = desc;

                bool agregado = fac.AgregarResultadoAPartido(res, idPartido);

                if (agregado)
                {
                    MessageBox.Show("Se ha ingresado el resultado", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Error al ingresar resultado", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
コード例 #2
0
 //Ingresar resultado a partido
 public bool AgregarResultadoAPartido(VOResultado res, int idPartido)
 {
     return(DAOResultados.InsertarResultadoDePartido(idPartido, res.Id, res.GolesEquipo1, res.GolesEquipo2, res.Clima, res.Descripcion));
 }