private void LlenarCombos() { try { General.General.LlenarCombobox(cboUsuarios, "nombreCompleto", "gestorID", new GestionComercialBL().ProcesarGestionComercial(0, 0, "", "", 0, 3).Tables[0]); DataSet ds = new DataSet(); ds = new GestionComercialBL().ProcesarGestionComercial(0, 0, "", "", 0, 3); DataTable dt = new DataTable(); dt = ds.Tables[0]; DataRow dr; dr = dt.NewRow(); dr["nombreCompleto"] = "--Seleccionar--"; dr["gestorID"] = ""; dt.Rows.InsertAt(dr, 0); //DataRow dr1; //dr1 = dt.NewRow(); //dr1["nombreCompleto"] = "--Sin Asignar Ejecutivo--"; //dr1["gestorID"] = "SinAsignar"; //dt.Rows.InsertAt(dr1, 1); cboEjecutivo.DataSource = dt; cboEjecutivo.DisplayMember = "nombreCompleto"; cboEjecutivo.ValueMember = "gestorID"; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LlenarCombos() { try { String Table_Id = "00213"; //MESES TableBaseBE TableBaseBE = new TableBaseBE() { OPCION = 1, USUARIO = General.General.GetCodigoUsuario, Table_Parent_Id = Table_Id }; cboMes.DataSource = new TableBaseBL().ProcesarTableBase(TableBaseBE).Tables[0]; cboMes.DisplayMember = "Table_Name"; cboMes.ValueMember = "Table_Value"; cboMes.SelectedValue = DateTime.Now.Month.ToString().PadLeft(2, '0'); DataSet dsMesCurso = new GestionComercialBL().ProcesarGestionComercial(0, 0, "", "", 0, 6); if (dsMesCurso.Tables[0].Rows.Count > 0) { txtAño.Text = dsMesCurso.Tables[0].Rows[0]["Year"].ToString(); cboMes.SelectedValue = dsMesCurso.Tables[0].Rows[0]["Mes"].ToString(); } DataSet dsGestor = new GestionComercialBL().ProcesarGestionComercial(0, 0, "", "", 0, 3); General.General.LlenarCombobox(cboEjecutivo, "nombreCompleto", "gestorID", dsGestor.Tables[0], true); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarDatos() { try { DataSet dsDatos = new GestionComercialBL().ProcesarGestionComercial(0, 0, _Pagadoras, "", 0, 4); dgvDatos.DataSource = dsDatos.Tables[0]; ChartPie.Series[0].Points.Clear(); ChartPie.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie; ChartPie.Titles.Add("Saldo Colocaciones por Setor"); ChartPie.ChartAreas[0].BackColor = Color.Transparent; ChartPie.Series[0]["PieLabelStyle"] = "Disabled"; foreach (DataRow dr in dsDatos.Tables[0].Rows) { ChartPie.Series[0].Points.AddXY(dr["Sector"].ToString(), decimal.Parse(dr["Utilizado"].ToString())); //ChartPie.Series[0].label //ChartPie.Series[0].Points.AddXY( = dr["Utilizado"].ToString(); } ChartLine.Series[0].Points.Clear(); ChartLine.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Bar; ChartLine.Titles.Add("Saldo Colocación VS Líneas por Sector"); ChartLine.ChartAreas[0].BackColor = Color.Transparent; Dictionary <string, decimal> LstEntityS1 = new Dictionary <string, decimal>(); Dictionary <string, decimal> LstEntityS2 = new Dictionary <string, decimal>(); foreach (DataRow dr in dsDatos.Tables[0].Rows) { LstEntityS1.Add(dr["Sector"].ToString(), decimal.Parse(dr["Vigente"].ToString())); LstEntityS2.Add(dr["Sector"].ToString(), decimal.Parse(dr["Utilizado"].ToString())); } ChartLine.Series.Clear(); Series barSeries1 = new Series(); barSeries1.Points.DataBindXY(LstEntityS1.Keys, LstEntityS1.Values); barSeries1.Name = "Línea Pagador Vigente"; barSeries1.Color = Color.Blue; barSeries1.ChartType = SeriesChartType.Column; barSeries1.ChartArea = "ChartArea1"; ChartLine.Series.Add(barSeries1); Series barSeries2 = new Series(); barSeries2.Points.DataBindXY(LstEntityS2.Keys, LstEntityS2.Values); barSeries2.Name = "Línea Utilizado"; barSeries2.Color = Color.Red; barSeries2.ChartType = SeriesChartType.Column; barSeries2.ChartArea = "ChartArea1"; ChartLine.Series.Add(barSeries2); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LlenarCombos() { try { DataSet dsGestor = new GestionComercialBL().ProcesarGestionComercial(0, 0, "", "", 0, 3); General.General.LlenarCombobox(cboUsuarios, "nombreCompleto", "gestorID", dsGestor.Tables[0]); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnBuscar_Click(object sender, EventArgs e) { try { DataSet ds = new DataSet(); ds = new GestionComercialBL().Procesar_Rpt_OperacionNoRetornaron(1, string.Empty, cboEjecutivo.SelectedValue.ToString(), 0); dgvDatos.DataSource = ds.Tables[0]; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarDatos() { try { DataSet ds = new DataSet(); ds = new GestionComercialBL().ProcesarRpt_PagadoraDesembolsoGC(_Annio, _Mes, _IdGestor, 2); dgvDatos.DataSource = ds.Tables[0]; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarDatos() { try { DataSet ds = new DataSet(); ds = new GestionComercialBL().Procesar_Rpt_ControlDiarioMnt(1, string.Empty, string.Empty); dgvDatos.DataSource = ds.Tables[0]; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarDatos() { try { DataSet ds = new DataSet(); ds = new GestionComercialBL().Procesar_Rpt_Tuberia(cboEjecutivo.SelectedValue.ToString(), IdTipoGestor_tt, 1); dgvTuberia.DataSource = ds.Tables[0]; lblRegistros.Text = dgvTuberia.Rows.Count + " registro(s)"; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarReporte() { try { DataSet ds = new DataSet(); ds = new GestionComercialBL().Procesar_Rpt_ListaSociosPeligroFuga(1); dgvResumenGestion.DataSource = ds.Tables[0]; lblRegistros.Text = ds.Tables[0].Rows.Count + " registro(s)"; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarReporte() { try { DataSet ds = new DataSet(); ds = new GestionComercialBL().Procesar_Rpt_TableroControlGestionMnt(2, cboEjecutivo.SelectedValue.ToString()); dgvControlNuevos.DataSource = ds.Tables[0]; lblRegistros.Text = ds.Tables[0].Rows.Count + " registro(s)"; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarTableroNuevos() { try { DataSet ds = new DataSet(); ds = new GestionComercialBL().Procesar_Rpt_TableroControlGestionNuevos_Det(IdGestor, Clasificacion, ColumnName); if (ds.Tables.Count > 0) { dgvReporteDetalle.DataSource = ds.Tables[0]; dgvReporteDetalle.Columns["Socio"].Width = 250; lblRegistros.Text = ds.Tables[0].Rows.Count + " registro(s)"; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LlenarCombos(ref bool bGestor) { bGestor = false; try { DataSet dsGestor = new GestionComercialBL().ProcesarGestionComercial(0, 0, "", "", 0, 3); General.General.LlenarCombobox(cboEjecutivo, "nombreCompleto", "gestorID", dsGestor.Tables[0], true); if (!string.IsNullOrEmpty(General.General.GetIdGestor.Trim())) { cboEjecutivo.SelectedValue = General.General.GetIdGestor; bGestor = true; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarDatosMnt() { try { DataSet ds = new DataSet(); ds = new GestionComercialBL().Procesar_Rpt_ControlDiarioMnt(2, Codigo, ColumnName); if (ds.Tables.Count > 0) { dgvReporteDetalle.DataSource = ds.Tables[0]; dgvReporteDetalle.Columns["Socio"].Width = 250; lblRegistros.Text = ds.Tables[0].Rows.Count + " registro(s)"; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LlenarCombos() { try { UsuarioGestorBE oEntity = new UsuarioGestorBE() { OPCION = 4, USUARIO = General.General.GetCodigoUsuario }; if (Operacion.Equals("M")) { oEntity.OPCION = 5; } DataTable dt = new DataTable(); dt = new UsuarioGestorBL().ProcesarUsuarioGestor(oEntity).Tables[0]; DataRow dr; dr = dt.NewRow(); dr["usuarioID"] = "--Seleccionar--"; dr["usuarioID"] = "--Seleccionar--"; dt.Rows.InsertAt(dr, 0); cboUsuarios.DataSource = dt; cboUsuarios.DisplayMember = "usuarioID"; cboUsuarios.ValueMember = "usuarioID"; DataSet dsGestor = new GestionComercialBL().ProcesarGestionComercial(0, 0, "", "", 0, 7); General.General.LlenarCombobox(cboGestor, "nombreCompleto", "gestorID", dsGestor.Tables[0]); TableBaseBE oEntityTB = new TableBaseBE() { OPCION = 1, USUARIO = General.General.GetUsuario, Table_Parent_Id = "00246" //Tipo Gestor }; General.General.LlenarCombobox(cboIdTipoGestor_tt, "Table_Name", "Table_Id", new TableBaseBL().ProcesarTableBase(oEntityTB).Tables[0]); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LlenarCombos() { try { DataSet dsGestor = new GestionComercialBL().ProcesarGestionComercial(0, 0, "", "", 0, 3); General.General.LlenarCombobox(cboEjecutivo, "nombreCompleto", "gestorID", dsGestor.Tables[0], true); String Table_Id = "00030"; //Estado de Lineas TableBaseBE TableBaseBE = new TableBaseBE() { OPCION = 1, USUARIO = General.General.GetCodigoUsuario, Table_Parent_Id = Table_Id }; DataTable dt = new DataTable(); dt = new TableBaseBL().ProcesarTableBase(TableBaseBE).Tables[0]; DataRow dr; dr = dt.NewRow(); dr["Table_Name"] = "Activa"; dr["Table_Id"] = "00031"; dt.Rows.InsertAt(dr, 0); DataRow dr1; dr1 = dt.NewRow(); dr1["Table_Name"] = "Inactiva"; dr1["Table_Id"] = "00451"; dt.Rows.InsertAt(dr1, 1); DataRow dr2; dr2 = dt.NewRow(); dr2["Table_Name"] = "Anulada"; dr2["Table_Id"] = "00034"; dt.Rows.InsertAt(dr2, 6); //cboIdEstadoLinea_tt.Items.Add({Table_Name = "xx", } General.General.LlenarCombobox(cboIdEstadoLinea_tt, "Table_Name", "Table_Id", dt); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarDatos() { try { lblDia1.Text = dtFechaInicio.Value.ToString("dd/MM/yyyy"); lblDia2.Text = dtFechaInicio.Value.AddDays(1).ToString("dd/MM/yyyy"); lblDia3.Text = dtFechaInicio.Value.AddDays(2).ToString("dd/MM/yyyy"); lblDia4.Text = dtFechaInicio.Value.AddDays(3).ToString("dd/MM/yyyy"); lblDia5.Text = dtFechaInicio.Value.AddDays(4).ToString("dd/MM/yyyy"); lblDia6.Text = dtFechaInicio.Value.AddDays(5).ToString("dd/MM/yyyy"); lblDia7.Text = dtFechaInicio.Value.AddDays(6).ToString("dd/MM/yyyy"); lblDia8.Text = dtFechaInicio.Value.AddDays(7).ToString("dd/MM/yyyy"); DataSet ds = new DataSet(); ds = new GestionComercialBL().ProcesarGestionComercial(9, string.Empty, dtFechaInicio.Value); dgvRequerimientos.DataSource = ds.Tables[0]; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarDatos() { try { DataSet ds = new DataSet(); ds = new GestionComercialBL().Procesar_Rpt_OperacionNoRetornaron(2, Codigo, string.Empty, 7); dgvCobrado.DataSource = ds.Tables[0]; DataSet ds1 = new DataSet(); ds1 = new GestionComercialBL().Procesar_Rpt_OperacionNoRetornaron(2, Codigo, string.Empty, 6); dgvDesembolsado.DataSource = ds1.Tables[0]; Decimal dCNominal = 0; Decimal dCDesembolso = 0; foreach (DataRow dr in ds.Tables[0].Rows) { dCNominal += Convert.ToDecimal(dr["nvNominal"].ToString()); dCDesembolso += Convert.ToDecimal(dr["nvNegociable"].ToString()); } txtCNominal.Text = dCNominal.ToString("N2"); txtCNegociable.Text = dCDesembolso.ToString("N2"); Decimal dDNominal = 0; Decimal dDDesembolso = 0; foreach (DataRow dr in ds1.Tables[0].Rows) { dDNominal += Convert.ToDecimal(dr["nvNominal"].ToString()); dDDesembolso += Convert.ToDecimal(dr["nvNegociable"].ToString()); } txtDNominal.Text = dDNominal.ToString("N2"); txtDNegociable.Text = dDDesembolso.ToString("N2"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarDatos() { try { DataSet ds = new DataSet(); ds = new GestionComercialBL().Procesar_Rpt_TableroControlGestionMnt(1, string.Empty); if (ds.Tables[0].Rows.Count > 0) { lblFecha.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["FechaDate"]).ToString("dd/MM/yy"); lblFecha1.Text = Convert.ToDateTime(ds.Tables[0].Rows[1]["FechaDate"]).ToString("dd/MM/yy"); lblFecha2.Text = Convert.ToDateTime(ds.Tables[0].Rows[2]["FechaDate"]).ToString("dd/MM/yy"); lblFecha3.Text = Convert.ToDateTime(ds.Tables[0].Rows[3]["FechaDate"]).ToString("dd/MM/yy"); lblFecha4.Text = Convert.ToDateTime(ds.Tables[0].Rows[4]["FechaDate"]).ToString("dd/MM/yy"); lblFecha5.Text = Convert.ToDateTime(ds.Tables[0].Rows[5]["FechaDate"]).ToString("dd/MM/yy"); lblFecha6.Text = Convert.ToDateTime(ds.Tables[0].Rows[6]["FechaDate"]).ToString("dd/MM/yy"); lblFecha7.Text = Convert.ToDateTime(ds.Tables[0].Rows[7]["FechaDate"]).ToString("dd/MM/yy"); lblFecha8.Text = Convert.ToDateTime(ds.Tables[0].Rows[8]["FechaDate"]).ToString("dd/MM/yy"); lblFecha9.Text = Convert.ToDateTime(ds.Tables[0].Rows[9]["FechaDate"]).ToString("dd/MM/yy"); lblFecha10.Text = Convert.ToDateTime(ds.Tables[0].Rows[10]["FechaDate"]).ToString("dd/MM/yy"); lblFecha11.Text = Convert.ToDateTime(ds.Tables[0].Rows[11]["FechaDate"]).ToString("dd/MM/yy"); lblFecha12.Text = Convert.ToDateTime(ds.Tables[0].Rows[12]["FechaDate"]).ToString("dd/MM/yy"); lblFecha13.Text = Convert.ToDateTime(ds.Tables[0].Rows[13]["FechaDate"]).ToString("dd/MM/yy"); lblFecha14.Text = Convert.ToDateTime(ds.Tables[0].Rows[14]["FechaDate"]).ToString("dd/MM/yy"); lblFecha15.Text = Convert.ToDateTime(ds.Tables[0].Rows[15]["FechaDate"]).ToString("dd/MM/yy"); lblFecha16.Text = Convert.ToDateTime(ds.Tables[0].Rows[16]["FechaDate"]).ToString("dd/MM/yy"); lblFecha17.Text = Convert.ToDateTime(ds.Tables[0].Rows[17]["FechaDate"]).ToString("dd/MM/yy"); lblFecha18.Text = ds.Tables[0].Rows.Count >= 19 ? Convert.ToDateTime(ds.Tables[0].Rows[18]["FechaDate"]).ToString("dd/MM/yy") : string.Empty; lblFecha19.Text = ds.Tables[0].Rows.Count >= 20 ? Convert.ToDateTime(ds.Tables[0].Rows[19]["FechaDate"]).ToString("dd/MM/yy") : string.Empty; lblFecha20.Text = ds.Tables[0].Rows.Count >= 21 ? Convert.ToDateTime(ds.Tables[0].Rows[20]["FechaDate"]).ToString("dd/MM/yy") : string.Empty; lblFecha21.Text = ds.Tables[0].Rows.Count >= 22 ? Convert.ToDateTime(ds.Tables[0].Rows[21]["FechaDate"]).ToString("dd/MM/yy") : string.Empty; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LlenarCombos() { try { DataSet dsGestor = new GestionComercialBL().ProcesarGestionComercial(0, 0, "", "", 0, 3); DataTable dt = new DataTable(); dt = dsGestor.Tables[0]; DataRow dr; dr = dt.NewRow(); dr["nombreCompleto"] = "<<Todos>>"; dr["gestorID"] = ""; dt.Rows.InsertAt(dr, 0); DataRow dr1; dr1 = dt.NewRow(); dr1["nombreCompleto"] = "<<Equipo Nuevos>>"; dr1["gestorID"] = "EquipoNuevos"; dt.Rows.InsertAt(dr1, 1); DataRow dr2; dr2 = dt.NewRow(); dr2["nombreCompleto"] = "<<Equipo Mnt>>"; dr2["gestorID"] = "EquipoMnt"; dt.Rows.InsertAt(dr2, 2); cboEjecutivo.DataSource = dt; cboEjecutivo.DisplayMember = "nombreCompleto"; cboEjecutivo.ValueMember = "gestorID"; //General.General.LlenarCombobox(cboEjecutivo, "nombreCompleto", "gestorID", dsGestor.Tables[0], true); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnBuscar_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(cboMes.SelectedValue.ToString())) { MessageBox.Show("Debe seleccionar un mes", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); cboMes.Focus(); return; } if (string.IsNullOrEmpty(cboEjecutivo.SelectedValue.ToString())) { dgvReporte.Columns["Gestor"].Visible = true; } else { dgvReporte.Columns["Gestor"].Visible = false; } ds = new GestionComercialBL().ProcesarGestionComercial(int.Parse(txtAño.Text), int.Parse(cboMes.SelectedValue.ToString()), cboEjecutivo.SelectedValue.ToString(), "", Convert.ToDecimal(txtTipCam.Text), 1); dt = ds.Tables[0]; dgvReporte.DataSource = dt; lblRegistros.Text = dgvReporte.Rows.Count + " registro(s)"; Decimal dTeorico = 0; Decimal dReal = 0; Decimal dDesembolso = 0; Decimal dDiferencia = 0; foreach (DataRow dr in ds.Tables[0].Rows) { dTeorico += Convert.ToDecimal(dr["PendCob"].ToString()); dReal += Convert.ToDecimal(dr["CobReal"].ToString()); dDesembolso += Convert.ToDecimal(dr["nDesembolso"].ToString()); dDiferencia += Convert.ToDecimal(dr["nDesembolso"].ToString()) - Convert.ToDecimal(dr["CobReal"].ToString()); } txtTeorica.Text = dTeorico.ToString("N2"); txtReal.Text = dReal.ToString("N2"); txtDesembolso.Text = dDesembolso.ToString("N2"); txtDiferencia.Text = dDiferencia.ToString("N2"); if (dDiferencia < 0) { txtDiferencia.ForeColor = System.Drawing.Color.Red; } DataSet dsMeta = new GestionComercialBL().ProcesarGestionComercial(int.Parse(txtAño.Text), int.Parse(cboMes.SelectedValue.ToString()), cboEjecutivo.SelectedValue.ToString(), "", Convert.ToDecimal(txtTipCam.Text), 5); if (dsMeta.Tables[0].Rows.Count > 0) { txtMeta.Text = string.IsNullOrEmpty(dsMeta.Tables[0].Rows[0]["Meta"].ToString()) ? "0.00" : Convert.ToDecimal(dsMeta.Tables[0].Rows[0]["Meta"]).ToString("N2"); txtDiasHabiles.Text = dsMeta.Tables[0].Rows[0]["DiasHabiles"].ToString(); } // DataSet dsResumenToday = new GestionComercialBL().ProcesarGestionComercial(int.Parse(txtAño.Text), int.Parse(cboMes.SelectedValue.ToString()), cboEjecutivo.SelectedValue.ToString(), "", Convert.ToDecimal(txtTipCam.Text), 8); if (dsResumenToday.Tables[0].Rows.Count > 0) { txtTeoricaToday.Text = string.IsNullOrEmpty(dsResumenToday.Tables[0].Rows[0]["nTeorico"].ToString()) ? "0.00" : (Convert.ToDecimal(dsResumenToday.Tables[0].Rows[0]["nTeorico"]) - Convert.ToDecimal(dsResumenToday.Tables[0].Rows[0]["nReal"])).ToString("N2"); txtRealToday.Text = string.IsNullOrEmpty(dsResumenToday.Tables[0].Rows[0]["nReal"].ToString()) ? "0.00" : Convert.ToDecimal(dsResumenToday.Tables[0].Rows[0]["nReal"]).ToString("N2"); txtDesembolsoToday.Text = string.IsNullOrEmpty(dsResumenToday.Tables[0].Rows[0]["nDesembolso"].ToString()) ? "0.00" : Convert.ToDecimal(dsResumenToday.Tables[0].Rows[0]["nDesembolso"]).ToString("N2"); txtDiferenciaToday.Text = (Convert.ToDecimal(txtDesembolsoToday.Text) - Convert.ToDecimal(txtRealToday.Text)).ToString("N2"); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnBuscar_Click(object sender, EventArgs e) { try { DataSet ds = new GestionComercialBL().ProcesarGestionComercialRpt(DateTime.MinValue, DateTime.MinValue, cboEjecutivo.SelectedValue.ToString(), _Mes, 2); dgvReporteSol.DataSource = ds.Tables[0]; dgvReporteDol.DataSource = ds.Tables[1]; Decimal dTeoricoSol = 0; Decimal dTeoricoDol = 0; Decimal dRealSol = 0; Decimal dRealDol = 0; Decimal dDesembolsoSol = 0; Decimal dDesembolsoDol = 0; Decimal dTEAPendSol = 0; Decimal dTEARealSol = 0; Decimal dTEADesemSol = 0; Decimal dTEAPendDol = 0; Decimal dTEARealDol = 0; Decimal dTEADesemDol = 0; Decimal dPlazoPendSol = 0; Decimal dPlazoRealSol = 0; Decimal dPlazoDesemSol = 0; Decimal dPlazoPendDol = 0; Decimal dPlazoRealDol = 0; Decimal dPlazoDesemDol = 0; int countSol = 0; foreach (DataRow dr in ds.Tables[0].Rows) { dTeoricoSol += Convert.ToDecimal(dr["PendCob"].ToString()); dTEAPendSol += Convert.ToDecimal(dr["PendCobTasa"].ToString()); dRealSol += Convert.ToDecimal(dr["CobReal"].ToString()); dTEARealSol += Convert.ToDecimal(dr["CobRealTasa"].ToString()); dDesembolsoSol += Convert.ToDecimal(dr["nDesembolso"].ToString()); dTEADesemSol += Convert.ToDecimal(dr["nDesembolsoTasa"].ToString()); dPlazoPendSol += Convert.ToDecimal(dr["PendCobPlazo"].ToString()); dPlazoRealSol += Convert.ToDecimal(dr["CobRealPlazo"].ToString()); dPlazoDesemSol += Convert.ToDecimal(dr["nDesembolsoPlazo"].ToString()); countSol++; } int countDol = 0; foreach (DataRow dr in ds.Tables[1].Rows) { dTeoricoDol += Convert.ToDecimal(dr["PendCob"].ToString()); dTEAPendDol += Convert.ToDecimal(dr["PendCobTasa"].ToString()); dRealDol += Convert.ToDecimal(dr["CobReal"].ToString()); dTEARealDol += Convert.ToDecimal(dr["CobRealTasa"].ToString()); dDesembolsoDol += Convert.ToDecimal(dr["nDesembolso"].ToString()); dTEADesemDol += Convert.ToDecimal(dr["nDesembolsoTasa"].ToString()); dPlazoPendDol += Convert.ToDecimal(dr["PendCobPlazo"].ToString()); dPlazoRealDol += Convert.ToDecimal(dr["CobRealPlazo"].ToString()); dPlazoDesemDol += Convert.ToDecimal(dr["nDesembolsoPlazo"].ToString()); countDol++; } //Resumen en soles txtCobranzaTeorica.Text = Convert.ToDecimal(ds.Tables[2].Rows[0]["nTeorico"]).ToString("N2"); txtCobranzaEfectiva.Text = Convert.ToDecimal(ds.Tables[2].Rows[0]["nReal"]).ToString("N2"); txtDesembolsoRealizado.Text = Convert.ToDecimal(ds.Tables[2].Rows[0]["nDesembolso"]).ToString("N2"); //Consolidado en soles txtMetaEjecutivo.Text = Convert.ToDecimal(ds.Tables[3].Rows[0]["TotalMeta"]).ToString("N2"); txtColocadoEjecutivo.Text = Convert.ToDecimal(ds.Tables[3].Rows[0]["TotalnDesembolso"]).ToString("N2"); txtNroDocEjecutivo.Text = Convert.ToDecimal(ds.Tables[3].Rows[0]["NroDoc"]).ToString("N2"); txtDiferenciaEjecutivo.Text = Convert.ToDecimal(Convert.ToDecimal(txtMetaEjecutivo.Text) - Convert.ToDecimal(txtColocadoEjecutivo.Text)).ToString("N2"); txtMeta.Text = Convert.ToDecimal(ds.Tables[4].Rows[0]["TotalMeta"]).ToString("N2"); txtColocado.Text = Convert.ToDecimal(ds.Tables[4].Rows[0]["TotalnDesembolso"]).ToString("N2"); txtNroDoc.Text = Convert.ToDecimal(ds.Tables[4].Rows[0]["NroDoc"]).ToString("N2"); txtDiferencia.Text = Convert.ToDecimal(Convert.ToDecimal(txtMeta.Text) - Convert.ToDecimal(txtColocado.Text)).ToString("N2"); //Totales en soles y dolares txtPendCobroSol.Text = dTeoricoSol.ToString("N2"); txtCobrRealSol.Text = dRealSol.ToString("N2"); txtDesembolsoSol.Text = dDesembolsoSol.ToString("N2"); txtTEATeoricaSol.Text = dTEAPendSol == 0 ? "0.00" : (dTEAPendSol / countSol).ToString("N2"); txtTEAEfectivaSol.Text = dTEARealSol == 0 ? "0.00" : (dTEARealSol / countSol).ToString("N2"); txtTEARealizadoSol.Text = dTEADesemSol == 0 ? "0.00" : (dTEADesemSol / countSol).ToString("n2"); txtPendCobrDol.Text = dTeoricoDol.ToString("N2"); txtCobrRealDol.Text = dRealDol.ToString("N2"); txtDesembolsoDol.Text = dDesembolsoDol.ToString("N2"); txtTEATeoricaDol.Text = dTEAPendDol == 0 ? "0.00" : (dTEAPendDol / countDol).ToString("N2"); txtTEAEfectivaDol.Text = dTEARealDol == 0 ? "0.00" : (dTEARealDol / countDol).ToString("N2"); txtTEARealizadoDol.Text = dTEADesemDol == 0 ? "0.00" : (dTEADesemDol / countDol).ToString("N2"); txtPlazoTeoricaSol.Text = dPlazoPendSol == 0 ? "0.00" : (dPlazoPendSol / countSol).ToString("N0"); txtPlazoEfectivaSol.Text = dPlazoRealSol == 0 ? "0.00" : (dPlazoRealSol / countSol).ToString("N0"); txtPlazoRealizadoSol.Text = dPlazoDesemSol == 0 ? "0.00" : (dPlazoDesemSol / countSol).ToString("N0"); txtPlazoTeoricaDol.Text = dPlazoPendDol == 0 ? "0.00" : (dPlazoPendDol / countDol).ToString("N0"); txtPlazoEfectivaDol.Text = dPlazoRealDol == 0 ? "0.00" : (dPlazoRealDol / countDol).ToString("N0"); txtPlazoRealizadoDol.Text = dPlazoDesemDol == 0 ? "0.00" : (dPlazoDesemDol / countDol).ToString("N0"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }