Example #1
0
        private void btnImprimirEvaluacionP_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet ds = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("RptSolicitudFormato", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@Opcion", 1);
                    cmd1.Parameters.AddWithValue("@IdSolicitud", txtIdSolicitud.Text);
                    cmd1.Parameters.AddWithValue("@IdTipo_tt", "00322");
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(ds, "DataTable");
                    con.Close();
                }

                Crystal.crRptFormatoEvaluacionLegal ocrLoteLiquidacion       = new Crystal.crRptFormatoEvaluacionLegal();
                Reportes.frmVisorLoteLiquidacion    ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                ocrLoteLiquidacion.SetDataSource(ds);
                ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                ocrLoteLiquidacion.SetParameterValue("Titulo", "EVALUACION DE LEGAL DEL PAGADOR");
                ocrLoteLiquidacion.SetParameterValue("IdTipo_tt", "00322");
                ofrmVisorLoteLiquidacion.WindowState = FormWindowState.Maximized;
                ofrmVisorLoteLiquidacion.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            //Generar Cartas
            try
            {
                try
                {
                    DataSet    ds         = new DataSet();
                    CobranzaBE CobranzaBE = new CobranzaBE()
                    {
                        OPCION     = 10,
                        USUARIO    = General.General.GetUsuario,
                        dtRegistro = dtFechaFilter.Value
                    };

                    CobranzaBL CobranzaBL = new CobranzaBL();
                    ds = CobranzaBL.ProcesarCobranza(CobranzaBE);

                    Crystal.crRptCargoDocum          ocrLoteLiquidacion       = new Crystal.crRptCargoDocum();
                    Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                    ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                    ocrLoteLiquidacion.SetDataSource(ds.Tables[0]);
                    ocrLoteLiquidacion.SetParameterValue("usuario", General.General.GetUsuario);
                    ofrmVisorLoteLiquidacion.ShowDialog();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #3
0
        private void btnAnalisisMensual_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet dsGestionAvance        = new DataSet();
                DataSet dsGestionAvanceResumen = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("dbo.Rpt_DesembolsoXEjecutivo_Qry", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@Opcion", 3);
                    cmd1.CommandTimeout = 0;
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsGestionAvance, "Report3");
                    con.Close();
                }

                Crystal.crRpt_DesembolsoXEjecutivo_3 ocrLoteLiquidacion       = new Crystal.crRpt_DesembolsoXEjecutivo_3();
                Reportes.frmVisorLoteLiquidacion     ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                ocrLoteLiquidacion.SetDataSource(dsGestionAvance);
                ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                ofrmVisorLoteLiquidacion.WindowState = FormWindowState.Maximized;
                ofrmVisorLoteLiquidacion.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #4
0
        private void btnDesemMensualEjec_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet dsDatos = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("dbo.Rpt_DesMensualEjecutivo", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@Anio", DateTime.Now.Year.ToString());
                    cmd1.Parameters.AddWithValue("@valorMonedaID", 2);
                    cmd1.Parameters.AddWithValue("@Opcion", 2);
                    cmd1.CommandTimeout = 0;
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsDatos, "dtRpt_DesMensualEjecutivo");
                    con.Close();
                }

                Crystal.crRpt_DesMensualEjecutivo ocrLoteLiquidacion       = new Crystal.crRpt_DesMensualEjecutivo();
                Reportes.frmVisorLoteLiquidacion  ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                ocrLoteLiquidacion.SetDataSource(dsDatos);
                //ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                ocrLoteLiquidacion.SetParameterValue("Titulo", "DESEMBOLSOS MENSUAL POR EJECUTIVO EN SOLES");
                //ocrLoteLiquidacion.SetParameterValue("FechaFin", dtFin.Value);
                ofrmVisorLoteLiquidacion.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnProcesar_Click(object sender, EventArgs e)
        {
            try
            {
                General.msgHelper.Wait("Procesando, espere un momento ...");
                DataSet dsResumen = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("dbo.Rpt_CreditosResumen", con);
                    cmd1.CommandTimeout = 0;
                    cmd1.CommandType    = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@Opcion", 1);
                    cmd1.Parameters.AddWithValue("@gFechaOp", General.General.gFechaOp);
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsResumen, "dtResumen");
                    con.Close();
                }

                Crystal.crRpt_CreditosResumenAll ocrLoteLiquidacion       = new Crystal.crRpt_CreditosResumenAll();
                Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                ocrLoteLiquidacion.SetDataSource(dsResumen);
                ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                ocrLoteLiquidacion.SetParameterValue("gFechaOp", General.General.gFechaOp);
                ofrmVisorLoteLiquidacion.WindowState = FormWindowState.Maximized;
                ofrmVisorLoteLiquidacion.ShowDialog();
                General.msgHelper.Wait();
            }
            catch (Exception ex)
            {
                General.msgHelper.Wait();
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet dsDatos = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("dbo.Rpt_MovimientoLinea", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@dtInicio", dtInicio.Value);
                    cmd1.Parameters.AddWithValue("@dtFin", dtFin.Value);
                    cmd1.Parameters.AddWithValue("@Opcion", 1);
                    cmd1.CommandTimeout = 0;
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsDatos, "dtLineaMovimiento");
                    con.Close();
                }

                Crystal.crRpt_MovimientoLinea    ocrLoteLiquidacion       = new Crystal.crRpt_MovimientoLinea();
                Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                ocrLoteLiquidacion.SetDataSource(dsDatos);
                ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                ocrLoteLiquidacion.SetParameterValue("dtInicio", dtInicio.Value);
                ocrLoteLiquidacion.SetParameterValue("dtFin", dtFin.Value);
                ofrmVisorLoteLiquidacion.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #7
0
 private void dgvCargaDatos_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.ColumnIndex < 0)
         {
             return;
         }
         if (e.RowIndex == -1)
         {
             return;
         }
         if (dgvCargaDatos.Columns[e.ColumnIndex].Name == "btnImprimir")
         {
             Crystal.crRptCargaDatos          ocrCargaDatos       = new Crystal.crRptCargaDatos();
             Reportes.frmVisorLoteLiquidacion ofrmVisorCargaDatos = new Reportes.frmVisorLoteLiquidacion();
             ofrmVisorCargaDatos.crvVisorLoteLiq.ReportSource = ocrCargaDatos;
             ocrCargaDatos.SetParameterValue("usuario", General.General.GetUsuario);
             ocrCargaDatos.SetParameterValue("Criterio", TextBoxX1.Text.Trim());
             ocrCargaDatos.SetParameterValue("Codigo", dgvCargaDatos.CurrentRow.Cells["Codigo"].Value.ToString());
             ocrCargaDatos.SetParameterValue("RazonSocial", dgvCargaDatos.CurrentRow.Cells["RazonSocialNombres"].Value.ToString());
             ocrCargaDatos.SetParameterValue("DatosAdicionales", dgvCargaDatos.CurrentRow.Cells["DatosAdicionales"].Value.ToString());
             ocrCargaDatos.SetParameterValue("ResultadoBusqueda", "SI HUBO COICIDENCIA");
             ofrmVisorCargaDatos.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #8
0
        private void btnGestionAvanceNuevos_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet dsGestionAvance        = new DataSet();
                DataSet dsGestionAvanceResumen = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("dbo.Rpt_AvanceGestionNuevos", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@Annio", txtAño.Text);
                    cmd1.Parameters.AddWithValue("@Mes", cboMes.SelectedValue.ToString());
                    cmd1.Parameters.AddWithValue("@Opcion", 1);
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsGestionAvance, "dtAvanceGestionNuevos");
                    con.Close();
                }

                Crystal.Rpt_AvanceGestionNuevos  ocrLoteLiquidacion       = new Crystal.Rpt_AvanceGestionNuevos();
                Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                ocrLoteLiquidacion.SetDataSource(dsGestionAvance);
                //ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                //ocrLoteLiquidacion.SetParameterValue("Ejecutivo", cboEjecutivo.Text.ToString());
                ofrmVisorLoteLiquidacion.WindowState = FormWindowState.Maximized;
                ofrmVisorLoteLiquidacion.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #9
