예제 #1
0
        private void FgDato_CellChanged(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
        {
            if (b_cargado == true)
            {
                return;
            }
            if ((FgDato.Col >= 2) && (FgDato.Col <= 16))
            {
                double n_valor = funFlex.FlexSumarRow(FgDato, 2, 2, 13);
                FgDato.SetData(2, 14, n_valor.ToString("0.00"));
            }

            FgDato.Select(e.Row - 1, e.Col + 1);
        }
예제 #2
0
        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;
        }