public DataSet ReporteSocio(PrestamoRepBE BE) { DataSet dsResult; try { //cmd = db.GetStoredProcCommand("PrestamoRep_Mnt"); cmd = db.GetStoredProcCommand("dbo.PrestamoAll_Rpt"); cmd.CommandTimeout = 0; db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION); db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO); if (BE.dtFecRegIni != DateTime.MinValue) { db.AddInParameter(cmd, "fechaRegInicio", DbType.DateTime, BE.dtFecRegIni); } if (BE.dtFecRegFin != DateTime.MinValue) { db.AddInParameter(cmd, "fechaRegFin", DbType.DateTime, BE.dtFecRegFin); } db.AddInParameter(cmd, "valorMonedaID", DbType.String, BE.MonedaID); db.AddInParameter(cmd, "valorPersonaID", DbType.String, BE.TipPerID); db.AddInParameter(cmd, "valorDecisionCredID", DbType.Int32, BE.EstatusID); db.AddInParameter(cmd, "ClienteID", DbType.String, BE.ClienteID); db.AddInParameter(cmd, "IdPagadora", DbType.String, BE.IdPagadora); db.AddInParameter(cmd, "bTasa", DbType.Boolean, BE.bTasa); dsResult = db.ExecuteDataSet(cmd); } catch (Exception ex) { throw new Exception(ex.Message); } return(dsResult); }
public DataSet ReporteSocio(PrestamoRepBE BE) { return(oPrestamoRepDAL.ReporteSocio(BE)); }
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); //} }