예제 #1
0
        private void Dgv_solicitudes_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (Dgv_solicitudes.Rows.Count - 1 > 0)
            {
                try
                {
                    int      seleccionado = e.RowIndex;
                    double   subtotal     = 0;
                    string[] separados;
                    separados   = Dgv_solicitudes.Rows[seleccionado].Cells[3].Value.ToString().Split('-');
                    serie       = separados[0];
                    correlativo = separados[1];
                    logicaConsulta.obtenerDatosFactura(correlativo, serie, Txt_codigo, Txt_impuesto, Txt_total, Txt_fecha);
                    subtotal          = Double.Parse(Txt_total.Text) - Double.Parse(Txt_impuesto.Text);
                    Txt_subtotal.Text = subtotal.ToString();
                    logicaConsulta.consultarCliente(Txt_codigo.Text, Txt_nombres, Txt_apellidos, Txt_nit, false);
                    logicaConsulta.obtenerNumeroFacturaD(correlativo, serie, Txt_registros);

                    Txt_solicitud.Text = Dgv_solicitudes.Rows[seleccionado].Cells[0].Value.ToString();
                    Txt_factura.Text   = Dgv_solicitudes.Rows[seleccionado].Cells[3].Value.ToString();
                    Txt_fechaDev.Text  = Dgv_solicitudes.Rows[seleccionado].Cells[2].Value.ToString();
                    Txt_desc.Text      = Dgv_solicitudes.Rows[seleccionado].Cells[1].Value.ToString();
                }
                catch
                {
                    MessageBox.Show("Error Desconocido!", "Devoluciones", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }