Exemplo n.º 1
0
        void PintarDatos()
        {
            int    n_row    = 0;
            int    n_numdat = 0;
            string c_dato   = "";
            Color  o_color;

            Helper.Comunes.Convertir funCon = new Helper.Comunes.Convertir();

            for (n_row = 2; n_row <= FgDatos.Rows.Count - 1; n_row++)
            {
                n_numdat = Convert.ToInt32(FgDatos.GetData(n_row, 9));

                if (n_numdat == 0)
                {
                    funFlex.Flex_PintarCeldas(FgDatos, n_row, 2, n_row, 2, Color.Blue, Color.Transparent);
                }
                if (n_numdat == 1)
                {
                    funFlex.Flex_PintarCeldas(FgDatos, n_row, 2, n_row, 2, Color.Green, Color.Transparent);
                }
                if (n_numdat == 2)
                {
                    c_dato = funCon.DecimalEnHoras(Convert.ToDouble(FgDatos.GetData(n_row, 5)));
                    FgDatos.SetData(n_row, 5, c_dato);
                }
                if (n_numdat == 3)
                {
                    funFlex.Flex_PintarCeldas(FgDatos, n_row, 2, n_row, 2, Color.Green, Color.Transparent);
                }
            }
        }
Exemplo n.º 2
0
        void SumarColumnas3()
        {
            int n_col = 5;

            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
            FgDatos.SetData(FgDatos.Rows.Count - 1, 3, "T O T A L E S  ==>");
            for (n_col = 5; n_col <= FgDatos.Cols.Count - 1; n_col++)
            {
                double n_valor = funFlex.FlexSumarCol(FgDatos, n_col, 2, FgDatos.Rows.Count - 2);
                FgDatos.SetData(FgDatos.Rows.Count - 1, n_col, n_valor.ToString("0.00"));
            }
            funFlex.Flex_PintarCeldas(FgDatos, FgDatos.Rows.Count - 1, 1, FgDatos.Rows.Count - 1, FgDatos.Cols.Count - 1, Color.Black, Color.Coral);
            funFlex.Flex_PintarCeldas(FgDatos, 2, FgDatos.Cols.Count - 1, FgDatos.Rows.Count - 2, FgDatos.Cols.Count - 1, Color.Black, Color.DarkSeaGreen);
        }
Exemplo n.º 3
0
        void MostrarTotales()
        {
            double n_valor = 0;

            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
            FgDatos.SetData(FgDatos.Rows.Count - 1, 2, "TOTALES ==>");

            n_valor = funFlex.FlexSumarCol(FgDatos, 4, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 4, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 5, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 5, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 6, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 6, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 7, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 7, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 8, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 8, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 9, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 9, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 10, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 10, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 11, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 11, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 12, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 13, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 14, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 15, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_valor.ToString("0.00"));

            funFlex.Flex_PintarCeldas(FgDatos, FgDatos.Rows.Count - 1, 1, FgDatos.Rows.Count - 1, FgDatos.Cols.Count - 1, Color.Black, Color.PaleGreen);
            funFlex.Flex_PintarCeldas(FgDatos, 1, FgDatos.Cols.Count - 1, FgDatos.Rows.Count - 1, FgDatos.Cols.Count - 1, Color.Black, Color.Pink);
        }
Exemplo n.º 4
0
        void ResumenMostrarTotales()
        {
            double n_total1 = 0;
            double n_total2 = 0;
            double n_total3 = 0;

            n_total1 = funFlex.FlexSumarCol(FgDatos, 3, 3, FgDatos.Rows.Count - 1);
            n_total2 = funFlex.FlexSumarCol(FgDatos, 4, 3, FgDatos.Rows.Count - 1);
            n_total3 = funFlex.FlexSumarCol(FgDatos, 5, 3, FgDatos.Rows.Count - 1);

            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
            FgDatos.SetData(FgDatos.Rows.Count - 1, 2, "TOTAL ==>");
            funFlex.Flex_PintarCeldas(FgDatos, FgDatos.Rows.Count - 1, 2, FgDatos.Rows.Count - 1, 5, Color.Blue, Color.Transparent);

            FgDatos.SetData(FgDatos.Rows.Count - 1, 3, n_total1.ToString("0.00"));
            FgDatos.SetData(FgDatos.Rows.Count - 1, 4, n_total2.ToString("0.00"));
            FgDatos.SetData(FgDatos.Rows.Count - 1, 5, n_total3.ToString("0.00"));
        }
Exemplo n.º 5
0
        void MostrarDetalle(DataTable dtResultado)
        {
            int    n_row       = 0;
            int    n_filfle    = 0;
            string c_dato      = "";
            double n_saldo     = 0;
            int    n_newdoc    = 0;
            int    n_filini    = 0;
            int    n_filfin    = 0;
            double n_prototdeb = 0;
            double n_protothab = 0;
            double n_proimptot = 0;
            double n_prosal    = 0;

            double n_gratotdeb = 0;
            double n_gratothab = 0;
            double n_graimptot = 0;
            double n_grasal    = 0;

            for (n_row = 0; n_row <= dtResultado.Rows.Count - 1; n_row++)
            {
                FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
                n_filfle           = FgDatos.Rows.Count - 1;

                if (dtResultado.Rows[n_row]["n_ord"].ToString() == "0")
                {
                    if (n_row != 0)
                    {
                        n_filfin = FgDatos.Rows.Count - 2;
                        funFlex.Flex_PintarCeldas(FgDatos, n_filini, 1, n_filfin, 12, Color.Black, Color.Beige);

                        n_graimptot = n_graimptot + n_proimptot;
                        n_gratotdeb = n_gratotdeb + n_prototdeb;
                        n_gratothab = n_gratothab + n_protothab;
                        n_grasal    = n_grasal + n_prosal;

                        //FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
                        n_filfle = FgDatos.Rows.Count - 1;

                        FgDatos.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom; // = AllowMergingEnum.FixedOnly;
                        funFlex.Flex_UniColumnas(FgDatos, n_filfle, 1, 6, "TOTAL PROVEEDOOR ==>", 1);
                        funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 5, n_filfle, 7, Color.Blue, Color.White);

                        c_dato = n_proimptot.ToString("0.00");
                        FgDatos.SetData(n_filfle, 8, c_dato);
                        funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 8, n_filfle, 8, Color.Blue, Color.White);

                        c_dato = n_prototdeb.ToString("0.00");
                        FgDatos.SetData(n_filfle, 10, c_dato);
                        funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 10, n_filfle, 10, Color.Blue, Color.White);

                        c_dato = n_protothab.ToString("0.00");
                        FgDatos.SetData(n_filfle, 11, c_dato);
                        funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 11, n_filfle, 11, Color.Blue, Color.White);

                        c_dato = n_prosal.ToString("0.00");
                        FgDatos.SetData(n_filfle, 12, c_dato);
                        funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 12, n_filfle, 12, Color.Blue, Color.White);

                        FgDatos.Rows.Count = FgDatos.Rows.Count + 2;
                    }

                    //if (n_row == 0) { n_filini = FgDatos.Rows.Count - 1; }
                    n_filfle             = FgDatos.Rows.Count - 1;
                    FgDatos.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.RestrictAll; // = AllowMergingEnum.FixedOnly;
                    c_dato = dtResultado.Rows[n_row]["c_numruc"].ToString();


                    funFlex.Flex_UniColumnas(FgDatos, n_filfle, 1, 6, c_dato, 1);
                    funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 1, n_filfle, 6, Color.Blue, Color.White);
                    n_newdoc    = 0;
                    n_filini    = FgDatos.Rows.Count - 1;
                    n_prototdeb = 0;
                    n_protothab = 0;
                    n_proimptot = 0;
                    n_prosal    = 0;
                }
                if (dtResultado.Rows[n_row]["n_ord"].ToString() == "1")
                {
                    if (n_newdoc == 1)
                    {
                        // PINTAMOS DE BEIGE
                        n_filfin = FgDatos.Rows.Count - 2;
                        funFlex.Flex_PintarCeldas(FgDatos, n_filini, 1, n_filfin, 12, Color.Black, Color.Beige);

                        // PINTAMOS DE BLANCO LA ULTIMA FILA
                        funFlex.Flex_PintarCeldas(FgDatos, FgDatos.Rows.Count - 1, 1, FgDatos.Rows.Count - 1, 12, Color.Blue, Color.White);

                        FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
                        n_filini           = FgDatos.Rows.Count - 1;
                        n_filfle           = FgDatos.Rows.Count - 1;
                    }

                    //FgDatos.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.None;
                    c_dato = dtResultado.Rows[n_row]["c_numreg"].ToString();
                    FgDatos.SetData(n_filfle, 1, c_dato);
                    c_dato = dtResultado.Rows[n_row]["c_deslib"].ToString();
                    FgDatos.SetData(n_filfle, 2, c_dato);
                    c_dato = dtResultado.Rows[n_row]["c_abr"].ToString();
                    FgDatos.SetData(n_filfle, 3, c_dato);
                    c_dato = dtResultado.Rows[n_row]["c_numdoc"].ToString();
                    FgDatos.SetData(n_filfle, 4, c_dato);
                    c_dato = dtResultado.Rows[n_row]["d_fchdoc"].ToString();
                    FgDatos.SetData(n_filfle, 5, c_dato);
                    c_dato = dtResultado.Rows[n_row]["d_fchven"].ToString();
                    FgDatos.SetData(n_filfle, 6, c_dato);
                    c_dato = dtResultado.Rows[n_row]["c_mondes"].ToString();
                    FgDatos.SetData(n_filfle, 7, c_dato);
                    c_dato = Convert.ToDouble(dtResultado.Rows[n_row]["n_imptotcom"]).ToString("0.00");
                    FgDatos.SetData(n_filfle, 8, c_dato);
                    c_dato = Convert.ToDouble(dtResultado.Rows[n_row]["n_tc"]).ToString("0.000");
                    FgDatos.SetData(n_filfle, 9, c_dato);
                    c_dato = Convert.ToDouble(dtResultado.Rows[n_row]["n_debe"]).ToString("0.00");
                    FgDatos.SetData(n_filfle, 10, c_dato);
                    c_dato = Convert.ToDouble(dtResultado.Rows[n_row]["n_haber"]).ToString("0.00");
                    FgDatos.SetData(n_filfle, 11, c_dato);
                    c_dato = Convert.ToDouble(dtResultado.Rows[n_row]["n_saldo"]).ToString("0.00");
                    FgDatos.SetData(n_filfle, 12, c_dato);

                    n_saldo = Convert.ToDouble(dtResultado.Rows[n_row]["n_saldo"]);

                    n_proimptot = n_proimptot + Convert.ToDouble(dtResultado.Rows[n_row]["n_imptotcom"]);
                    n_prototdeb = n_prototdeb + Convert.ToDouble(dtResultado.Rows[n_row]["n_debe"]);
                    n_protothab = n_protothab + Convert.ToDouble(dtResultado.Rows[n_row]["n_haber"]);
                    n_prosal    = n_prosal + Convert.ToDouble(dtResultado.Rows[n_row]["n_saldo"]);

                    if (n_newdoc == 0)
                    {
                        n_filini = FgDatos.Rows.Count - 1;
                        n_newdoc = 1;
                    }
                }
                if (dtResultado.Rows[n_row]["n_ord"].ToString() == "2")
                {
                    //FgDatos.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.None;
                    c_dato = dtResultado.Rows[n_row]["c_numreg"].ToString();
                    FgDatos.SetData(n_filfle, 1, c_dato);
                    c_dato = dtResultado.Rows[n_row]["c_deslib"].ToString();
                    FgDatos.SetData(n_filfle, 2, c_dato);
                    c_dato = dtResultado.Rows[n_row]["c_abr"].ToString();
                    FgDatos.SetData(n_filfle, 3, c_dato);
                    c_dato = dtResultado.Rows[n_row]["c_numdoc"].ToString();
                    FgDatos.SetData(n_filfle, 4, c_dato);
                    c_dato = dtResultado.Rows[n_row]["d_fchdoc"].ToString();
                    FgDatos.SetData(n_filfle, 5, c_dato);
                    c_dato = dtResultado.Rows[n_row]["d_fchven"].ToString();
                    FgDatos.SetData(n_filfle, 6, c_dato);
                    c_dato = dtResultado.Rows[n_row]["c_mondes"].ToString();
                    FgDatos.SetData(n_filfle, 7, c_dato);
                    c_dato = Convert.ToDouble(dtResultado.Rows[n_row]["n_imptotcom"]).ToString("0.00");
                    FgDatos.SetData(n_filfle, 8, c_dato);
                    c_dato = Convert.ToDouble(dtResultado.Rows[n_row]["n_tc"]).ToString("0.000");
                    FgDatos.SetData(n_filfle, 9, c_dato);
                    c_dato = Convert.ToDouble(dtResultado.Rows[n_row]["n_debe"]).ToString("0.00");
                    FgDatos.SetData(n_filfle, 10, c_dato);
                    c_dato = Convert.ToDouble(dtResultado.Rows[n_row]["n_haber"]).ToString("0.00");
                    FgDatos.SetData(n_filfle, 11, c_dato);
                    n_saldo = (n_saldo - Convert.ToDouble(dtResultado.Rows[n_row]["n_debe"]));
                    c_dato  = n_saldo.ToString("0.00");
                    FgDatos.SetData(n_filfle, 12, c_dato);

                    //n_proimptot = 0;
                    n_prototdeb = n_prototdeb + Convert.ToDouble(dtResultado.Rows[n_row]["n_debe"]);
                    n_protothab = n_protothab + Convert.ToDouble(dtResultado.Rows[n_row]["n_haber"]);
                    n_prosal    = n_prosal - Convert.ToDouble(dtResultado.Rows[n_row]["n_debe"]);
                }
            }

            n_filfin = FgDatos.Rows.Count - 1;
            funFlex.Flex_PintarCeldas(FgDatos, n_filini, 1, n_filfin, 12, Color.Black, Color.Beige);

            n_graimptot = n_graimptot + n_proimptot;
            n_gratotdeb = n_gratotdeb + n_prototdeb;
            n_gratothab = n_gratothab + n_protothab;
            n_grasal    = n_grasal + n_prosal;

            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
            n_filfle           = FgDatos.Rows.Count - 1;

            //FgDatos.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Free;
            funFlex.Flex_UniColumnas(FgDatos, n_filfle, 5, 7, "TOTAL PROVEEDOOR ==>", 1);
            funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 5, n_filfle, 7, Color.Blue, Color.White);

            c_dato = n_proimptot.ToString("0.00");
            FgDatos.SetData(n_filfle, 8, c_dato);
            funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 8, n_filfle, 8, Color.Blue, Color.White);

            c_dato = n_prototdeb.ToString("0.00");
            FgDatos.SetData(n_filfle, 10, c_dato);
            funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 10, n_filfle, 10, Color.Blue, Color.White);

            c_dato = n_protothab.ToString("0.00");
            FgDatos.SetData(n_filfle, 11, c_dato);
            funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 11, n_filfle, 11, Color.Blue, Color.White);

            c_dato = n_prosal.ToString("0.00");
            FgDatos.SetData(n_filfle, 12, c_dato);
            funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 12, n_filfle, 12, Color.Blue, Color.White);



            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
            n_filfle           = FgDatos.Rows.Count - 1;

            funFlex.Flex_UniColumnas(FgDatos, n_filfle, 5, 7, "TOTAL ==>", 1);
            funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 5, n_filfle, 7, Color.Blue, Color.White);

            c_dato = n_graimptot.ToString("0.00");
            FgDatos.SetData(n_filfle, 8, c_dato);
            funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 8, n_filfle, 8, Color.Blue, Color.White);

            c_dato = n_gratotdeb.ToString("0.00");
            FgDatos.SetData(n_filfle, 10, c_dato);
            funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 10, n_filfle, 10, Color.Blue, Color.White);

            c_dato = n_gratothab.ToString("0.00");
            FgDatos.SetData(n_filfle, 11, c_dato);
            funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 11, n_filfle, 11, Color.Blue, Color.White);

            c_dato = n_grasal.ToString("0.00");
            FgDatos.SetData(n_filfle, 12, c_dato);
            funFlex.Flex_PintarCeldas(FgDatos, n_filfle, 12, n_filfle, 12, Color.Blue, Color.White);

            //n_filfin = FgDatos.Rows.Count - 1;
            //funFlex.Flex_PintarCeldas(FgDatos, n_filini, 1, n_filfin, 12, Color.Black, Color.Beige);
        }
Exemplo n.º 6
0
        void AgruparResultado()
        {
            int    n_fil       = 0;
            double n_val       = 0;
            int    n_filalt    = 0;
            string c_dato      = "";
            double n_pro       = 0;
            int    n_filcolor1 = 0;
            int    n_filcolor2 = 0;
            int    n_color     = 1;
            double n_total     = 0;
            double n_valor1    = 0;
            double n_valor2    = 0;

            for (n_fil = 3; n_fil <= FgDatos.Rows.Count - 1; n_fil++)
            {
                n_val = Convert.ToDouble(FgDatos.GetData(n_fil, 13));

                if (n_val == 99999)
                {
                    c_dato = "";
                }
                n_filalt = FgDatos.Rows[n_fil].Height;
                c_dato   = FgDatos.GetData(n_fil, 2).ToString();

                if (n_val == 0)
                {
                    funFlex.Flex_PintarCeldas(FgDatos, n_fil, 1, n_fil, 12, Color.Blue, Color.Transparent);
                }
                else
                {
                    if (n_pro != 0)
                    {
                        if (n_val == 99999)
                        {
                            funFlex.Flex_PintarCeldas(FgDatos, n_fil, 1, n_fil, 12, Color.Blue, Color.Transparent);
                        }
                        else
                        {
                            if (n_val != n_pro)
                            {
                                if (n_color == 1)
                                {
                                    funFlex.Flex_PintarCeldas(FgDatos, n_filcolor1, 1, n_filcolor2, 12, Color.Black, Color.Beige); n_color = 2;
                                }
                                else
                                {
                                    funFlex.Flex_PintarCeldas(FgDatos, n_filcolor1, 1, n_filcolor2, 12, Color.Black, Color.White); n_color = 1;
                                }

                                n_pro       = n_val;
                                n_filcolor1 = n_fil;
                                n_filcolor2 = n_fil;
                                n_total     = Convert.ToDouble(FgDatos.GetData(n_fil, 12));
                            }
                            else
                            {
                                n_filcolor2 = n_filcolor2 + 1;
                                n_valor1    = Convert.ToDouble(FgDatos.GetData(n_fil, 10));
                                n_valor2    = Convert.ToDouble(FgDatos.GetData(n_fil, 11));
                                n_total     = ((n_total - n_valor1) + n_valor2);
                                FgDatos.SetData(n_fil, 12, n_total.ToString("0.00"));
                            }
                        }
                    }
                    else
                    {
                        n_pro       = n_val;
                        n_filcolor1 = n_fil;
                        n_filcolor2 = n_fil;
                        n_total     = Convert.ToDouble(FgDatos.GetData(n_fil, 12));
                    }
                }
            }

            if (n_color == 1)
            {
                funFlex.Flex_PintarCeldas(FgDatos, n_filcolor1, 1, n_filcolor2, 12, Color.Black, Color.Beige); n_color = 2;
            }
            else
            {
                funFlex.Flex_PintarCeldas(FgDatos, n_filcolor1, 1, n_filcolor2, 12, Color.Black, Color.White); n_color = 1;
            }
        }
Exemplo n.º 7
0
        void SumarColumnas()
        {
            double n_tot1  = 0;
            double n_tot2  = 0;
            double n_tot3  = 0;
            double n_tot4  = 0;
            double n_tot5  = 0;
            double n_tot6  = 0;
            double n_tot7  = 0;
            double n_tot8  = 0;
            double n_tot9  = 0;
            double n_tot10 = 0;
            double n_tot11 = 0;
            double n_tot12 = 0;
            int    n_row   = 0;

            if (n_Libro == 8)
            {
                for (n_row = 3; n_row <= FgDatos.Rows.Count - 1; n_row++)
                {
                    if (FgDatos.GetData(n_row, 12).ToString() == "07")
                    {
                        n_tot1  = n_tot1 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 12)));
                        n_tot2  = n_tot2 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 13)));
                        n_tot3  = n_tot3 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 14)));
                        n_tot4  = n_tot4 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 15)));
                        n_tot5  = n_tot5 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 16)));
                        n_tot6  = n_tot6 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 17)));
                        n_tot7  = n_tot7 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 18)));
                        n_tot8  = n_tot8 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 19)));
                        n_tot9  = n_tot9 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 20)));
                        n_tot10 = n_tot10 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 21)));
                        n_tot11 = n_tot11 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 22)));
                        n_tot12 = n_tot12 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 23)));
                    }
                    else
                    {
                        n_tot1  = n_tot1 + Convert.ToDouble(FgDatos.GetData(n_row, 12));
                        n_tot2  = n_tot2 + Convert.ToDouble(FgDatos.GetData(n_row, 13));
                        n_tot3  = n_tot3 + Convert.ToDouble(FgDatos.GetData(n_row, 14));
                        n_tot4  = n_tot4 + Convert.ToDouble(FgDatos.GetData(n_row, 15));
                        n_tot5  = n_tot5 + Convert.ToDouble(FgDatos.GetData(n_row, 16));
                        n_tot6  = n_tot6 + Convert.ToDouble(FgDatos.GetData(n_row, 17));
                        n_tot7  = n_tot7 + Convert.ToDouble(FgDatos.GetData(n_row, 18));
                        n_tot8  = n_tot8 + Convert.ToDouble(FgDatos.GetData(n_row, 19));
                        n_tot9  = n_tot9 + Convert.ToDouble(FgDatos.GetData(n_row, 20));
                        n_tot10 = n_tot10 + Convert.ToDouble(FgDatos.GetData(n_row, 21));
                        n_tot11 = n_tot11 + Convert.ToDouble(FgDatos.GetData(n_row, 22));
                        n_tot12 = n_tot12 + Convert.ToDouble(FgDatos.GetData(n_row, 23));
                    }
                }

                FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
                FgDatos.SetData(FgDatos.Rows.Count - 1, 9, "TOTAL ==>");

                FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_tot1.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_tot2.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_tot3.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_tot4.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 16, n_tot5.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 17, n_tot6.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 18, n_tot7.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 19, n_tot8.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 20, n_tot9.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 21, n_tot10.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 22, n_tot11.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 23, n_tot12.ToString("0.00"));
            }

            if (n_Libro == 32)
            {
                n_tot1 = funFlex.FlexSumarCol(FgDatos, 12, 3, FgDatos.Rows.Count - 1);
                n_tot2 = funFlex.FlexSumarCol(FgDatos, 13, 3, FgDatos.Rows.Count - 1);
                n_tot3 = funFlex.FlexSumarCol(FgDatos, 14, 3, FgDatos.Rows.Count - 1);
                n_tot4 = funFlex.FlexSumarCol(FgDatos, 15, 3, FgDatos.Rows.Count - 1);

                FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
                FgDatos.SetData(FgDatos.Rows.Count - 1, 9, "TOTAL ==>");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_tot1.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_tot2.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_tot3.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_tot4.ToString("0.00"));
            }

            if (n_Libro == 14)
            {
                for (n_row = 3; n_row <= FgDatos.Rows.Count - 1; n_row++)
                {
                    if (FgDatos.GetData(n_row, 4).ToString() == "07")
                    {
                        n_tot1 = n_tot1 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 12)));
                        n_tot2 = n_tot2 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 13)));
                        n_tot3 = n_tot3 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 14)));
                        n_tot4 = n_tot4 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 15)));
                        n_tot5 = n_tot5 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 16)));
                        n_tot6 = n_tot6 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 18)));
                        n_tot7 = n_tot7 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 19)));
                        n_tot8 = n_tot8 + funFunciones.PostivoNegativo(Convert.ToDouble(FgDatos.GetData(n_row, 20)));
                    }
                    else
                    {
                        n_tot1 = n_tot1 + Convert.ToDouble(FgDatos.GetData(n_row, 12));
                        n_tot2 = n_tot2 + Convert.ToDouble(FgDatos.GetData(n_row, 13));
                        n_tot3 = n_tot3 + Convert.ToDouble(FgDatos.GetData(n_row, 14));
                        n_tot4 = n_tot4 + Convert.ToDouble(FgDatos.GetData(n_row, 15));
                        n_tot5 = n_tot5 + Convert.ToDouble(FgDatos.GetData(n_row, 16));
                        n_tot6 = n_tot6 + Convert.ToDouble(FgDatos.GetData(n_row, 18));
                        n_tot7 = n_tot7 + Convert.ToDouble(FgDatos.GetData(n_row, 19));
                        n_tot8 = n_tot8 + Convert.ToDouble(FgDatos.GetData(n_row, 20));
                    }
                }

                FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
                FgDatos.SetData(FgDatos.Rows.Count - 1, 9, "TOTAL ==>");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_tot1.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_tot2.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_tot3.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_tot4.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 16, n_tot5.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 18, n_tot6.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 19, n_tot7.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 20, n_tot8.ToString("0.00"));
            }
        }
Exemplo n.º 8
0
        void Totalizar()
        {
            double n_valor = 0;

            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;

            FgDatos.SetData(FgDatos.Rows.Count - 1, 2, "T O T A L E S ==>");

            n_valor = funFlex.FlexSumarCol(FgDatos, 3, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 3, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 4, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 4, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 5, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 5, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 6, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 6, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 7, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 7, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 8, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 8, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 9, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 9, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 10, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 10, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 11, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 11, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 12, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 13, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 14, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 15, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 16, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 16, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 17, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 17, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 18, 2, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 18, n_valor.ToString("0.00"));

            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
            FgDatos.SetData(FgDatos.Rows.Count - 1, 2, "R E S U L T A D O S ==>");

            // SUMAS DEL SALDO
            double n_val1 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 9));
            double n_val2 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 10));
            double n_resu = (n_val1 - n_val2);

            if (n_resu < 0)
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 9, n_resu.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 10, "0.00");
            }
            else
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 9, "0.00");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 10, n_resu.ToString("0.00"));
            }

            // SUMAS CUENTA DEL BALANCE
            n_val1 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 11));
            n_val2 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 12));
            n_resu = (n_val1 - n_val2);
            if (n_resu < 0)
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 11, n_resu.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 12, "0.00");
            }
            else
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 11, "0.00");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_resu.ToString("0.00"));
            }

            // SUMAS CUENTA TRANSFERENCIA Y CANC
            n_val1 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 13));
            n_val2 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 14));
            n_resu = (n_val1 - n_val2);
            if (n_resu < 0)
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_resu.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 14, "0.00");
            }
            else
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 13, "0.00");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_resu.ToString("0.00"));
            }

            // SUMAS CUENTA RESULTADOS POR NATURALEZA
            n_val1 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 15));
            n_val2 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 16));
            n_resu = (n_val1 - n_val2);
            if (n_resu < 0)
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_resu.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 16, "0.00");
            }
            else
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 15, "0.00");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 16, n_resu.ToString("0.00"));
            }

            // SUMAS CUENTA RESULTADOS POR FUNCION
            n_val1 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 17));
            n_val2 = Convert.ToDouble(FgDatos.GetData(FgDatos.Rows.Count - 2, 18));
            n_resu = (n_val1 - n_val2);
            if (n_resu < 0)
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 17, n_resu.ToString("0.00"));
                FgDatos.SetData(FgDatos.Rows.Count - 1, 18, "0.00");
            }
            else
            {
                FgDatos.SetData(FgDatos.Rows.Count - 1, 17, "0.00");
                FgDatos.SetData(FgDatos.Rows.Count - 1, 18, n_resu.ToString("0.00"));
            }


            FgDatos.Rows.Count = FgDatos.Rows.Count + 1;
            FgDatos.SetData(FgDatos.Rows.Count - 1, 2, "S U M A S   I G U A L E S ==>");

            n_valor = funFlex.FlexSumarCol(FgDatos, 9, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 9, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 10, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 10, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 11, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 11, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 12, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 12, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 13, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 13, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 14, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 14, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 15, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 15, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 16, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 16, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 17, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 17, n_valor.ToString("0.00"));

            n_valor = funFlex.FlexSumarCol(FgDatos, 18, FgDatos.Rows.Count - 3, FgDatos.Rows.Count - 2);
            FgDatos.SetData(FgDatos.Rows.Count - 1, 18, n_valor.ToString("0.00"));

            funFlex.Flex_PintarCeldas(FgDatos, FgDatos.Rows.Count - 3, 1, FgDatos.Rows.Count - 1, 18, Color.Black, Color.LightCoral);
        }