Exemplo n.º 1
0
 private void dgvPagos_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvPagos.Rows.Count >= 1 && e.RowIndex != -1 && e.ColumnIndex != -1)
     {
         DataGridViewCell celda = dgvPagos.CurrentCell;
         Int32            itipo = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[tipo.Name].Value);
         if (celda.Value.ToString() == "Ingresar Pago")
         {
             if (itipo == 5)
             {
                 cuoPreBan.CodCuotaPrestamo = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmCancelarPago form = new frmCancelarPago();
                 form.codCuota = cuoPreBan.CodCuotaPrestamo;
                 form.tipo     = itipo;
                 form.ShowDialog();
                 CargaLista();
             }
         }
         else if (celda.Value.ToString() == "Muestra Pagos")
         {
             if (itipo == 5)
             {
                 cuoPreBan.CodCuotaPrestamo = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmMuestraPagos form = new frmMuestraPagos();
                 form.codCuota = cuoPreBan.CodCuotaPrestamo;
                 form.InOut    = false;
                 form.tipo     = itipo;
                 form.ShowDialog();
                 CargaLista();
             }
         }
     }
 }
Exemplo n.º 2
0
 private void dgvPagos_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvPagos.Rows.Count >= 1 && e.RowIndex != -1 && e.ColumnIndex != -1)
     {
         DataGridViewCell celda = dgvPagos.CurrentCell;
         Int32            itipo = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[tipo.Name].Value);
         if (celda.Value.ToString() == "Ingresar Pago")
         {
             if (itipo == 1)
             {
                 //MOD7 aca poner la validacion si el pago de detraccion aun no ha sido cancelado no debe permitir cancelar la factura
                 fac.CodFactura   = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 fac.CodProveedor = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codproveedore.Name].Value.ToString());
                 frmCancelarPago form = new frmCancelarPago();
                 form.CodNota    = fac.CodFactura.ToString();
                 form.tipo       = itipo;
                 form.VentComp   = 2;
                 form.CodCliente = fac.CodProveedor;
                 form.ShowDialog();
                 CargaLista();
             }
             else if (itipo == 2)
             {
                 let.CodLetra = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmCancelarPago form = new frmCancelarPago();
                 form.CodLetra = let.CodLetra;
                 form.tipo     = itipo;
                 form.ShowDialog();
                 CargaLista();
             }
         }
         else if (celda.Value.ToString() == "Muestra Pagos")
         {
             if (itipo == 1)
             {
                 fac.CodFactura = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmMuestraPagos form = new frmMuestraPagos();
                 form.CodNota = fac.CodFactura;
                 form.InOut   = false;
                 form.tipo    = 0;
                 form.ShowDialog();
                 CargaLista();
             }
             else if (itipo == 2)
             {
                 let.CodLetra = Convert.ToInt32(dgvPagos.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmMuestraPagos form = new frmMuestraPagos();
                 form.CodNota = let.CodLetra;
                 form.InOut   = false;
                 form.tipo    = 1;
                 form.ShowDialog();
                 CargaLista();
             }
         }
     }
 }
Exemplo n.º 3
0
        private void muestraPagosToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            DataGridViewRow Row   = dgvPagos.SelectedRows[0];
            Int32           itipo = Convert.ToInt32(Row.Cells[tipo.Name].Value);

            cuoPreBan.CodCuotaPrestamo = Convert.ToInt32(Row.Cells[codnota.Name].Value);
            frmMuestraPagos form = new frmMuestraPagos();

            form.codCuota = cuoPreBan.CodCuotaPrestamo;
            form.InOut    = false;
            form.tipo     = itipo;
            form.ShowDialog();
            CargaLista();
        }
Exemplo n.º 4
0
        private void muestraPagosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataGridViewRow Row = dgvCobros.SelectedRows[0];

            venta.CodFacturaVenta = Row.Cells[codnota.Name].Value.ToString();
            venta.Pendiente       = Convert.ToDouble(Row.Cells[pendiente.Name].Value.ToString());
            Decimal         totalM = Convert.ToDecimal(Row.Cells[monto.Name].Value.ToString());
            frmMuestraPagos form   = new frmMuestraPagos();

            form.CodNota = Convert.ToInt32(venta.CodFacturaVenta);
            if (cmbEstado.SelectedIndex == 0)
            {
                form.montoTotal = Convert.ToDecimal(venta.Pendiente);
            }
            else if (cmbEstado.SelectedIndex == 1)
            {
                form.montoTotal = Convert.ToDecimal(totalM);
            }

            form.InOut = true;
            form.ShowDialog();
            //CargaLista();
        }
Exemplo n.º 5
0
 private void dgvCobros_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvCobros.Rows.Count >= 1 && e.RowIndex != -1)
     {
         DataGridViewCell celda = dgvCobros.Rows[e.RowIndex].Cells[e.ColumnIndex];
         Int32            itipo = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[tipo.Name].Value);
         if (celda.Value.ToString() == "Ingresar Pago")
         {
             if (itipo == 3)
             {
                 if (Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[xaprobars.Name].Value) > 0)
                 {
                     MessageBox.Show("PENDIENTE DE APROBACION", "IMPOSIBLE REGISTRAR NUEVO PAGO", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                 }
                 else
                 {
                     if (dgvCobros.Rows[e.RowIndex].Cells[numdocumento.Name].Value.ToString().Length <= 8)
                     {
                         MessageBox.Show("PENDIENTE DE IMPRESIÓN", "IMPOSIBLE REGISTRAR NUEVO PAGO", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                     }
                     else
                     {
                         venta.CodFacturaVenta = dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value.ToString();
                         venta.CodCliente      = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[codcliente.Name].Value.ToString());
                         frmCancelarPago form = new frmCancelarPago();
                         form.CodNota    = venta.CodFacturaVenta;
                         form.CodCliente = venta.CodCliente;
                         form.tipo       = itipo;
                         form.VentComp   = 1;
                         DialogResult dlgResult = form.ShowDialog();
                         //if (dlgResult == DialogResult.Yes)
                         //{
                         //CargaLista();
                         //}
                     }
                 }
             }
             else if (itipo == 4)
             {
                 let.CodLetra = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmCancelarPago form = new frmCancelarPago();
                 form.CodLetra = let.CodLetra;
                 form.tipo     = itipo;
                 DialogResult dlgResult = form.ShowDialog();
                 if (dlgResult == DialogResult.Yes)
                 {
                     //CargaLista();
                 }
             }
         }
         else if (celda.Value.ToString() == "Muestra Pagos")
         {
             if (itipo == 3)
             {
                 venta.CodFacturaVenta = dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value.ToString();
                 venta.Pendiente       = Convert.ToDouble(dgvCobros.Rows[e.RowIndex].Cells[pendiente.Name].Value.ToString());
                 Decimal         totalM = Convert.ToDecimal(dgvCobros.Rows[e.RowIndex].Cells[monto.Name].Value.ToString());
                 frmMuestraPagos form   = new frmMuestraPagos();
                 form.CodNota = Convert.ToInt32(venta.CodFacturaVenta);
                 if (cmbEstado.SelectedIndex == 0)
                 {
                     form.montoTotal = Convert.ToDecimal(venta.Pendiente);
                 }
                 else if (cmbEstado.SelectedIndex == 1)
                 {
                     form.montoTotal = Convert.ToDecimal(totalM);
                 }
                 form.InOut = true;
                 form.tipo  = 0;
                 DialogResult dlgResult = form.ShowDialog();
                 if (dlgResult == DialogResult.Yes)
                 {
                     //CargaLista();
                 }
             }
             else if (itipo == 4)
             {
                 let.CodLetra = Convert.ToInt32(dgvCobros.Rows[e.RowIndex].Cells[codnota.Name].Value);
                 frmMuestraPagos form = new frmMuestraPagos();
                 form.CodNota = let.CodLetra;
                 form.InOut   = true;
                 form.tipo    = 1;
                 DialogResult dlgResult = form.ShowDialog();
                 if (dlgResult == DialogResult.Yes)
                 {
                     //CargaLista();
                 }
             }
         }
     }
 }