0
        private void btnVer_Click(object sender, EventArgs e)
        {
            try
            {
                int      Mon          = cboMoneda.SelectedIndex == 0 ? 1 : 2;
                DateTime FechaProceso = cboFechaProceso.SelectedValue.Equals("Hoy") ? DateTime.Now : Convert.ToDateTime(cboFechaProceso.SelectedValue.ToString());
                DataSet  dsDatos      = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("dbo.Rpt_DPF", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@FechaProceso", FechaProceso);
                    cmd1.Parameters.AddWithValue("@ValorMonedaId", Mon);
                    cmd1.Parameters.AddWithValue("@Usuario", General.General.GetCodigoUsuario);
                    cmd1.Parameters.AddWithValue("@Opcion", 1);
                    cmd1.CommandTimeout = 0;
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsDatos, "dtRpt_DPF");
                    con.Close();
                }

                Crystal.CrRpt_DPF ocrLoteLiquidacion = new Crystal.CrRpt_DPF();
                Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                ocrLoteLiquidacion.SetDataSource(dsDatos);
                ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                ocrLoteLiquidacion.SetParameterValue("strFecha", FechaProceso.Date.ToString("dd/MM/yyyy"));
                ofrmVisorLoteLiquidacion.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #10
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            try
            {
                string strResultado = string.Empty;
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    strResultado = strResultado + row["Codigo"].ToString() + ", ";
                }

                Crystal.crRptCargaDatos          ocrCargaDatos       = new Crystal.crRptCargaDatos();
                Reportes.frmVisorLoteLiquidacion ofrmVisorCargaDatos = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorCargaDatos.crvVisorLoteLiq.ReportSource = ocrCargaDatos;
                ocrCargaDatos.SetParameterValue("usuario", General.General.GetUsuario);
                ocrCargaDatos.SetParameterValue("Criterio", TextBoxX1.Text.Trim());
                ocrCargaDatos.SetParameterValue("Codigo", string.Empty);
                ocrCargaDatos.SetParameterValue("RazonSocial", string.Empty);
                ocrCargaDatos.SetParameterValue("DatosAdicionales", string.Empty);
                ocrCargaDatos.SetParameterValue("ResultadoBusqueda", "NO HUBO COICIDENCIAS");
                ofrmVisorCargaDatos.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            try
            {
                String strIdCobranza = txtIdCobranza.Text.Trim();
                if (string.IsNullOrEmpty(strIdCobranza))
                {
                    if (!GrabarCobranza())
                    {
                        return;
                    }
                    ;
                    strIdCobranza = txtIdCobranza.Text.Trim();
                }
                DataSet dsCobranza = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("Rpt_CobranzaS_Cab", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@IdCobranza", strIdCobranza);
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsCobranza, "Rpt_CobranzaP_Cab");

                    SqlCommand cmd2 = new SqlCommand("Rpt_CobranzaS_Det", con);
                    cmd2.CommandType = CommandType.StoredProcedure;
                    cmd2.Parameters.AddWithValue("@IdCobranza", strIdCobranza);
                    SqlDataAdapter daDet = new SqlDataAdapter(cmd2);
                    daDet.Fill(dsCobranza, "Rpt_CobranzaP_Det");

                    SqlCommand cmd3 = new SqlCommand("Rpt_CobranzaPago", con);
                    cmd3.CommandType = CommandType.StoredProcedure;
                    cmd3.Parameters.AddWithValue("@IdCobranza", strIdCobranza);
                    SqlDataAdapter daDet2 = new SqlDataAdapter(cmd3);
                    daDet2.Fill(dsCobranza, "Rpt_CobranzaPago");

                    con.Close();
                }

                Crystal.crRptCobranzaSocio       ocrRptCobranzaSocio      = new Crystal.crRptCobranzaSocio();
                Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrRptCobranzaSocio;
                ocrRptCobranzaSocio.SetDataSource(dsCobranza);
                ocrRptCobranzaSocio.SetParameterValue("Usuario", General.General.GetUsuario);
                ofrmVisorLoteLiquidacion.WindowState = FormWindowState.Maximized;
                ofrmVisorLoteLiquidacion.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #12
0
        private void btnProcesar_Click(object sender, EventArgs e)
        {
            try
            {
                General.msgHelper.Wait("Procesando, espere un momento ...");
                string      Flg_RptMonedaLinea = "1";
                TableBaseBE oEntity            = new TableBaseBE();
                oEntity.OPCION   = 1;
                oEntity.Table_Id = ConfigurationManager.AppSettings["TT_RptCCDMonedaLinea"].ToString();
                DataSet ds = new TableBaseBL().ProcesarTableBase(oEntity);

                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        Flg_RptMonedaLinea = ds.Tables[0].Rows[0]["Table_Value"].ToString();
                    }
                }

                DataSet dsGestionAvance        = new DataSet();
                DataSet dsGestionAvanceResumen = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("dbo.Rpt_CreditosVigentesxProducto", con);
                    cmd1.CommandTimeout = 0;
                    cmd1.CommandType    = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@Opcion", 1);
                    cmd1.Parameters.AddWithValue("@gFechaOp", General.General.gFechaOp);
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsGestionAvance, "dsCreditosVigentes");
                    con.Close();
                }

                Crystal.crRpt_CreditosVigentesxProductoX ocrLoteLiquidacion       = new Crystal.crRpt_CreditosVigentesxProductoX();
                Reportes.frmVisorLoteLiquidacion         ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                ocrLoteLiquidacion.SetDataSource(dsGestionAvance);
                ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                ocrLoteLiquidacion.SetParameterValue("Flg_RptMonedaLinea", Flg_RptMonedaLinea);
                ocrLoteLiquidacion.SetParameterValue("gFechaOp", General.General.gFechaOp);
                ofrmVisorLoteLiquidacion.WindowState = FormWindowState.Maximized;
                ofrmVisorLoteLiquidacion.ShowDialog();
                General.msgHelper.Wait();
            }
            catch (Exception ex)
            {
                General.msgHelper.Wait();
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void dgvLote_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.ColumnIndex < 0)
                {
                    return;
                }
                if (e.RowIndex == -1)
                {
                    return;
                }
                if (dgvLote.Columns[e.ColumnIndex].Name == "btnLiquidacion")
                {
                    String  strIdLote = dgvLote.CurrentRow.Cells["IdLote"].Value.ToString();
                    DataSet dsLotes   = new DataSet();
                    using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                    {
                        SqlCommand cmd1 = new SqlCommand("Rpt_Lote_Cab", con);
                        cmd1.CommandType = CommandType.StoredProcedure;
                        cmd1.Parameters.AddWithValue("@IdLote", strIdLote);
                        SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                        daCab.Fill(dsLotes, "Rpt_Lote_Cab");

                        SqlCommand cmd2 = new SqlCommand("Rpt_Lote_Det", con);
                        cmd2.CommandType = CommandType.StoredProcedure;
                        cmd2.Parameters.AddWithValue("@IdLote", strIdLote);
                        SqlDataAdapter daDet = new SqlDataAdapter(cmd2);
                        daDet.Fill(dsLotes, "Rpt_Lote_Det");

                        con.Close();
                    }

                    Crystal.crRegLiquidacion         ocrLoteLiquidacion       = new Crystal.crRegLiquidacion();
                    Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                    ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                    ocrLoteLiquidacion.SetDataSource(dsLotes);
                    ocrLoteLiquidacion.SetParameterValue("usuario", General.General.GetUsuario);
                    ocrLoteLiquidacion.SetParameterValue("moneda", dsLotes.Tables[0].Rows[0]["IdMoneda_Dsc"].ToString());
                    ofrmVisorLoteLiquidacion.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet dsDatos = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("dbo.Rpt_AportacionOrdinaria", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@FechaCorte", dtFechaCorte.Value);
                    cmd1.Parameters.AddWithValue("@Opcion", ChkFlgCtas.Checked ? 1 : 2);
                    cmd1.CommandTimeout = 0;
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsDatos, "dtAportacionOrdinaria");
                    con.Close();
                }

                if (ChkFlgCtas.Checked)
                {
                    Crystal.crRpt_AportacionOrdinaria ocrLoteLiquidacion       = new Crystal.crRpt_AportacionOrdinaria();
                    Reportes.frmVisorLoteLiquidacion  ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                    ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                    ocrLoteLiquidacion.SetDataSource(dsDatos);
                    ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                    ocrLoteLiquidacion.SetParameterValue("FechaCorte", dtFechaCorte.Value.Date);
                    ofrmVisorLoteLiquidacion.ShowDialog();
                }
                else
                {
                    Crystal.crRpt_AportacionOrdinariaF2 ocrLoteLiquidacion       = new Crystal.crRpt_AportacionOrdinariaF2();
                    Reportes.frmVisorLoteLiquidacion    ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                    ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                    ocrLoteLiquidacion.SetDataSource(dsDatos);
                    ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                    ocrLoteLiquidacion.SetParameterValue("FechaCorte", dtFechaCorte.Value.Date);
                    ofrmVisorLoteLiquidacion.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnVerLiquidacion_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                if (dgvLote.RowCount > 0)
                {
                    string  IdLote  = dgvLote.CurrentRow.Cells["IdLote"].Value.ToString();
                    DataSet dsLotes = new DataSet();
                    using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                    {
                        SqlCommand cmd1 = new SqlCommand("Rpt_Lote_Cab", con);
                        cmd1.CommandType = CommandType.StoredProcedure;
                        cmd1.Parameters.AddWithValue("@IdLote", IdLote);
                        SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                        daCab.Fill(dsLotes, "Rpt_Lote_Cab");

                        SqlCommand cmd2 = new SqlCommand("Rpt_Lote_Det", con);
                        cmd2.CommandType = CommandType.StoredProcedure;
                        cmd2.Parameters.AddWithValue("@IdLote", IdLote);
                        SqlDataAdapter daDet = new SqlDataAdapter(cmd2);
                        daDet.Fill(dsLotes, "Rpt_Lote_Det");

                        con.Close();
                    }

                    Crystal.crRegLiquidacion         ocrLoteLiquidacion       = new Crystal.crRegLiquidacion();
                    Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                    ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                    ofrmVisorLoteLiquidacion.StartPosition = FormStartPosition.CenterScreen;
                    ofrmVisorLoteLiquidacion.WindowState   = FormWindowState.Maximized;
                    ocrLoteLiquidacion.SetDataSource(dsLotes);
                    ocrLoteLiquidacion.SetParameterValue("usuario", General.General.GetUsuario);
                    ocrLoteLiquidacion.SetParameterValue("moneda", dsLotes.Tables[0].Rows[0]["IdMoneda_Dsc"].ToString());
                    ofrmVisorLoteLiquidacion.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnImprimirLote_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet dsRenovacion = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("Rpt_Renovacion", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@Opcion", 1);
                    cmd1.Parameters.AddWithValue("@IdRenovacion", txtIdRenovacion.Text.Trim());
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsRenovacion, "Renovacion");

                    SqlCommand cmd2 = new SqlCommand("Rpt_Renovacion", con);
                    cmd2.CommandType = CommandType.StoredProcedure;
                    cmd2.Parameters.AddWithValue("@Opcion", 2);
                    cmd2.Parameters.AddWithValue("@IdRenovacion", txtIdRenovacion.Text.Trim());
                    SqlDataAdapter daCab2 = new SqlDataAdapter(cmd2);
                    daCab2.Fill(dsRenovacion, "RenovacionDet1");

                    SqlCommand cmd3 = new SqlCommand("Rpt_Renovacion", con);
                    cmd3.CommandType = CommandType.StoredProcedure;
                    cmd3.Parameters.AddWithValue("@Opcion", 3);
                    cmd3.Parameters.AddWithValue("@IdRenovacion", txtIdRenovacion.Text.Trim());
                    SqlDataAdapter daCab3 = new SqlDataAdapter(cmd3);
                    daCab3.Fill(dsRenovacion, "RenovacionDet2");
                    con.Close();
                }

                Crystal.crRptRenovacion          ocrRptRenovacion         = new Crystal.crRptRenovacion();
                Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrRptRenovacion;
                ocrRptRenovacion.SetDataSource(dsRenovacion);
                ocrRptRenovacion.SetParameterValue("usuario", General.General.GetUsuario);
                ofrmVisorLoteLiquidacion.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #17
0
        private void btnRptAvanceGestionGestor_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet dsGestionAvance        = new DataSet();
                DataSet dsGestionAvanceResumen = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("dbo.Rpt_DesembolsoXGestor", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@Annio", txtAño.Text);
                    cmd1.Parameters.AddWithValue("@Mes", cboMes.SelectedValue.ToString());
                    cmd1.Parameters.AddWithValue("@Opcion", 1);
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsGestionAvance, "dtRpt_DesembolsoXGestor");
                    con.Close();
                }

                DateTime dt1 = DateTime.Now;
                DateTime dt2 = DateTime.Parse(DateTime.Now.Year.ToString() + "-" + (DateTime.Now.AddMonths(1).Month.ToString()) + "-01");
                dt2 = dt2.AddDays(-1);
                int dias = (dt2 - dt1).Days;

                Crystal.Rpt_DesembolsoXGestor    ocrLoteLiquidacion       = new Crystal.Rpt_DesembolsoXGestor();
                Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                ocrLoteLiquidacion.SetDataSource(dsGestionAvance);
                ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                ocrLoteLiquidacion.SetParameterValue("DiasCierre", dias.ToString());
                //ocrLoteLiquidacion.SetParameterValue("Ejecutivo", cboEjecutivo.Text.ToString());
                ofrmVisorLoteLiquidacion.WindowState = FormWindowState.Maximized;
                ofrmVisorLoteLiquidacion.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnAnexo3_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(TxtAnio.Text.Trim()) || TxtAnio.Text.Trim().Length < 4)
                {
                    MessageBox.Show("Se debe ingresar un año correcto", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                DataSet dsDatos = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("dbo.Rpt_SunatAnexos", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@Anio", TxtAnio.Text);
                    cmd1.Parameters.AddWithValue("@Usuario", General.General.GetCodigoUsuario);
                    cmd1.Parameters.AddWithValue("@Opcion", 3);
                    cmd1.CommandTimeout = 0;
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsDatos, "dtAnexo3");
                    con.Close();
                }

                Crystal.crRpt_Anexo3             ocrLoteLiquidacion       = new Crystal.crRpt_Anexo3();
                Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                ocrLoteLiquidacion.SetDataSource(dsDatos);
                ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                ofrmVisorLoteLiquidacion.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnCargoDocumento_Click(object sender, EventArgs e)
        {
            try
            {
                String  strIdLote = txtIdLote.Text.Trim();
                DataSet dsLotes   = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("Rpt_LoteCargoDoc_Cab", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@IdLote", strIdLote);
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsLotes, "dtLoteCargoCab");

                    SqlCommand cmd2 = new SqlCommand("Rpt_LoteCargoDoc_Det", con);
                    cmd2.CommandType = CommandType.StoredProcedure;
                    cmd2.Parameters.AddWithValue("@IdLote", strIdLote);
                    SqlDataAdapter daDet = new SqlDataAdapter(cmd2);
                    daDet.Fill(dsLotes, "dtLoteCargoDet");

                    con.Close();
                }

                Crystal.crRptCargoDocumento      ocrRptCargoDocumento     = new Crystal.crRptCargoDocumento();
                Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrRptCargoDocumento;
                ocrRptCargoDocumento.SetDataSource(dsLotes);
                //ocrRptCesionCobranza.SetParameterValue("usuario", General.General.GetUsuario);
                ofrmVisorLoteLiquidacion.WindowState = FormWindowState.Maximized;
                ofrmVisorLoteLiquidacion.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #20
0
        private void Imprimir()
        {
            try
            {
                if (gvRenovacion.CurrentRow.Cells["IdEstado_tt"].Value.ToString() == "00113") //Anulada
                {
                    return;
                }

                DataSet dsRenovacion = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("Rpt_Renovacion", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@Opcion", 1);
                    cmd1.Parameters.AddWithValue("@IdRenovacion", gvRenovacion.CurrentRow.Cells["IdRenovacion"].Value.ToString());
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsRenovacion, "Renovacion");

                    SqlCommand cmd2 = new SqlCommand("Rpt_Renovacion", con);
                    cmd2.CommandType = CommandType.StoredProcedure;
                    cmd2.Parameters.AddWithValue("@Opcion", 2);
                    cmd2.Parameters.AddWithValue("@IdRenovacion", gvRenovacion.CurrentRow.Cells["IdRenovacion"].Value.ToString());
                    SqlDataAdapter daCab2 = new SqlDataAdapter(cmd2);
                    daCab2.Fill(dsRenovacion, "RenovacionDet1");

                    SqlCommand cmd3 = new SqlCommand("Rpt_Renovacion", con);
                    cmd3.CommandType = CommandType.StoredProcedure;
                    cmd3.Parameters.AddWithValue("@Opcion", 3);
                    cmd3.Parameters.AddWithValue("@IdRenovacion", gvRenovacion.CurrentRow.Cells["IdRenovacion"].Value.ToString());
                    SqlDataAdapter daCab3 = new SqlDataAdapter(cmd3);
                    daCab3.Fill(dsRenovacion, "RenovacionDet2");
                    con.Close();

                    SqlCommand cmd4 = new SqlCommand("Rpt_Renovacion", con);
                    cmd4.CommandType = CommandType.StoredProcedure;
                    cmd4.Parameters.AddWithValue("@Opcion", 4);
                    cmd4.Parameters.AddWithValue("@IdRenovacion", gvRenovacion.CurrentRow.Cells["IdRenovacion"].Value.ToString());
                    SqlDataAdapter daCab4 = new SqlDataAdapter(cmd4);
                    daCab4.Fill(dsRenovacion, "RenovacionPago");
                    con.Close();
                }

                Crystal.crRptRenovacion          ocrRptRenovacion         = new Crystal.crRptRenovacion();
                Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrRptRenovacion;
                ocrRptRenovacion.SetDataSource(dsRenovacion);
                ocrRptRenovacion.SetParameterValue("usuario", General.General.GetUsuario);
                ofrmVisorLoteLiquidacion.Show();

                //Fondo Garantía
                DataSet dsRenovacionFG = new DataSet();
                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                {
                    SqlCommand cmd1 = new SqlCommand("Rpt_Renovacion", con);
                    cmd1.CommandType = CommandType.StoredProcedure;
                    cmd1.Parameters.AddWithValue("@Opcion", 1);
                    cmd1.Parameters.AddWithValue("@IdRenovacion", gvRenovacion.CurrentRow.Cells["IdRenovacion"].Value.ToString());
                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                    daCab.Fill(dsRenovacionFG, "Renovacion");

                    SqlCommand cmd4 = new SqlCommand("Rpt_Renovacion", con);
                    cmd4.CommandType = CommandType.StoredProcedure;
                    cmd4.Parameters.AddWithValue("@Opcion", 5);
                    cmd4.Parameters.AddWithValue("@IdRenovacion", gvRenovacion.CurrentRow.Cells["IdRenovacion"].Value.ToString());
                    SqlDataAdapter daCab4 = new SqlDataAdapter(cmd4);
                    daCab4.Fill(dsRenovacionFG, "RenovacionFG");
                    con.Close();
                }

                if (dsRenovacionFG.Tables["RenovacionFG"].Rows.Count > 0)
                {
                    Crystal.crRptRenovacionFG        ocrRptRenovacionFG = new Crystal.crRptRenovacionFG();
                    Reportes.frmVisorLoteLiquidacion ofrm = new Reportes.frmVisorLoteLiquidacion();
                    ofrm.crvVisorLoteLiq.ReportSource = ocrRptRenovacionFG;
                    ocrRptRenovacionFG.SetDataSource(dsRenovacionFG);
                    ocrRptRenovacionFG.SetParameterValue("Usuario", General.General.GetUsuario);
                    ofrm.Show();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #21
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            int    intMoneda  = 0;
            string strTipoPer = "";
            int    intEstatus = 0;
            int    intTasa    = 0;

            switch (cboEstatus.SelectedIndex)
            {
            case 1:
                intEstatus = 5;     //Generado
                break;

            case 2:
                intEstatus = 6;     //Desembolsado
                break;

            case 3:
                intEstatus = 7;     //Cancelado
                break;

            default:
                intEstatus = 0;     //Todos
                break;
            }

            switch (cboMonedaID.SelectedIndex)
            {
            case 1:
                intMoneda = 1;     //Soles
                break;

            case 2:
                intMoneda = 2;     //Dolares
                break;

            default:
                intMoneda = 0;     //Todos
                break;
            }

            switch (cboTipoPersona.SelectedIndex)
            {
            case 1:
                strTipoPer = "PN";     //PN
                break;

            case 2:
                strTipoPer = "PJ";     //PN
                break;

            default:
                strTipoPer = "";     //Todos
                break;
            }

            try
            {
                string strSubTitulo = "";
                intEstatus = chkVigente.Checked? 1 : 0;
                intTasa    = chkTasa.Checked ? 1 : 0;
                DataSet       ds             = new DataSet();
                PrestamoRepBE oPrestamoRepBE = new PrestamoRepBE()
                {
                    OPCION      = 1,
                    USUARIO     = General.General.GetUsuario,
                    dtFecRegIni = dtInicio.Value,
                    dtFecRegFin = dtFin.Value,
                    MonedaID    = intMoneda,
                    TipPerID    = strTipoPer,
                    ClienteID   = txtIdSocio.Text.Trim(),
                    IdPagadora  = txtIdPagadora.Text.Trim(),
                    EstatusID   = intEstatus,
                    bTasa       = intTasa
                };


                if (intEstatus == 1)
                {
                    strSubTitulo = "Lo vigente a la fecha";
                }
                else
                {
                    strSubTitulo = "Del " + dtInicio.Text + " al " + dtFin.Text;
                }

                ds = oPrestamoRepBL.ReporteSocio(oPrestamoRepBE);

                //Crystal.crRptPrestamoSocio ocrRptPrestamoSocio = new Crystal.crRptPrestamoSocio();
                Crystal.crRptPrestamoAll         ocrRptPrestamoSocio      = new Crystal.crRptPrestamoAll();
                Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                ocrRptPrestamoSocio.SetDataSource(ds.Tables[0]);

                ocrRptPrestamoSocio.SetParameterValue("usuario", General.General.GetUsuario);
                ocrRptPrestamoSocio.SetParameterValue("subtitulo", strSubTitulo);

                //ocrRptPrestamoSocio.SetParameterValue("TipoPersona",   cboTipoPersona.SelectedItem.ToString() );
                //ocrRptPrestamoSocio.SetParameterValue("FechaRegistro", dtInicio.Text + " al " + dtFin.Text);
                //ocrRptPrestamoSocio.SetParameterValue("Moneda", cboMonedaID.SelectedItem.ToString() ) ;
                //ocrRptPrestamoSocio.SetParameterValue("Estatus", cboEstatus.SelectedItem.ToString() );

                ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrRptPrestamoSocio;
                ofrmVisorLoteLiquidacion.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }


            //try
            //{
            //    String strIdLote = txtIdLote.Text.Trim();
            //    DataSet dsLotes = new DataSet();
            //    using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
            //    {
            //        SqlCommand cmd1 = new SqlCommand("Rpt_Lote_Cab", con);
            //        cmd1.CommandType = CommandType.StoredProcedure;
            //        cmd1.Parameters.AddWithValue("@IdLote", strIdLote);
            //        SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
            //        daCab.Fill(dsLotes, "Rpt_Lote_Cab");

            //        SqlCommand cmd2 = new SqlCommand("Rpt_Lote_Det", con);
            //        cmd2.CommandType = CommandType.StoredProcedure;
            //        cmd2.Parameters.AddWithValue("@IdLote", strIdLote);
            //        SqlDataAdapter daDet = new SqlDataAdapter(cmd2);
            //        daDet.Fill(dsLotes, "Rpt_Lote_Det");

            //        con.Close();
            //    }

            //    Crystal.crRegLiquidacion ocrLoteLiquidacion = new Crystal.crRegLiquidacion();
            //    Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
            //    ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
            //    ocrLoteLiquidacion.SetDataSource(dsLotes);
            //    ocrLoteLiquidacion.SetParameterValue("usuario", General.General.GetUsuario);
            //    ofrmVisorLoteLiquidacion.ShowDialog();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //}
        }
Example #22
0
        private void btnConfirmar_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;
            DataSet      ds           = new DataSet();

            try
            {
                if (dgvCobranza.RowCount > 0)
                {
                    if (dgvCobranza.CurrentRow.Cells["Status"].Value.ToString() != "A")
                    {
                        MessageBox.Show("Esta cobranza ya esta confirmada", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                    General.General.ValidarTipoCambio();
                    dialogResult = MessageBox.Show("Seguro de confirmar la cobranza Nro. " + dgvCobranza.CurrentRow.Cells["IdCobranza"].Value.ToString().Trim(), "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dialogResult == DialogResult.Yes)
                    {
                        //Confirma el detalle
                        string   IdCobranza  = dgvCobranza.CurrentRow.Cells["IdCobranza"].Value.ToString().Trim();
                        string   IdMoneda_tt = dgvCobranza.CurrentRow.Cells["IdMoneda_tt"].Value.ToString().Trim();
                        DateTime dtRegistro  = Convert.ToDateTime(dgvCobranza.CurrentRow.Cells["Fecha"].Value.ToString().Trim());
                        int      iMonedaID   = IdMoneda_tt == "00036" ? 1 : 2;

                        BindingList <CobranzaDetalleBE> LstCobranzaDetalle = new BindingList <CobranzaDetalleBE>();
                        DataSet           dsDetaLote         = new DataSet();
                        CobranzaDetalleBE oCobranzaDetalleBE = new CobranzaDetalleBE()
                        {
                            USUARIO    = General.General.GetCodigoUsuario,
                            OPCION     = 1,
                            IdCobranza = IdCobranza,
                            sdFechaOp  = General.General.gFechaOp
                        };
                        dsDetaLote = new CobranzaDetalleBL().ProcesarCobranzaDetalle(oCobranzaDetalleBE);
                        if (dsDetaLote.Tables[0].Rows.Count > 0)
                        {
                            for (int i = 0; i < dsDetaLote.Tables[0].Rows.Count; i++)
                            {
                                CobranzaDetalleBE oCobranzadetBE = new CobranzaDetalleBE()
                                {
                                    IdLote       = dsDetaLote.Tables[0].Rows[i]["IdLote"].ToString(),
                                    cItem        = dsDetaLote.Tables[0].Rows[i]["cItem"].ToString(),
                                    IdDocumento  = dsDetaLote.Tables[0].Rows[i]["IdDocumento"].ToString(),
                                    IdSocio      = dsDetaLote.Tables[0].Rows[i]["IdSocio"].ToString(),
                                    IdSocio_Dsc  = dsDetaLote.Tables[0].Rows[i]["IdSocio_Dsc"].ToString(),
                                    vDocumento   = dsDetaLote.Tables[0].Rows[i]["vDocumento"].ToString(),
                                    cNumDoc      = dsDetaLote.Tables[0].Rows[i]["cNumDoc"].ToString(),
                                    nvNominal    = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["nvNominal"].ToString()),
                                    nvNegociable = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["nvNegociable"].ToString()),
                                    nvImporte    = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["nvImporte"].ToString()),
                                    DifCobrada   = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["DifCobrada"].ToString()),
                                    Interes      = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["Interes"].ToString()),
                                    Garantia     = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["Garantia"].ToString()),
                                };
                                LstCobranzaDetalle.Add(oCobranzadetBE);
                            }
                        }

                        CobranzaBE oCobranza = new CobranzaBE()
                        {
                            USUARIO    = General.General.GetCodigoUsuario,
                            OPCION     = 6,
                            IdCobranza = IdCobranza,
                            dtRegistro = General.General.gFechaOp,
                            dtValuta   = General.General.gFechaOp,
                            iMonedaID  = iMonedaID,
                            gPlazaID   = General.General.gPlazaID,
                            gSesionID  = General.General.gSesionID,
                            gFechaOp   = General.General.gFechaOp
                        };
                        bool bResult = CobranzaBL.ProcesarCobranza(oCobranza, LstCobranzaDetalle);
                        if (bResult)
                        {
                            //oCobranza = new CobranzaBE()
                            //{
                            //    USUARIO = General.General.GetCodigoUsuario,
                            //    OPCION = 12,
                            //    IdCobranza = IdCobranza,
                            //    dtRegistro = General.General.gFechaOp,
                            //    dtValuta = General.General.gFechaOp,
                            //    gPlazaID = General.General.gPlazaID,
                            //    gSesionID = General.General.gSesionID,
                            //    gFechaOp = General.General.gFechaOp
                            //};
                            //CobranzaBL.ProcesarCobranza(oCobranza);

                            MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);

                            //Impresion
                            DataSet dsCobranza = new DataSet();
                            using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                            {
                                SqlCommand cmd1 = new SqlCommand("Rpt_CobranzaP_Cab", con);
                                cmd1.CommandType = CommandType.StoredProcedure;
                                cmd1.Parameters.AddWithValue("@IdCobranza", IdCobranza);
                                SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                                daCab.Fill(dsCobranza, "Rpt_CobranzaP_Cab");

                                SqlCommand cmd2 = new SqlCommand("Rpt_CobranzaP_Det", con);
                                cmd2.CommandType = CommandType.StoredProcedure;
                                cmd2.Parameters.AddWithValue("@IdCobranza", IdCobranza);
                                SqlDataAdapter daDet = new SqlDataAdapter(cmd2);
                                daDet.Fill(dsCobranza, "Rpt_CobranzaP_Det");

                                SqlCommand cmd3 = new SqlCommand("Rpt_CobranzaPago", con);
                                cmd3.CommandType = CommandType.StoredProcedure;
                                cmd3.Parameters.AddWithValue("@IdCobranza", IdCobranza);
                                SqlDataAdapter daDet2 = new SqlDataAdapter(cmd3);
                                daDet2.Fill(dsCobranza, "Rpt_CobranzaPago");

                                con.Close();
                            }

                            Crystal.crRptCobranzaPagadora    ocrLoteLiquidacion       = new Crystal.crRptCobranzaPagadora();
                            Reportes.frmVisorLoteLiquidacion ofrmVisorLoteLiquidacion = new Reportes.frmVisorLoteLiquidacion();
                            ofrmVisorLoteLiquidacion.crvVisorLoteLiq.ReportSource = ocrLoteLiquidacion;
                            ocrLoteLiquidacion.SetDataSource(dsCobranza);
                            ocrLoteLiquidacion.SetParameterValue("FechaCancelacion", dtRegistro);
                            ocrLoteLiquidacion.SetParameterValue("Usuario", General.General.GetUsuario);
                            ofrmVisorLoteLiquidacion.WindowState = FormWindowState.Maximized;
                            ofrmVisorLoteLiquidacion.ShowDialog();
                        }

                        //foreach (var item in LstCobranzaDetalle)
                        //{
                        //    item.USUARIO = General.General.GetCodigoUsuario;
                        //    item.OPCION = 5;
                        //    item.IdPagadora = item.IdPagadora;
                        //    item.IdSocio = item.IdSocio;
                        //    item.IdCobranza = IdCobranza;
                        //    item.nvImporte = item.nvImporte;
                        //    item.sdFechaOp = General.General.gFechaOp;
                        //    item.gSesionID = General.General.gSesionID;
                        //    item.gPlazaID = General.General.gPlazaID;
                        //    item.valorMonedaID = iMonedaID;
                        //    item.IdLote = item.IdLote;
                        //    item.cItem = item.cItem;
                        //    new CobranzaDetalleBL().ProcesarCobranzaDetalle(item);
                        //}
                        btnBuscar.PerformClick();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }