コード例 #1
0
        public Tabla GetTableName(String name)
        {
            GetTableInsert(name);
            Tabla t = TableList.ElementAt(InsertTable);

            return(t);
        }
コード例 #2
0
        public void Multi_Elimination(List <Conditions> l, int contador)
        {
            Tabla temp_table = GetTableName(name_delete);

            if (contador > 0)
            {
            }
            else//NO HAY OR'S
            {
                if (l.Count == 1)
                {
                    int temp = Verify_Conditions(l.Count(), l, temp_table);
                    if (temp > 0)
                    {
                        Delete_Row(position_D, temp_table);
                        position_D = 0;
                    }
                }
                else
                {
                    int temp = Verify_Conditions(l.Count(), l, temp_table);

                    if (temp == l.Count())
                    {
                        Delete_Row(position_D, temp_table);//call's a delete Row method
                        position_D = 0;
                    }
                    else
                    {
                        Console.WriteLine("No cumplio todas las Y");
                    }
                }
            }
        }
コード例 #3
0
        public String tx(Tabla t)
        {
            String Content = "";

            try
            {
                Tabla        temp     = t;
                Entity_Table columnas = temp.getList().ElementAt(0);
                ArrayList    lis      = columnas.getDataArray();

                String Values_list;
                for (int lis_index = 0; lis_index < lis.Count; lis_index++)
                {
                    Values_list = "";
                    for (int col_index = 0; col_index < temp.getList().Count; col_index++)
                    {
                        Entity_Table Entity_temp = temp.getList().ElementAt(col_index);
                        ArrayList    ls          = Entity_temp.getDataArray();
                        Values_list += "<td>" + ls[lis_index] + "</td>";


                        // Console.WriteLine(ls[lis_index]);
                    }
                    Content += "<tr>" + Values_list + "</tr>";
                }
            }
            catch (NullReferenceException)
            {
                Console.WriteLine("entro al null");
            }
            return(Content);
        }
コード例 #4
0
 public void insert_In_Table(int value, int column_value, String valueD)
 {
     if (Flag_Success != false)
     {
         try
         {
             Tabla        t_insert = TableList.ElementAt(value);
             Entity_Table tb       = t_insert.getList().ElementAt(column_value);
             if (tb.getDataArray() == null)
             {
                 ArrayList ColumnData = new ArrayList();
                 ColumnData.Add(valueD);
                 tb.setDataArray(ColumnData);
             }
             else
             {
                 ArrayList Column_Data = tb.getDataArray();
                 Column_Data.Add(valueD);
                 tb.setDataArray(Column_Data);
             }
         }
         catch (ArgumentNullException)
         {
             Console.WriteLine("No se encontro la tabla a insertar");
         }
     }
 }
コード例 #5
0
        public void Multi_Elimination(List <Conditions> l, int contador)
        {
            Tabla temp_table = GetTableName(name_delete);

            if (condit.Count != 0)
            {
                if (contador > 0)
                {
                    int contador_grupo = 0;
                    Console.WriteLine("ENTROOOOOO");
                    int v = 0;
                    while (v < contador)
                    {
                        for (int j = 0; j < l.Count; j++)
                        {
                            Conditions c_temp       = l.ElementAt(v);
                            Conditions c_temp2      = l.ElementAt(j);
                            int        group        = c_temp.getGroup();
                            int        grupo_actual = c_temp2.getGroup();
                            if (grupo_actual >= group)
                            {
                                //positions.Clear();
                                int temp = Verify_Conditions(v, j, l, temp_table);
                                contador_grupo += temp;
                                Console.WriteLine("EL GRUPO VALUADO ES" + temp);

                                List <Entity_Table> lists = temp_table.getList();
                                if (temp != 0)
                                {
                                    Delete_rows(lists);
                                    positions.Clear();
                                }

                                v++;
                            }
                        }
                    }
                }
                else//NO HAY OR'S
                {
                    int temp = Verify_Conditions(0, l.Count(), l, temp_table);

                    if (temp == condit.Count)
                    {
                        List <Entity_Table> lists = temp_table.getList();
                        Delete_rows(lists);
                        positions.Clear();
                    }
                    else
                    {
                        Console.WriteLine("No cumplio todas las Y");
                        positions.Clear();
                    }
                }
            }
            else
            {
                //NADA
            }
        }
コード例 #6
0
        public void Delete_Row(int D_positions, Tabla tmp_t)
        {
            List <Entity_Table> tb = tmp_t.getList();

            for (int i = 0; i < tb.Count; i++)
            {
                Entity_Table entity = tb.ElementAt(i);
                ArrayList    a_temp = entity.getDataArray();
                a_temp[D_positions] = null;
            }
        }
コード例 #7
0
 /*ELIMINATION METHDOS*/
 public void Single_Elimination(String name)
 {
     if (Flag_Success == true)
     {
         GetTableInsert(name);
         Tabla t = TableList.ElementAt(InsertTable);
         for (int i = 0; i < t.getList().Count; i++)
         {
             Entity_Table entity_temp = t.getList().ElementAt(i);
             entity_temp.setDataArray(null);
         }
     }
 }
コード例 #8
0
        /*INSERT DATA IN TABLES METHODS*/

        public void GetTableInsert(String tableName)
        {
            if (Flag_Success == true)
            {
                for (int i = 0; i < TableList.Count; i++)
                {
                    Tabla t = TableList.ElementAt(i);
                    if (t.getName().ToUpper() == tableName.ToUpper())
                    {
                        InsertTable = i;
                        break;
                    }
                }
            }
        }
コード例 #9
0
        /*CONDICIONCNOES*/

        public int Verify_Conditions(int ind, int counter, List <Conditions> c, Tabla temp_table)
        {
            int   temp_counter = 0;
            bool  Succes       = false;
            Tabla temp         = temp_table;

            BackUp = temp;

            if (temp != null)
            {
                for (int index = ind; index < counter; index++)
                {
                    Conditions c_temp = c.ElementAt(index);
                    Console.WriteLine("se envia" + c_temp.getValue());
                    String identificador   = c_temp.getId();
                    int    Condicion_valor = c_temp.getCondition();
                    String temp_value      = c_temp.getValue();
                    if (Condicion_valor == 12)
                    {
                        temp_counter = Verify_Sub_Conditions_mMi(identificador, Condicion_valor, temp_value, temp, temp_counter);
                    }
                    else if (Condicion_valor == 10)//MENOR
                    {
                        temp_counter = Verify_Sub_Conditions_mMi(identificador, Condicion_valor, temp_value, temp, temp_counter);
                    }
                    else if (Condicion_valor == 11)//MAYOR
                    {
                        temp_counter = Verify_Sub_Conditions_mMi(identificador, Condicion_valor, temp_value, temp, temp_counter);
                    }
                    else if (Condicion_valor == 13)
                    {
                        temp_counter = Verify_Sub_Conditions_mMi(identificador, Condicion_valor, temp_value, temp, temp_counter);
                    }
                    else if (Condicion_valor == 14)
                    {
                        temp_counter = Verify_Sub_Conditions_mMi(identificador, Condicion_valor, temp_value, temp, temp_counter);
                    }
                    else if (Condicion_valor == 15)
                    {
                        temp_counter = Verify_Sub_Conditions_mMi(identificador, Condicion_valor, temp_value, temp, temp_counter);
                    }
                }
            }
            return(temp_counter);
        }
コード例 #10
0
        public int Verify_Conditions(int counter, List <Conditions> c, Tabla temp_table)
        {
            int   temp_counter = 0;
            bool  Succes       = false;
            Tabla temp         = temp_table;

            BackUp = temp;

            if (temp != null)
            {
                for (int i = 0; i < counter; i++)
                {
                    Conditions c_temp = c.ElementAt(i);
                    Console.WriteLine("se envia" + c_temp.getValue());
                    String identificador   = c_temp.getId();
                    int    Condicion_valor = c_temp.getCondition();
                    String temp_value      = c_temp.getValue();
                    if (Condicion_valor == 12)
                    {/*case "MENOR":
                      * return 10;
                      * case "MAYOR":
                      * return 11;
                      * case "IGUAL":
                      * return 12;
                      * case "MAYOR IGUAL":
                      * return 13;
                      * case "MENOR IGUAL":
                      * return 14;
                      * case "DISTINTO":
                      * return 15;*/
                        Succes = Verify_Sub_Conditions_Equals(identificador, Condicion_valor, temp_value, temp);
                        if (Succes == true)
                        {
                            temp_counter++;
                        }
                    }
                    else if (Condicion_valor == 13)
                    {
                    }
                }
            }
            return(temp_counter);
        }
コード例 #11
0
        public bool Verify_Sub_Conditions_Equals(String id, int c, String t, Tabla tmp_t)
        {
            bool temp = false;

            List <Entity_Table> ls = tmp_t.getList();

            for (int i = 0; i < ls.Count; i++)
            {
                Entity_Table entity_t = ls.ElementAt(i);
                if (entity_t.getEntity().ToUpper() == id.ToUpper())
                {
                    ArrayList ar = entity_t.getDataArray();
                    for (int j = 0; j < ar.Count; j++)
                    {
                        if (contadorVerify != 0)
                        {
                            if (t == ar[position_D].ToString())
                            {
                                return(temp = true);
                            }
                            else
                            {
                                return(temp = false);
                            }
                        }
                        else
                        {
                            if (c == 9)
                            {
                                if (t == ar[j].ToString())
                                {
                                    position_D = j;
                                    contadorVerify++;
                                    return(temp = true);
                                }
                            }
                        }
                    }
                    break;
                }
            }
            return(temp);
        }
