void MostrarDatos() { int n_row = 0; string c_dato = ""; double n_valor = 0; double n_horini = 0; double n_horfin = 0; LblApeNom.Text = c_apenomtra; LblNumDoc.Text = c_numdoc; LblFchTra.Text = c_fchtra; FgLisPer.Rows.Count = 2; if (dtTareas.Rows.Count != 0) { for (n_row = 0; n_row <= dtTareas.Rows.Count - 1; n_row++) { FgLisPer.Rows.Count = FgLisPer.Rows.Count + 1; c_dato = dtTareas.Rows[n_row]["c_des"].ToString(); FgLisPer.SetData(FgLisPer.Rows.Count - 1, 1, c_dato); n_valor = Convert.ToDouble(funFunciones.NulosN(dtTareas.Rows[n_row]["n_can"])); FgLisPer.SetData(FgLisPer.Rows.Count - 1, 2, n_valor.ToString("0.00")); c_dato = dtTareas.Rows[n_row]["c_horini"].ToString(); FgLisPer.SetData(FgLisPer.Rows.Count - 1, 3, c_dato); c_dato = dtTareas.Rows[n_row]["c_horter"].ToString(); FgLisPer.SetData(FgLisPer.Rows.Count - 1, 4, c_dato); n_horini = funCon.HoraEnDecimal(dtTareas.Rows[n_row]["c_horini"].ToString() + ":00"); n_horfin = funCon.HoraEnDecimal(dtTareas.Rows[n_row]["c_horter"].ToString() + ":00"); n_valor = n_horfin - n_horini; c_dato = funCon.DecimalEnHoras(n_valor); FgLisPer.SetData(FgLisPer.Rows.Count - 1, 5, c_dato); n_valor = Convert.ToDouble(funFunciones.NulosN(dtTareas.Rows[n_row]["n_pretar"])); FgLisPer.SetData(FgLisPer.Rows.Count - 1, 6, n_valor); n_valor = Convert.ToDouble(funFunciones.NulosN(dtTareas.Rows[n_row]["n_imptot"])); FgLisPer.SetData(FgLisPer.Rows.Count - 1, 7, n_valor); } } //LblTot1.Text = funFlex.FlexSumarCol(FgLisPer, 6, 2, FgLisPer.Rows.Count - 1).ToString("0.00"); LblTot2.Text = funFlex.FlexSumarCol(FgLisPer, 7, 2, FgLisPer.Rows.Count - 1).ToString("0.00"); }
void MostrarMarcaciones(DataTable dtMarcaciones) { int n_row = 0; FgLisPer.Rows.Count = 2; for (n_row = 0; n_row <= dtMarcaciones.Rows.Count - 1; n_row++) { FgLisPer.Rows.Count = FgLisPer.Rows.Count + 1; FgLisPer.SetData(FgLisPer.Rows.Count - 1, 1, dtMarcaciones.Rows[n_row]["c_codemp"].ToString()); FgLisPer.SetData(FgLisPer.Rows.Count - 1, 2, dtMarcaciones.Rows[n_row]["d_fchmar"].ToString()); FgLisPer.SetData(FgLisPer.Rows.Count - 1, 3, dtMarcaciones.Rows[n_row]["c_hormar"].ToString()); } }
void MostrarPago(DataTable dtPagos) { double n_total = 0; int n_row = 0; int n_fil = 2; string c_dato = ""; int n_col = 0; int n_numdias = Convert.ToInt32((Convert.ToDateTime(TxtFchFin.Text) - Convert.ToDateTime(TxtFchIni.Text)).ToString(@"dd")); n_numdias = n_numdias + 1; DateTime d_fecha = Convert.ToDateTime(TxtFchIni.Text); FgLisPer.Cols.Count = 5; for (n_col = 1; n_col <= n_numdias; n_col++) { FgLisPer.Cols.Count = FgLisPer.Cols.Count + 1; FgLisPer.Cols[FgLisPer.Cols.Count - 1].DataType = typeof(Double); FgLisPer.Cols[FgLisPer.Cols.Count - 1].Format = "0.00"; FgLisPer.Cols[FgLisPer.Cols.Count - 1].Width = 70; c_dato = d_fecha.ToString("yyy-MM-dd"); FgLisPer.SetData(0, FgLisPer.Cols.Count - 1, "Dia " + n_col.ToString()); FgLisPer.SetData(1, FgLisPer.Cols.Count - 1, c_dato); d_fecha = d_fecha.AddDays(1); } //MOSTRAMOS EL IMPORTE A PAGAR for (n_row = 0; n_row <= dtPagos.Rows.Count - 1; n_row++) { FgLisPer.Rows.Count = FgLisPer.Rows.Count + 1; c_dato = dtPagos.Rows[n_row]["n_idper"].ToString(); FgLisPer.SetData(n_fil, 1, c_dato); c_dato = (n_fil - 1).ToString(); FgLisPer.SetData(n_fil, 2, c_dato); c_dato = dtPagos.Rows[n_row]["c_numdocide"].ToString(); FgLisPer.SetData(n_fil, 3, c_dato); c_dato = dtPagos.Rows[n_row]["c_apenom"].ToString(); FgLisPer.SetData(n_fil, 4, c_dato); int n_col2 = 5; for (n_col2 = 5; n_col2 <= FgLisPer.Cols.Count - 1; n_col2++) { c_dato = FgLisPer.GetData(1, n_col2).ToString(); if (ExisteColumna(c_dato, dtPagos) == true) { c_dato = Convert.ToDouble(funFunciones.NulosN(dtPagos.Rows[n_row][c_dato])).ToString("0.00"); FgLisPer.SetData(n_fil, n_col2, c_dato); } } n_fil = n_fil + 1; } FgLisPer.Cols.Count = FgLisPer.Cols.Count + 1; FgLisPer.Cols[FgLisPer.Cols.Count - 1].DataType = typeof(Double); FgLisPer.Cols[FgLisPer.Cols.Count - 1].Format = "0.00"; funFlex.Flex_FixUnirFilas(FgLisPer, FgLisPer.Cols.Count - 1, 0, 1, "Total", 70); for (n_row = 2; n_row <= FgLisPer.Rows.Count - 1; n_row++) { n_total = 0; n_total = funFlex.FlexSumarRow(FgLisPer, n_row, 5, FgLisPer.Cols.Count - 2); FgLisPer.SetData(n_row, FgLisPer.Cols.Count - 1, n_total.ToString("0.00")); } n_total = funFlex.FlexSumarCol(FgLisPer, FgLisPer.Cols.Count - 1, 2, FgLisPer.Rows.Count - 1); FgLisPer.Rows.Count = FgLisPer.Rows.Count + 1; FgLisPer.SetData(FgLisPer.Rows.Count - 1, FgLisPer.Cols.Count - 2, "TOTAL ==>"); FgLisPer.SetData(FgLisPer.Rows.Count - 1, FgLisPer.Cols.Count - 1, n_total.ToString("0.00")); FgLisPer.AllowSorting = C1.Win.C1FlexGrid.AllowSortingEnum.SingleColumn; }