Example #1
0
        // Confirmar la operaciĆ³n en curso
        private void AceptarOperacion()
        {
            SistemaARA.Negocio.Pagos  oPagosNegocio = new SistemaARA.Negocio.Pagos();
            SistemaARA.Entidades.Pago oPago         = new SistemaARA.Entidades.Pago();

            try
            {
                //Valido los datos del formulario
                Validar();

                oPago.idInstitucion = mIdInstitucion;
                oPago.fecha         = Convert.ToDateTime(txbCuota.Text);
                oPago.fechaPago     = Convert.ToDateTime(dtpFechaPago.Text);

                if (Operacion == General.TipoOperacion.Alta)
                {
                    oPagosNegocio.Add(oPago);
                    MessageBox.Show("Pago de cuota registrado exitosamente.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    oPagosNegocio.Update(oPago);
                    MessageBox.Show("Pago de cuota actualizado exitosamente.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

                // Indico que todo salio bien y cierro el formulario
                Cancelado = false;
                this.Hide();
            }
            catch (Exception ex)
            {
                // Muestro cualquier error de la aplicacion o por validaciĆ³n
                MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                // Libera objetos
                oPago         = null;
                oPagosNegocio = null;
            }
        }