コード例 #12
0
 public void CreateColumns()
 {
     if (Flag_Success == true)
     {
         String Column = Token_List.ElementAt(Numb_post_analisis - 2).getLexl();
         int    Type   = Token_List.ElementAt(Numb_post_analisis - 1).GetCorr();
         Tabla  t      = TableList.ElementAt(contador - 1);
         if (t.getList() == null)
         {
             List <Entity_Table> Columns = new List <Entity_Table>();
             Columns.Add(new Entity_Table(Column, Type, null));
             t.SetList(Columns);
         }
         else
         {
             List <Entity_Table> Columns = t.getList();
             Columns.Add(new Entity_Table(Column, Type, null));
             t.SetList(Columns);
         }
         //Entity_Table tb = TableList.ElementAt(contador).getList();
     }
 }
コード例 #13
0
        public void ImprimirTablas()
        {
            String html_Content;
            String Cabezera_Html;
            String Title_Table   = "";
            String Content_Celda = "";
            String Content_Table = "";

            Cabezera_Html = "<html>" +
                            "<link rel=\"stylesheet\" type=\"text/css\" href=\"bootstrap.css\">" +
                            "<body>";
            for (int i = 0; i < TableList.Count; i++)
            {
                String Columns_Table = "";
                Tabla  t             = TableList.ElementAt(i);
                Title_Table = "</br>" + "<h2 align='center'>" + "Tabla" + " " + t.getName() + "</h2></br>" +
                              "<table cellpadding='10' border = '1' align='center'>";
                for (int j = 0; j < t.getList().Count; j++)
                {
                    Entity_Table ts = t.getList().ElementAt(j);
                    Columns_Table +=
                        "<td><strong>" + ts.getEntity() +
                        "</strong></td>";
                }

                if (t.getList() != null)
                {
                    Content_Celda = tx(t);
                }

                Content_Table += Title_Table + Columns_Table + "</tr>" + Content_Celda
                                 + "</table>";
            }
            html_Content = Cabezera_Html + Content_Table + "</body>" +
                           "</html>";
            File.WriteAllText("Tables.html", html_Content);
            System.Diagnostics.Process.Start("Tables.html");
        }
コード例 #14
0
        public int Verify_Sub_Conditions_mMi(String id, int c, String t, Tabla tmp_t, int con)
        {
            int contador = con;

            if (positions.Count != 0)
            {
                Console.WriteLine("paso por aca prro");
                List <Entity_Table> ls = tmp_t.getList();
                for (int i = 0; i < ls.Count; i++)
                {
                    Entity_Table entity_t = ls.ElementAt(i);
                    if (entity_t.getEntity().ToUpper() == id.ToUpper())
                    {
                        ArrayList ar      = entity_t.getDataArray();
                        int       postion = int.Parse(positions[0].ToString());
                        if (ar[postion].Equals(t))
                        {
                            Console.WriteLine("EL sdflkasdklajsdkl;R");
                            contador++;
                            break;
                        }
                    }
                }
            }
            else
            {
                try
                {
                    ArrayList           ar = null;
                    List <Entity_Table> ls = tmp_t.getList();
                    for (int i = 0; i < ls.Count; i++)
                    {
                        Entity_Table entity_t = ls.ElementAt(i);
                        if (entity_t.getEntity().ToUpper() == id.ToUpper())
                        {
                            ar = entity_t.getDataArray();

                            break;
                        }
                    }
                    if (ar != null)
                    {
                        for (int j = 0; j < ar.Count; j++)
                        {
                            if (ar[j].ToString() != "")
                            {
                                if (c == 10)//MENOR
                                {
                                    if (int.Parse(ar[j].ToString()) < int.Parse(t))
                                    {
                                        positions.Add(j);
                                        contador++;
                                        break;
                                    }
                                }
                                else if (c == 11)
                                {//MAYOR
                                    if (int.Parse(ar[j].ToString()) > int.Parse(t))
                                    {
                                        positions.Add(j);
                                        contador++;
                                        break;
                                    }
                                }
                                else if (c == 12)//IGUAL
                                {
                                    if (ar[j].ToString().ToUpper() == t.ToUpper())
                                    {
                                        Console.WriteLine("su cumplioi" + t);
                                        positions.Add(j);
                                        contador++;

                                        break;
                                    }
                                    else
                                    {
                                        Console.WriteLine("su cumplioi" + t);
                                    }
                                }
                                else if (c == 13)//MAYOR IGUAL
                                {
                                    if (int.Parse(ar[j].ToString()) >= int.Parse(t))
                                    {
                                        positions.Add(j);
                                        contador++;
                                        break;
                                    }
                                }
                                else if (c == 14)//MENOR IGUAL
                                {
                                    if (int.Parse(ar[j].ToString()) <= int.Parse(t))
                                    {
                                        positions.Add(j);
                                        contador++;
                                        break;
                                    }
                                }
                                else if (c == 15)//DISTINTO
                                {
                                    if (int.Parse(ar[j].ToString()) != int.Parse(t))
                                    {
                                        positions.Add(j);
                                        contador++;
                                        break;
                                    }
                                }
                                else
                                {
                                    //NADA
                                }
                            }
                        }
                    }
                }
                catch (System.FormatException)
                {
                }
            }

            return(contador);
        }
コード例 #15
0
 public void  verifyUpdate()
 {
     Tabla temp_table = GetTableName(name_delete);
 }