Exemple #1
0
        private void btnSelChofer_Click(object sender, EventArgs e)
        {
            frmSeleccionarChofer frm = new frmSeleccionarChofer(this);

            frm.ShowDialog();
            lblChofer.Text = MINombre;
        }
Exemple #2
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (dtpFechaPago.Text == string.Empty || txtMonto.Text == string.Empty)
            {
                MessageBox.Show("¡No se admiten campos vacios");
            }
            else
            {
                try
                {
                    frmSeleccionarChofer frm = new frmSeleccionarChofer(this);
                    int idPago = NPago.Insertar(dtpFechaPago.Value.Day.ToString(), dtpFechaPago.Value.Month.ToString(), dtpFechaPago.Value.Year.ToString(), dtpFechaPago.Value.Hour.ToString() + ":" + dtpFechaPago.Value.Minute.ToString(), Convert.ToInt32(miid), Convert.ToDouble(txtMonto.Text));
                    // GuardarDatosImpresion(dtpFechaPago.Value.Day.ToString()+"/"+dtpFechaPago.Value.Month.ToString() + "/" + dtpFechaPago.Value.Year.ToString(), dtpFechaPago.Value.Hour.ToString() + ":" + dtpFechaPago.Value.Minute.ToString());
                    MostrarTodosLosPagos();
                    btnNuevo.Enabled = true;

                    int Result = Negocio.NDeuda.VincularPago(idPago, MIidDeuda);

                    if (Result > 0)
                    {
                        MessageBox.Show("Pago completado correctamente");
                        BloquearCampos(false);
                        Limpiar();
                        lblChofer.Text = "Chofer";
                    }
                    else
                    {
                        //TODO Aca lo que pasa si falla el update
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message + ex.StackTrace);
                }
            }
        }