Example #1
0
        public Tabla Ejecutar()
        {
            Tabla tabla = new Tabla(this.columnas);

            if (!(valizq is Columna))
            {
                //se compara valores de un token con una columna
                Columna aux   = (Columna)valder;
                Token   valor = (Token)valizq;
                for (int k = 0; k < aux.Datos.Count; k++)
                {
                    Token valcelda = aux.Datos[k];
                    bool  val      = Validar(valcelda, valor);
                    if (val)
                    {
                        InsertarValores(tabla, this.tabla2, k);
                    }
                }
                return(tabla);
            }
            if (!(valder is Columna))
            {
                //se comparan valores de una columna con un token
                Columna aux   = (Columna)valizq;
                Token   valor = (Token)valder;
                for (int k = 0; k < aux.Datos.Count; k++)
                {
                    Token valcelda = aux.Datos[k];
                    bool  val      = Validar(valcelda, valor);
                    if (val)
                    {
                        InsertarValores(tabla, this.tabla1, k);
                    }
                }
                return(tabla);
            }
            //cuando ambos son columnas
            Columna columna1 = (Columna)valizq;
            Columna columna2 = (Columna)valder;
            //List<Columna> tabla1 = this.tabla1.getColumnas();
            //List<Columna> tabla2 = this.tabla2.getColumnas();
            int i = 0;
            int j = 0;

            foreach (Token tk1 in columna1.Datos)
            {
                foreach (Token tk2 in columna2.Datos)
                {
                    bool valor = Validar(tk1, tk2);
                    if (valor)
                    {
                        InsertarValores(tabla, this.tabla1, i);
                        InsertarValores(tabla, this.tabla2, j);
                    }
                    j++;
                }
                i++;
            }
            return(tabla);
        }
 private Object COMP()
 {
     if (preanalisis.TipoToken.Equals(Token.Tipo.id))
     {
         String nombreTabla = Match(Token.Tipo.id, "Se esperaba un id").Lexema;
         String valor       = COMP1();
         //se usa para verificar si nombreTabla es una tabla o una columna
         if (valor != null)
         {
             if (this.tablas.ContainsKey(nombreTabla))
             {
                 Tabla         tabla   = tablas[nombreTabla];
                 Columna       columna = tabla.getColumna(valor);
                 List <Object> item    = new List <Object>();
                 item.Add(tabla);
                 item.Add(columna);
                 return(item);
             }
         }
         else
         {
             return(nombreTabla);
         }
     }
     else
     {
         return(VALOR());
     }
     return(null);
 }
Example #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,ExcelId,Description")] Columna columna)
        {
            if (columna == null || id != columna.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(columna);
                    await _context.SaveChangesAsync().ConfigureAwait(false);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ColumnaExists(columna.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ExcelId"] = new SelectList(_context.ExcelFile, "Id", "Id", columna.ExcelId);
            return(View(columna));
        }
Example #4
0
        private Color obtenerColor(Columna columna)
        {
            var   colorstr = columna.Color.Split(',');
            Color color    = Color.FromRgb(byte.Parse(colorstr[0]), byte.Parse(colorstr[1]), byte.Parse(colorstr[2]));

            return(color);
        }
Example #5
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,SeccionId")] Columna columna)
        {
            if (id != columna.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(columna);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ColumnaExists(columna.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SeccionId"] = new SelectList(_context.Seccion, "Id", "NombreSeccion", columna.SeccionId);
            return(View(columna));
        }
        private void Draw_Colum_Alzado_MouseMove(object sender, MouseEventArgs e)
        {
            Columna ColumnaSelect = Form1.Proyecto_.ColumnaSelect;

            if (ColumnaSelect != null)
            {
                for (int i = 0; i < ColumnaSelect.Alzados.Count; i++)
                {
                    for (int j = 0; j < ColumnaSelect.Alzados[i].Colum_Alzado.Count; j++)
                    {
                        if (ColumnaSelect.Alzados[i].Colum_Alzado[j] != null)
                        {
                            ColumnaSelect.Alzados[i].Colum_Alzado[j].MouseMove(e);
                            Draw_Colum_Alzado.Invalidate();

                            if (ColumnaSelect.Alzados[i].Colum_Alzado[j].UnitarioAdicional != null)
                            {
                                ColumnaSelect.Alzados[i].Colum_Alzado[j].UnitarioAdicional.MouseMove(e);
                                Draw_Colum_Alzado.Invalidate();
                            }
                        }
                    }
                }
            }
        }
Example #7
0
        /*
         * Verifica que si hay un tipo counter todas tiene que ser counter
         */

        public Boolean hayCounter(LinkedList <string> lista, LinkedList <Columna> lista2, LinkedList <string> mensajes)
        {
            Mensaje mensa = new Mensaje();
            Boolean flag  = false;

            foreach (string s in lista)
            {
                Columna c = searchColumn(s, lista2);
                if (c != null)
                {
                    if (c.tipo.Equals("counter"))
                    {
                        flag = true;
                    }
                }
            }

            if (flag)
            {
                foreach (string s in lista)
                {
                    Columna cc = searchColumn(s, lista2);
                    if (cc != null)
                    {
                        if (!cc.tipo.Equals("counter"))
                        {
                            mensajes.AddLast(mensa.error("La columna: " + s + " no es de tipo counter, si hay un counter todas las primarias tienen que ser counter", l, c, "Semantico"));
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Example #8
0
        public string ObtenerExpression(Columna col, List <Columna> Columnas)
        {
            //throw new NotImplementedException();
            string expresion = "";

            var colstart = Columnas.Where(c => (c.TipoColumna == TipoColumna.Neto ||
                                                c.TipoColumna == TipoColumna.SubTotal ||
                                                c.TipoColumna == TipoColumna.Costo) &&
                                          c.Orden < col.Orden).LastOrDefault();

            if (colstart != null && col.TipoColumna != TipoColumna.Iva && col.Nombre != "TotalObjetivos")
            {
                List <string> parteExp       = new List <string>();
                string        calc           = "";
                string        desclineal     = "0";
                string        colstartlineal = "";
                if (col.Nombre == "DescuentoObjetivos")
                {
                    var resu = string.Format("IIF(DescuentoAplicado='Si',(Neto-(Neto*(DescuentoPotencial/100))),0)");
                    return(resu);
                }

                for (int i = colstart.Orden; i < col.Orden; i++)
                {
                    if (Columnas[i].TipoColumna == TipoColumna.SubTotal ||
                        Columnas[i].TipoColumna == TipoColumna.Costo ||
                        Columnas[i].TipoColumna == TipoColumna.Neto)
                    {
                        calc           = Columnas[i].Nombre;
                        colstartlineal = Columnas[i].Nombre;
                    }
                    else
                    {
                        if (Columnas[i].TipoColumna == TipoColumna.DescuentoCascada)
                        {
                            //calculo descuento
                            //neto - descuento
                            calc = string.Format("(({0}-({0}*({1}/100))))", calc, Columnas[i].Nombre);
                        }
                        else
                        {
                            if (Columnas[i].TipoColumna == TipoColumna.DescuentoLineal)
                            {
                                //	calc = string.Format("(({0}*({1}/100)))", calc, this.Columnas[i].Nombre);
                                desclineal = string.Format("({0}+{1})", desclineal, Columnas[i].Nombre);
                                calc       = string.Format("({0}-({1}*({2}/100)))", colstartlineal, colstartlineal, desclineal);
                            }
                            else                            //recargo
                            {
                                calc = string.Format("({0}*(1+({1}/100)))", calc, Columnas[i].Nombre);
                            }
                        }
                    }
                    expresion = calc;
                }
            }
            return(expresion);
        }
Example #9
0
 public Color ObtenerColor(Columna columna, int fila)
 {
     return(Casillas
            .Where(casilla =>
                   casilla.Columna == columna &&
                   casilla.Fila == fila)
            .Select(casilla => casilla.Color)
            .First());
 }
        private void ACTUALIZAR()
        {
            String nombreTabla = Match(Token.Tipo.id, "Se esperaba un id").Lexema;

            Match(Token.Tipo.establecer, "Se esperaba la palabra Reservada Establecer");
            Match(Token.Tipo.parAbre, "Se esperaba un (");
            Token tk1 = Match(Token.Tipo.id, "Se esperaba un id");

            Match(Token.Tipo.igual, "Se espeaba un =");
            List <Campo> valores = new List <Campo>();
            Token        tk      = VALOR();

            //se empieza a tomar los valores a establecer
            valores.Add(new Campo(tk, tk1));
            ACTUALIZA(valores);
            Match(Token.Tipo.parCierra, "Se esperaba un )");
            Match(Token.Tipo.donde, "Se esperaba la palabra Reservada Donde");
            List <Object> list = new List <object>();

            list.Add(CONDICION());
            CONDICIONES(list);
            Match(Token.Tipo.puntoycoma, "Se esperaba un ;");
            if (this.tablas.ContainsKey(nombreTabla))
            {
                Tabla         tabla    = this.tablas[nombreTabla];
                List <String> columnas = tabla.getNameColumnas();
                if (valores.Count > tabla.getColumnas().Count)
                {//los campos no son del mismo tam
                    Console.WriteLine("Los campos y las columnas de la tabla difieren en tamaño");
                    return;
                }
                //aca empieza lo de las condiciones, resultante es la unica tabla que resulta de todas las condiciones
                Tabla resultante = getTablaCondiciones(list, tabla, columnas);
                //se compara resultante con la tabla de la que se desea actualizar datos y si hacen match se elimina
                int tam = tabla.getColumnas()[0].Datos.Count;
                for (int i = 0; i < tam; i++)
                {
                    List <Token> valores1 = tabla.getValorFila(i);
                    int          tam2     = resultante.getColumnas()[0].Datos.Count;
                    for (int j = 0; j < tam2; j++)
                    {
                        List <Token> valores2 = resultante.getValorFila(j);
                        bool         valor    = CompararDatos(valores1, valores2, 0);
                        if (valor)
                        {//actualizar datos por columna
                            foreach (Campo item in valores)
                            {
                                Columna colum = tabla.getColumna(item.campo.Lexema);
                                colum.Datos[i] = item.valor;
                            }
                            break;
                        }
                    }
                }
            }
        }
Example #11
0
 public IActionResult Registrar([Bind(Prefix = "colunm")] Columna objContacto)
 {
     if (ModelState.IsValid)
     {
         _context.Add(objContacto);
         _context.SaveChanges();
         return(RedirectToAction("Index", "Home"));
     }
     return(View("index", objContacto));
 }
Example #12
0
 private void InsertarValores(Tabla table, Tabla tabla2, int j)
 {
     foreach (String columna in this.columnas)
     {
         Columna colum = tabla2.getColumna(columna);
         if (colum != null)
         {
             table.getColumna(columna).Datos.Add(colum.Datos[j]);
         }
     }
 }
        private void Draw_Column_Paint(object sender, PaintEventArgs e)
        {
            Columna ColumnaSelect = Form1.Proyecto_.ColumnaSelect;

            if (ColumnaSelect != null)
            {
                KgRefuerzo_L.Text = Math.Round(ColumnaSelect.KgRefuerzo, 2) + " kg";

                KgRefuerzo_L.Location = new Point(250 - KgRefuerzo_L.Width, 7);

                float MaxB = -999999; float MaxH = -999999;

                MaxB = ColumnaSelect.Seccions.FindAll(m => m != null).ToList().Max(m => m.Item1.B);
                MaxH = ColumnaSelect.Seccions.FindAll(m => m != null).ToList().Max(m => m.Item1.H);

                bool ExisteCambioenB = false;
                for (int i = ColumnaSelect.Seccions.Count - 1; i >= 0; i--)
                {
                    if (ColumnaSelect.Seccions[i].Item1 != null)
                    {
                        //try { if (ColumnaSelect.Seccions[i].Item1.Shape != ColumnaSelect.Seccions[i - 1].Item1.Shape) { break; } } catch { }
                        try { if (ColumnaSelect.Seccions[i].Item1.B - ColumnaSelect.Seccions[i - 1].Item1.B != 0)
                              {
                                  ExisteCambioenB = true; break;
                              }
                        }
                        catch { }
                    }
                }
                if (ExisteCambioenB == false)
                {
                    MaxB = MaxH;
                }


                float SX = (Draw_Column.Width - 15) / MaxB;

                float Altura = 0;

                for (int i = 0; i < ColumnaSelect.LuzLibre.Count; i++)
                {
                    Altura += ColumnaSelect.LuzLibre[i] + ColumnaSelect.VigaMayor.Seccions[i].Item1.H;
                }
                Altura += Form1.Proyecto_.e_Fundacion;
                float SY = (Draw_Column.Height - 5) / (Altura);
                float X  = 7.5f;
                float Y  = 5;

                e.Graphics.Clear(Color.White);
                Title_Colum_Model.Text = "Columna: " + ColumnaSelect.Name;
                ColumnaSelect.Paint_Alzado1(e, Draw_Column.Height, Draw_Column.Width, SX, SY, X, Y);
            }
        }
Example #14
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,SeccionId")] Columna columna)
        {
            if (ModelState.IsValid)
            {
                _context.Add(columna);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SeccionId"] = new SelectList(_context.Seccion, "Id", "NombreSeccion", columna.SeccionId);
            return(View(columna));
        }
Example #15
0
        public string ObtenerExpresion(Columna col)
        {
            string expresion = "";

            var colstart = Columnas.Where(c => (c.TipoColumna == TipoColumna.Neto ||
                                                c.TipoColumna == TipoColumna.SubTotal ||
                                                c.TipoColumna == TipoColumna.Costo) &&
                                          c.Orden < col.Orden).LastOrDefault();

            if (colstart != null)
            {
                List <string> parteExp       = new List <string>();
                string        calc           = "";
                string        desclineal     = "0";
                string        colstartlineal = "";
                for (int i = colstart.Orden; i < col.Orden; i++)
                {
                    if (this.Columnas[i].TipoColumna == TipoColumna.SubTotal ||
                        this.Columnas[i].TipoColumna == TipoColumna.Costo ||
                        this.Columnas[i].TipoColumna == TipoColumna.Neto)
                    {
                        calc           = this.Columnas[i].Nombre;
                        colstartlineal = this.Columnas[i].Nombre;
                    }
                    else
                    {
                        //aca tendria que poner que revise el tipo de descuento si es lineal o en cascada
                        if (this.Columnas[i].TipoColumna == TipoColumna.DescuentoCascada)
                        {
                            calc = string.Format("({0}-({1}*({2}/100)))", calc, calc, this.Columnas[i].Nombre);
                        }
                        else
                        {
                            if (this.Columnas[i].TipoColumna == TipoColumna.DescuentoLineal)
                            {
                                //	calc = string.Format("(({0}*({1}/100)))", calc, this.Columnas[i].Nombre);
                                desclineal = string.Format("({0}+{1})", desclineal, this.Columnas[i].Nombre);
                                calc       = string.Format("({0}-({1}*({2}/100)))", colstartlineal, colstartlineal, desclineal);
                            }
                            else//recargo
                            {
                                calc = string.Format("({0}*(1+({1}/100)))", calc, this.Columnas[i].Nombre);
                            }
                        }
                    }
                    expresion = calc;
                }
            }
            return(expresion);
        }
Example #16
0
        public void eliminarColumna(string nombre)
        {
            this.tabla.Columns.Remove(nombre);
            Columna elim = null;

            foreach (Columna col in columnas)
            {
                if (col.nombre.Equals(nombre))
                {
                    elim = col;
                }
            }
            this.columnas.Remove(elim);
        }
Example #17
0
        /*
         * METODO QUE BUSCA LAS COLUMNAS A ORDER
         * @param {columnas} columnas de la tabla temporal de resultado
         * @param {mensajes} output
         */
        private Boolean checkOrder(LinkedList <Columna> columnas, LinkedList <string> mensajes)
        {
            Mensaje mensa = new Mensaje();

            foreach (OrderBy o in orderBy)
            {
                Columna co = searchColumna(columnas, o.nombre);
                if (co == null)
                {
                    mensajes.AddLast(mensa.error("No se encontro la columna para ordenamiento: " + o.nombre, l, c, "Semantico"));
                    return(false);
                }
            }
            return(true);
        }
Example #18
0
        public async Task <IActionResult> Create([Bind("Id,Name,ExcelId,Description")] Columna columna)
        {
            if (columna != null)
            {
                if (ModelState.IsValid)
                {
                    _context.Add(columna);
                    await _context.SaveChangesAsync().ConfigureAwait(false);

                    return(RedirectToAction(nameof(Index)));
                }
                ViewData["ExcelId"] = new SelectList(_context.ExcelFile, "Id", "Id", columna.ExcelId);
                return(View(columna));
            }
            return(NotFound());
        }
        private void PuntosFundacion(Columna columna)
        {
            float[] P1_ = new float[] { 0, 0 }; var P1 = Vector <float> .Build.Dense(P1_);

            float Bdibujar;

            bool ExisteCambioenB = false;

            for (int i = columna.Seccions.Count - 1; i >= 0; i--)
            {
                if (columna.Seccions[i].Item1 != null)
                {
                    try { if (columna.Seccions[i].Item1.B - columna.Seccions[i - 1].Item1.B != 0)
                          {
                              ExisteCambioenB = true; break;
                          }
                    }
                    catch { }
                }
            }
            if (ExisteCambioenB)
            {
                Bdibujar = columna.Seccions[columna.Seccions.Count - 1].Item1.B;
            }
            else
            {
                Bdibujar = columna.Seccions[columna.Seccions.Count - 1].Item1.H;
            }

            var P2 = Vector <float> .Build.Dense(new float[] { Bdibujar, 0 });

            var P3 = Vector <float> .Build.Dense(new float[] { Bdibujar, Form1.Proyecto_.e_Fundacion });

            var P4 = Vector <float> .Build.Dense(new float[] { 0, Form1.Proyecto_.e_Fundacion });

            Lista_CoordendasFundacion.Add(P1);
            Lista_CoordendasFundacion.Add(P2);
            Lista_CoordendasFundacion.Add(P3);
            Lista_CoordendasFundacion.Add(P4);

            var P5 = Vector <float> .Build.Dense(new float[] { 0, Form1.Proyecto_.e_Fundacion - Form1.Proyecto_.Nivel_Fundacion });

            Lista_CoordenadasNivelFundacion.Add(P5);
        }
Example #20
0
        public Boolean existenColumnas(LinkedList <string> lista, LinkedList <Columna> lista2, LinkedList <string> mensajes)
        {
            Mensaje mensa = new Mensaje();

            foreach (string s in lista)
            {
                Columna cc = searchColumn(s, lista2);
                if (cc == null)
                {
                    mensajes.AddLast(mensa.error("La columna: " + s + " no existe", l, c, "Semantico"));
                    return(false);
                }
                else
                {
                    cc.pk = true;
                }
            }
            return(true);
        }
        private void Cb_Aceptar_Click(object sender, EventArgs e)
        {
            if (ConvecionAlzado != null && textBox1.Text != "")
            {
                string  nomenclatura = textBox1.Text;
                Columna col          = Form1.Proyecto_.ColumnaSelect;

                col.CrearAlzado(AlzadoCorrespondiente, RowCorrespondiente, col, nomenclatura);
                col.ModificarTraslapo(AlzadoCorrespondiente, col);
                col.DeterminarCoordAlzado(AlzadoCorrespondiente, col);
                col.ActualizarRefuerzo();
                col.CalcularPesoAcero(AlzadoCorrespondiente);
                Form1.mAgregarAlzado.D_Alzado.Rows[RowCorrespondiente].Cells[AlzadoCorrespondiente + 1].Value = nomenclatura;
                Form1.m_Informacion.MostrarAcero();
                Form1.m_Despiece.Draw_Colum_Alzado.Invalidate();
                Form1.m_Despiece.Draw_Column.Invalidate();
                Form1.mAgregarAlzado.D_Alzado.RefreshEdit();
            }
        }
        private void CreateDataGridView()
        {
            if (Columnas_List.SelectedIndex != -1 && Columnas_List.Text != "")
            {
                DataInfo.Rows.Clear();

                Columna ColumnaSelect = Form1.Proyecto_.Lista_Columnas.Find(x => x.Name == Columnas_List.Text);

                for (int i = 0; i < ColumnaSelect.Panalizar.Count; i++)
                {
                    for (int j = 0; j < ColumnaSelect.Panalizar[i].Count; j++)
                    {
                        DataGridViewCellStyle StyleR = new DataGridViewCellStyle();
                        StyleR.Alignment = DataGridViewContentAlignment.MiddleCenter;
                        StyleR.Font      = new Font("Vderdana", 8, FontStyle.Regular);
                        DataInfo.Rows.Add();
                        DataInfo.Rows[DataInfo.Rows.Count - 1].Cells[0].Value = ColumnaSelect.Name;
                        DataInfo.Rows[DataInfo.Rows.Count - 1].Cells[1].Value = ColumnaSelect.Seccions[i].Item1.ToString();
                        DataInfo.Rows[DataInfo.Rows.Count - 1].Cells[2].Value = ColumnaSelect.Seccions[i].Item2;
                        DataInfo.Rows[DataInfo.Rows.Count - 1].Cells[3].Value = ColumnaSelect.Panalizar[i][j].Item2;
                        DataInfo.Rows[DataInfo.Rows.Count - 1].Cells[4].Value = String.Format("{0:0.00}", ColumnaSelect.Panalizar[i][j].Item4 / 1000);
                        DataInfo.Rows[DataInfo.Rows.Count - 1].Cells[5].Value = String.Format("{0:0.00}", ColumnaSelect.Panalizar[i][j].Item1);
                        if (ColumnaSelect.Panalizar[i][j].Item4 < ColumnaSelect.Panalizar[i][j].Item1 * 1000)
                        {
                            StyleR.BackColor = Color.FromArgb(248, 134, 134);
                            StyleR.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                        }
                        else
                        {
                            StyleR.BackColor = Color.White;
                            StyleR.ForeColor = Color.Black;
                        }

                        DataInfo.Rows[DataInfo.Rows.Count - 1].DefaultCellStyle = StyleR;
                    }
                }

                EstiloDatGridView(DataInfo);
            }
        }
Example #23
0
 public void CrearColumna(TipoColumna tipo, string nombre)
 {
     if (!string.IsNullOrEmpty(nombre) && !this.Columnas.Any(c => c.Nombre == nombre))
     {
         Columna col = new Columna()
         {
             Nombre      = nombre,
             TipoColumna = tipo,
         };
         //aca tengo que tener que busque el color que corresponde a la columna.
         var columna = this.lista.Where(p => p.Columna == tipo).FirstOrDefault();
         if (columna != null)
         {
             col.Color = columna.ColorColumna;
         }
         else
         {
             col.Color = "255,255,255";
         }
         this.Columnas.Add(col);
     }
 }
        private void ConvertirATablas(List <Object> list, Tabla tabla, List <String> columnas)
        {
            //aquí empiezan las multiples condiciones
            for (int i = 0; i < list.Count; i++)
            {
                //se procede a validar las condiciones
                Object obj = list[i];
                if (!(obj is Token))
                {
                    List <Object> cond = (List <Object>)obj;
                    //Comp puede tener una List<Object>c contiene la tabla y la columna, un token o un String
                    String operando = (String)cond[1];
                    Object comp1    = cond[0];
                    if (comp1 is List <Object> )
                    {
                        List <Object> valores = (List <Object>)comp1;
                        Columna       colum   = (Columna)valores[1];
                        Object        comp2   = cond[2];
                        if (comp2 is List <Object> )
                        {
                            //si ambos valores a comparar son columnas
                            List <Object> valores2  = (List <Object>)comp2;
                            Columna       colum2    = (Columna)valores2[1];
                            Condicion     condicion = new Condicion(columnas, tabla, tabla, colum, colum2, operando);
                            Tabla         result    = condicion.Ejecutar();
                        }
                        else if (comp2 is Token)
                        {
                            Token     val2      = (Token)comp2;
                            Condicion condicion = new Condicion(columnas, tabla, tabla, colum, val2, operando);
                            //se evalua
                            Tabla result = condicion.Ejecutar();
                            //se guarda en la lista de condiciones
                            list[i] = result;
                        }
                        else if (comp2 is String)
                        {
                            String  nameColum = (String)comp2;
                            Columna colum2    = tabla.getColumna(nameColum);
                            if (colum2 == null)
                            {
                                MessageBox.Show("Exestin algunos errores de ejecucion.", "Error");
                                continue;
                            }
                            Condicion condicion = new Condicion(columnas, tabla, tabla, colum, colum2, operando);
                            //se evalua
                            Tabla result = condicion.Ejecutar();
                            //se guarda en la lista
                            list[i] = result;
                        }
                    }
                    else if (comp1 is Token)
                    {
                        Token  tk    = (Token)comp1;
                        Object comp2 = cond[2];
                        if (comp2 is String)
                        {
                            String  val2 = (String)comp2;
                            Columna cl2  = tabla.getColumna(val2);
                            if (cl2 == null)
                            {
                                MessageBox.Show("Exestin algunos errores de ejecucion.", "Error");
                                continue;
                            }
                            Condicion condicion = new Condicion(columnas, tabla, tabla, tk, cl2, operando);
                            //se evalua
                            Tabla result = condicion.Ejecutar();
                            //se guarda en la lista
                            list[i] = result;
                        }
                        else if (comp2 is List <Object> )
                        {
                            //recordar agregar la tabla que aparece en este list
                            List <Object> valores   = (List <Object>)comp2;
                            Tabla         tab2      = (Tabla)valores[0];
                            Columna       cl2       = (Columna)valores[1];
                            Condicion     condicion = new Condicion(columnas, tabla, tab2, tk, cl2, operando);
                            //se evalua
                            Tabla result = condicion.Ejecutar();
                            //se guarda en la lista
                            list[i] = result;
                        }
                    }
                    else if (comp1 is String)
                    {
                        //string
                        String  val1 = (String)comp1;
                        Columna cl1  = tabla.getColumna(val1);
                        if (cl1 == null)
                        {
                            MessageBox.Show("Exestin algunos errores de ejecucion.", "Error");
                            continue;
                        }

                        Object comp2 = cond[2];
                        if (comp2 is Token)
                        {
                            Token     valor     = (Token)comp2;
                            Condicion condicion = new Condicion(columnas, tabla, null, cl1, valor, operando);
                            Tabla     result    = condicion.Ejecutar();
                            //se procede a cambiar la List<Object> por una tabla
                            list[i] = result;
                        }
                        else if (comp2 is List <Object> )
                        {
                        }
                        else if (comp2 is String)
                        {
                            String    val2      = (String)comp2;
                            Columna   cl2       = tabla.getColumna(val2);
                            Condicion condicion = new Condicion(columnas, tabla, tabla, cl1, cl2, operando);
                            //se evalua
                            Tabla result = condicion.Ejecutar();
                            //se guarda en la lista
                            list[i] = result;
                        }
                    }
                }
            }
        }
        private void Cb_Aceptar_Click(object sender, EventArgs e)
        {
            float r;
            bool  IsNumeric = Single.TryParse(CantBarras.Text, out r);

            if (NoBarra.Text != "" && r != 0 && IsNumeric)
            {
                if (EditarAlgunosAlzados)
                {
                    AsignarRefuerzo(Filas, Columnas, Convert.ToInt32(NoBarra.Text), Convert.ToInt32(CantBarras.Text));
                    EditarAlgunosAlzados = false;
                    TP1.Enabled          = true;
                    TP2.Enabled          = true;
                }
                else
                {
                    string  Nomenclatura  = r + "#" + NoBarra.Text;
                    Columna ColumnaSelect = Form1.Proyecto_.ColumnaSelect;
                    if (TP1.Checked)
                    {
                        for (int i = 0; i < Form1.mAgregarAlzado.D_Alzado.Rows.Count; i++)
                        {
                            Form1.mAgregarAlzado.D_Alzado.Rows[i].Cells[IndiceC].Value = "";
                        }

                        Form1.mAgregarAlzado.D_Alzado.Rows[Form1.mAgregarAlzado.D_Alzado.Rows.Count - 1].Cells[IndiceC].Value = Nomenclatura + "T1";
                        if (Form1.mAgregarAlzado.D_Alzado.Rows.Count % 2 != 0)
                        {
                            Form1.mAgregarAlzado.D_Alzado.Rows[0].Cells[IndiceC].Value = Nomenclatura + "T1";
                        }
                        else
                        {
                            Form1.mAgregarAlzado.D_Alzado.Rows[0].Cells[IndiceC].Value = Nomenclatura + "T3";
                        }

                        for (int i = Form1.mAgregarAlzado.D_Alzado.Rows.Count - 2; i > 0; i--)
                        {
                            if ((Form1.mAgregarAlzado.D_Alzado.Rows.Count - i) % 2 != 0)
                            {
                                Form1.mAgregarAlzado.D_Alzado.Rows[i].Cells[IndiceC].Value = Nomenclatura;
                            }
                            else
                            {
                                Form1.mAgregarAlzado.D_Alzado.Rows[i].Cells[IndiceC].Value = Nomenclatura + "T2";
                            }
                        }

                        BarraPersonalizada2.Width   = 0;
                        BarraPersonalizada.Visible  = true;
                        BarraPersonalizada2.Visible = true;
                        int D_Pro = BarraPersonalizada.Width / Form1.mAgregarAlzado.D_Alzado.Rows.Count - 1;

                        for (int i = Form1.mAgregarAlzado.D_Alzado.Rows.Count - 1; i >= 0; i--)
                        {
                            Form1.mAgregarAlzado.EndCellEdit(IndiceC, i, false, ColumnaSelect);
                            BarraPersonalizada2.Width += D_Pro;
                        }

                        Form1.mAgregarAlzado.CrearDataGrid(true);
                    }
                    else if (TP2.Checked)
                    {
                        for (int i = 0; i < Form1.mAgregarAlzado.D_Alzado.Rows.Count; i++)
                        {
                            Form1.mAgregarAlzado.D_Alzado.Rows[i].Cells[IndiceC].Value = "";
                        }

                        Form1.mAgregarAlzado.D_Alzado.Rows[Form1.mAgregarAlzado.D_Alzado.Rows.Count - 1].Cells[IndiceC].Value = Nomenclatura + "T3";
                        if (Form1.mAgregarAlzado.D_Alzado.Rows.Count % 2 != 0)
                        {
                            Form1.mAgregarAlzado.D_Alzado.Rows[0].Cells[IndiceC].Value = Nomenclatura + "T3";
                        }
                        else
                        {
                            Form1.mAgregarAlzado.D_Alzado.Rows[0].Cells[IndiceC].Value = Nomenclatura + "T1";
                        }

                        for (int i = Form1.mAgregarAlzado.D_Alzado.Rows.Count - 2; i > 0; i--)
                        {
                            if ((Form1.mAgregarAlzado.D_Alzado.Rows.Count - i) % 2 != 0)
                            {
                                Form1.mAgregarAlzado.D_Alzado.Rows[i].Cells[IndiceC].Value = Nomenclatura + "T2";
                            }
                            else
                            {
                                Form1.mAgregarAlzado.D_Alzado.Rows[i].Cells[IndiceC].Value = Nomenclatura;
                            }
                        }

                        BarraPersonalizada2.Width   = 0;
                        BarraPersonalizada.Visible  = true;
                        BarraPersonalizada2.Visible = true;
                        int D_Pro = BarraPersonalizada.Width / Form1.mAgregarAlzado.D_Alzado.Rows.Count - 1;

                        for (int i = Form1.mAgregarAlzado.D_Alzado.Rows.Count - 1; i >= 0; i--)
                        {
                            Form1.mAgregarAlzado.EndCellEdit(IndiceC, i, false, ColumnaSelect);
                            BarraPersonalizada2.Width += D_Pro;
                        }
                    }

                    for (int i = 0; i < Form1.mAgregarAlzado.D_Alzado.Rows.Count; i++)
                    {
                        Form1.mAgregarAlzado.D_Alzado.Rows[i].Cells[IndiceC].Value = Nomenclatura;
                    }
                    BarraPersonalizada.Visible  = false;
                    BarraPersonalizada2.Visible = false;
                    Form1.mAgregarAlzado.CrearDataGrid(true);
                }
            }

            Close();
        }
        public void AsignarRefuerzo(List <int> Filas_Numeros, List <int> Columnas_Numeros, int NoBarra, int CantBarras)
        {
            Columna col = Form1.Proyecto_.ColumnaSelect;
            List <List <string> > AlzadoTemporal = new List <List <string> >();

            int FilaMayor = Filas_Numeros.Max();

            int Contador = 0;

            for (int i = Columnas_Numeros[0]; i < Columnas_Numeros[Columnas_Numeros.Count - 1] + 1; i++)
            {
                AlzadoTemporal.Add(new List <string>());
                for (int j = Filas_Numeros[0]; j >= Filas_Numeros[Filas_Numeros.Count - 1]; j--)
                {
                    string Nomenclatura = CantBarras + "#" + NoBarra;
                    if (i % 2 == 0)
                    {
                        if (j == col.Seccions.Count - 1)
                        {
                            Nomenclatura += "T1";
                        }
                        else if (j == 0)
                        {
                            if (col.Seccions.Count % 2 != 0)
                            {
                                Nomenclatura += "T1";
                            }
                            else
                            {
                                Nomenclatura += "T3";
                            }
                        }
                        else
                        {
                            if ((col.Seccions.Count - j) % 2 == 0)
                            {
                                Nomenclatura += "T2";
                            }
                            //try
                            //{
                            //    if (col.Seccions[j].Item1.B != col.Seccions[j - 1].Item1.B | col.Seccions[j].Item1.H != col.Seccions[j - 1].Item1.H)
                            //    {
                            //        Nomenclatura = CantBarras + "#" + NoBarra;
                            //        if ((col.AlzadoBaseSugerido.Count - j) % 2 == 0)
                            //        {
                            //            Nomenclatura += "T3";
                            //        }
                            //        else
                            //        { Nomenclatura += "T1"; }
                            //    }
                            //}
                            //catch { }
                        }
                    }
                    else
                    {
                        if (j == col.Seccions.Count - 1)
                        {
                            Nomenclatura += "T3";
                        }
                        else if (j == 0)
                        {
                            if (col.Seccions.Count % 2 != 0)
                            {
                                Nomenclatura += "T3";
                            }
                            else
                            {
                                Nomenclatura += "T1";
                            }
                        }
                        else
                        {
                            if ((col.Seccions.Count - j) % 2 != 0)
                            {
                                Nomenclatura += "T2";
                            }
                            //try
                            //{
                            //    if (col.Seccions[j].Item1.B != col.Seccions[j - 1].Item1.B | col.Seccions[j].Item1.H != col.Seccions[j - 1].Item1.H)
                            //    {
                            //        Nomenclatura = CantBarras + "#" + NoBarra;
                            //        if ((col.AlzadoBaseSugerido.Count - j) % 2 == 0)
                            //        {
                            //            Nomenclatura += "T1";
                            //        }
                            //        else
                            //        { Nomenclatura += "T3"; }
                            //    }
                            //}
                            //catch { }
                        }
                    }

                    AlzadoTemporal[Contador].Add(Nomenclatura);
                }
                Contador += 1;
            }

            for (int i = 0; i < Columnas_Numeros.Count; i++)
            {
                for (int j = Filas_Numeros.Count - 1; j >= 0; j--)
                {
                    col.CrearAlzado(Columnas_Numeros[i], Filas_Numeros[j], col, AlzadoTemporal[i][j]);
                }
            }
            for (int i = Columnas_Numeros[0]; i < Columnas_Numeros[Columnas_Numeros.Count - 1] + 1; i++)
            {
                col.ModificarTraslapo(i, col);
                col.DeterminarCoordAlzado(i, col);
            }

            col.ActualizarRefuerzo();
            for (int i = Columnas_Numeros[0]; i < Columnas_Numeros[Columnas_Numeros.Count - 1] + 1; i++)
            {
                col.CalcularPesoAcero(i);
            }
            for (int i = 0; i < Columnas_Numeros.Count; i++)
            {
                for (int j = Filas_Numeros.Count - 1; j >= 0; j--)
                {
                    Form1.mAgregarAlzado.D_Alzado.Rows[Filas_Numeros[j]].Cells[Columnas_Numeros[i] + 1].Value = AlzadoTemporal[i][j].ToString();
                }
            }

            Form1.m_Informacion.MostrarAcero();
            Form1.m_Despiece.Draw_Colum_Alzado.Invalidate();
            Form1.m_Despiece.Draw_Column.Invalidate();
            Form1.mAgregarAlzado.D_Alzado.RefreshEdit();
        }
Example #27
0
        /*
         * Metodo se encarga de recorrer todo nuestra base de datos no relacional y guardarla en forma fisica
         */
        public void guardarArchivo(string archivo)
        {
            using (FileStream fileStream = File.Open("DATABASE/" + archivo + ".chison", FileMode.Truncate))
            {
                using (StreamWriter f = new StreamWriter(fileStream))
                {
                    BaseDeDatos last = TablaBaseDeDatos.global.Count() > 0 ? TablaBaseDeDatos.global.Last() : null;
                    f.WriteLine("$<");
                    f.WriteLine("\t\"DATABASES\" = [");
                    //-------------------------------------------------------------BASES DE DATOS ---------------------------------------------------------------------
                    foreach (BaseDeDatos bd in TablaBaseDeDatos.global)
                    {
                        f.WriteLine("\t\t<");
                        f.WriteLine("\t\t\t\"NAME\" = \"" + bd.nombre + "\",");
                        f.WriteLine("\t\t\t\"Data\" = [");

                        Objeto     o     = bd.objetos;
                        Tabla      lastT = o.tablas.Count > 0 ? o.tablas.Last() : null;
                        User_Types lastU = o.user_types.Count() > 0 ? o.user_types.Last() : null;
                        Procedures lastP = o.procedures.Count() > 0 ? o.procedures.Last() : null;

                        //---------------------------------------------- TABLAS --------------------------------------------------------------------------------------
                        foreach (Tabla t in o.tablas)
                        {
                            f.WriteLine("\t\t\t\t<");
                            f.WriteLine("\t\t\t\t\t\"CQL-TYPE\" = \"TABLE\",");
                            f.WriteLine("\t\t\t\t\t\"NAME\" = \"" + t.nombre + "\",");
                            f.WriteLine("\t\t\t\t\t\"COLUMNS\" = [");

                            //--------------------------------------------COLUMNAS ---------------------------------------------------------------------------------
                            Columna lastC = t.columnas.Count() > 0 ? t.columnas.Last() : null;
                            foreach (Columna c in t.columnas)
                            {
                                f.WriteLine("\t\t\t\t\t\t<");
                                f.WriteLine("\t\t\t\t\t\t\t\"NAME\" = \"" + c.name + "\",");
                                f.WriteLine("\t\t\t\t\t\t\t\"TYPE\" = \"" + c.tipo + "\",");
                                f.WriteLine("\t\t\t\t\t\t\t\"PK\" = " + c.pk);

                                if (c.Equals(lastC))
                                {
                                    f.WriteLine("\t\t\t\t\t\t>");
                                }
                                else
                                {
                                    f.WriteLine("\t\t\t\t\t\t>,");
                                }
                            }
                            f.WriteLine("\t\t\t\t\t],");

                            //-------------------------------------------- DATA ------------------------------------------------------------------------------------
                            f.WriteLine("\t\t\t\t\t\"DATA\" = [");
                            Data lastD = t.datos.Count() > 0 ? t.datos.Last() : null;
                            foreach (Data d in t.datos)
                            {
                                f.WriteLine("\t\t\t\t\t<");

                                //------------------------------------------------------ lista de Atributos --------------------------------------------------------
                                Atributo lastA = d.valores.Count() > 0 ? d.valores.Last() : null;
                                foreach (Atributo a in d.valores)
                                {
                                    if (a.valor != null)
                                    {
                                        string salida = getValor(a.valor, a.nombre, "\t\t\t\t\t\t");
                                        if (!a.Equals(lastA))
                                        {
                                            salida += ",";
                                        }
                                        f.WriteLine(salida);
                                    }
                                }

                                if (d.Equals(lastD))
                                {
                                    f.WriteLine("\t\t\t\t\t>");
                                }
                                else
                                {
                                    f.WriteLine("\t\t\t\t\t>,");
                                }
                            }
                            f.WriteLine("\t\t\t\t\t]");

                            if (t.Equals(lastT))
                            {
                                if (lastU != null || lastP != null)
                                {
                                    f.WriteLine("\t\t\t\t>,");
                                }
                                else
                                {
                                    f.WriteLine("\t\t\t\t>");
                                }
                            }
                            else
                            {
                                f.WriteLine("\t\t\t\t>,");
                            }
                        }

                        //--------------------------------------------- OBJECT ---------------------------------------------------------------------------------------

                        foreach (User_Types us in o.user_types)
                        {
                            f.WriteLine("\t\t\t\t<");
                            f.WriteLine("\t\t\t\t\t\"CQL-TYPE\" = \"OBJECT\",");
                            f.WriteLine("\t\t\t\t\t\"NAME\" = \"" + us.name + "\",");
                            f.WriteLine("\t\t\t\t\t\"ATTRS\" = [");

                            //------------------------------------------------------ ATTRS ---------------------------------------------------------------------------
                            Attrs lastA = us.type.Count() > 0 ? us.type.Last() : null;
                            foreach (Attrs a in us.type)
                            {
                                f.WriteLine("\t\t\t\t\t\t<");
                                f.WriteLine("\t\t\t\t\t\t\t\"NAME\" = \"" + a.name + "\",");
                                f.WriteLine("\t\t\t\t\t\t\t\"TYPE\" = \"" + a.type + "\"");

                                if (a.Equals(lastA))
                                {
                                    f.WriteLine("\t\t\t\t\t\t>");
                                }
                                else
                                {
                                    f.WriteLine("\t\t\t\t\t\t>,");
                                }
                            }

                            f.WriteLine("\t\t\t\t\t]");
                            if (us.Equals(lastU))
                            {
                                if (lastP != null)
                                {
                                    f.WriteLine("\t\t\t\t>,");
                                }
                                else
                                {
                                    f.WriteLine("\t\t\t\t>");
                                }
                            }
                            else
                            {
                                f.WriteLine("\t\t\t\t>,");
                            }
                        }

                        //------------------------------------------------ PROCEDURES -------------------------------------------------------------------------------

                        foreach (Procedures p in o.procedures)
                        {
                            f.WriteLine("\t\t\t\t<");
                            f.WriteLine("\t\t\t\t\t\"CQL-TYPE\" = \"PROCEDURE\",");
                            f.WriteLine("\t\t\t\t\t\"NAME\" = \"" + p.nombre + "\",");
                            f.WriteLine("\t\t\t\t\t\"PARAMETERS\" = [");

                            //------------------------------------------------------ PARAMETROS ---------------------------------------------------------------------
                            //.........................................................IN ...........................................................................
                            Boolean         flagHayParameter = false;
                            listaParametros parametro        = p.parametro.ElementAt(0);
                            if (parametro.lista.Count() > 0)
                            {
                                var nodeLastParameter = parametro.lista.Last();
                                foreach (Declaracion d in parametro.lista)
                                {
                                    flagHayParameter = true;
                                    f.WriteLine("\t\t\t\t\t<");
                                    f.WriteLine("\t\t\t\t\t\t\"NAME\" = \"" + d.id + "\",");
                                    f.WriteLine("\t\t\t\t\t\t\"TYPE\" = \"" + d.tipo + "\",");
                                    f.WriteLine("\t\t\t\t\t\t\"AS\" = \"IN\"");
                                    if (!d.Equals(nodeLastParameter))
                                    {
                                        f.WriteLine("\t\t\t\t\t>,");
                                    }
                                }
                            }

                            //------------------------------------------------------- OUT -------------------------------------------------------------------------------
                            parametro = p.retornos.ElementAt(0);
                            if (parametro.lista.Count() > 0)
                            {
                                if (flagHayParameter)
                                {
                                    f.WriteLine("\t\t\t\t\t>,");
                                }
                                var nodeLastParameter = parametro.lista.Last();
                                foreach (Declaracion d in parametro.lista)
                                {
                                    flagHayParameter = true;
                                    f.WriteLine("\t\t\t\t\t\t<");
                                    f.WriteLine("\t\t\t\t\t\t\t\"NAME\" = \"" + d.id + "\",");
                                    f.WriteLine("\t\t\t\t\t\t\t\"TYPE\" = \"" + d.tipo + "\",");
                                    f.WriteLine("\t\t\t\t\t\t\t\"AS\" = \"OUT\"");
                                    if (!d.Equals(nodeLastParameter))
                                    {
                                        f.WriteLine("\t\t\t\t\t>,");
                                    }
                                    else
                                    {
                                        f.WriteLine("\t\t\t\t\t>");
                                    }
                                }
                            }
                            else
                            {
                                if (flagHayParameter)
                                {
                                    f.WriteLine("\t\t\t\t\t>");
                                }
                            }
                            f.WriteLine("\t\t\t\t\t],");
                            f.WriteLine("\t\t\t\t\t\"INSTR\" = $" + p.instruccion + "$");
                            if (p.Equals(lastP))
                            {
                                f.WriteLine("\t\t\t\t>");
                            }
                            else
                            {
                                f.WriteLine("\t\t\t\t>,");
                            }
                        }

                        f.WriteLine("\t\t\t]");
                        if (bd.Equals(last))
                        {
                            f.WriteLine("\t\t>");
                        }
                        else
                        {
                            f.WriteLine("\t\t>,");
                        }
                    }

                    f.WriteLine("\t],");
                    f.WriteLine("\t\"USERS\" = [");

                    //---------------------------------------------------- USUARIOS -------------------------------------------------------------------------------
                    Usuario lastUser = TablaBaseDeDatos.listaUsuario.Count() > 0 ? TablaBaseDeDatos.listaUsuario.Last() : null;
                    foreach (Usuario us in TablaBaseDeDatos.listaUsuario)
                    {
                        f.WriteLine("\t\t<");
                        f.WriteLine("\t\t\t\"NAME\" = \"" + us.nombre + "\",");
                        f.WriteLine("\t\t\t\"PASSWORD\" = \"" + us.password + "\",");
                        f.WriteLine("\t\t\t\"PERMISSIONS\" = [");

                        string lasPer = us.bases.Count() > 0 ? us.bases.Last() : null;
                        foreach (string p in us.bases)
                        {
                            f.WriteLine("\t\t\t<");
                            f.WriteLine("\t\t\t\"NAME\" = \"" + p + "\"");
                            if (p.Equals(lasPer))
                            {
                                f.WriteLine("\t\t\t>");
                            }
                            else
                            {
                                f.WriteLine("\t\t\t>,");
                            }
                        }

                        f.WriteLine("\t\t\t]");
                        if (us.Equals(lastUser))
                        {
                            f.WriteLine("\t\t>");
                        }
                        else
                        {
                            f.WriteLine("\t\t>,");
                        }
                    }


                    f.WriteLine("\t]");

                    f.WriteLine(">$");
                }
            }
        }
Example #28
0
        /*
         * Metodo que verificara el tipo a guardar
         * @columna columan actual
         * @valor es el valor  a guardar
         * @original es la expresion sin ejecutar
         * @mensajes output de salida
         * @db BaseDeDatos actual
         */

        private Atributo checkinfo(Columna columna, object valor, object original, LinkedList <string> mensajes, BaseDeDatos db, Ambito ambito)
        {
            Mensaje mensa = new Mensaje();

            if (original == null)
            {
                if (!columna.pk)
                {
                    if (columna.tipo.Equals("string") || columna.tipo.Equals("date") || columna.tipo.Equals("time"))
                    {
                        return(new Atributo(columna.name, null, columna.tipo));
                    }
                    else if (columna.tipo.Equals("int") || columna.tipo.Equals("double") || columna.tipo.Equals("boolean") || columna.tipo.Contains("map") || columna.tipo.Contains("list") || columna.tipo.Contains("set"))
                    {
                        ambito.listadoExcepciones.AddLast(new Excepcion("valuesexception", "No se le puede asignar a un tipo: " + columna.tipo + " un valor null"));
                        mensajes.AddLast(mensa.error("No se le puede asignar a un tipo: " + columna.tipo + " un valor null", l, c, "Semantico"));
                    }
                    else
                    {
                        Boolean temp = TablaBaseDeDatos.getUserType(columna.tipo, db);
                        if (temp)
                        {
                            return(new Atributo(columna.name, new InstanciaUserType(columna.tipo, null), columna.tipo));
                        }
                        else
                        {
                            mensajes.AddLast(mensa.error("No existe el USER TYPE: " + columna.tipo + " en la DB: " + db.nombre, l, c, "Semantico"));
                        }
                    }
                }
                else
                {
                    ambito.listadoExcepciones.AddLast(new Excepcion("valuesexception", "La columna: " + columna.name + " es clave primaria no puede asignarsele un valor null"));

                    mensajes.AddLast(mensa.error("La columna: " + columna.name + " es clave primaria no puede asignarsele un valor null", l, c, "Semantico"));
                }
            }
            else
            {
                if (valor != null)
                {
                    if (columna.tipo.Equals("string") && valor.GetType() == typeof(string))
                    {
                        return(new Atributo(columna.name, (string)valor, "string"));
                    }
                    else if (columna.tipo.Equals("int") && valor.GetType() == typeof(int))
                    {
                        return(new Atributo(columna.name, (int)valor, "int"));
                    }
                    else if (columna.tipo.Equals("double") && valor.GetType() == typeof(Double))
                    {
                        return(new Atributo(columna.name, (Double)valor, "double"));
                    }
                    else if (columna.tipo.Equals("boolean") && valor.GetType() == typeof(Boolean))
                    {
                        return(new Atributo(columna.name, (Boolean)valor, "boolean"));
                    }
                    else if (columna.tipo.Equals("date") && valor.GetType() == typeof(DateTime))
                    {
                        return(new Atributo(columna.name, (DateTime)valor, "date"));
                    }
                    else if (columna.tipo.Equals("time") && valor.GetType() == typeof(TimeSpan))
                    {
                        return(new Atributo(columna.name, (TimeSpan)valor, "time"));
                    }
                    else if (columna.tipo.Equals("counter") && valor.GetType() == typeof(int))
                    {
                        return(new Atributo(columna.name, (int)valor, "int"));
                    }
                    else if (columna.tipo.Contains("map") && valor.GetType() == typeof(Map))
                    {
                        Map    temp = (Map)valor;
                        string tipo = columna.tipo.TrimStart('m').TrimStart('a').TrimStart('p').TrimStart('<');
                        if (tipo.EndsWith('>'))
                        {
                            tipo = tipo.Substring(0, tipo.Length - 1);
                        }
                        if (temp.id.Equals(tipo))
                        {
                            return(new Atributo(columna.name, temp, tipo));
                        }
                        mensajes.AddLast(mensa.error("No coinciden los tipos de map: " + tipo + " con: " + temp.id, l, c, "Semantico"));
                    }
                    else if (columna.tipo.Contains("set") && valor.GetType() == typeof(Set))
                    {
                        Set temp = (Set)valor;

                        string tipo = columna.tipo.TrimStart('s').TrimStart('e').TrimStart('t').TrimStart('<');
                        if (tipo.EndsWith('>'))
                        {
                            tipo = tipo.Substring(0, tipo.Length - 1);
                        }
                        if (temp.id.Equals(tipo))
                        {
                            return(new Atributo(columna.name, temp, tipo));
                        }
                        mensajes.AddLast(mensa.error("No coinciden los tipos de Set: " + tipo + " con: " + temp.id, l, c, "Semantico"));
                    }
                    else if (columna.tipo.Contains("list") && valor.GetType() == typeof(List))
                    {
                        List temp = (List)valor;

                        string tipo = columna.tipo.TrimStart('l').TrimStart('i').TrimStart('s').TrimStart('t').TrimStart('<');
                        if (tipo.EndsWith('>'))
                        {
                            tipo = tipo.Substring(0, tipo.Length - 1);
                        }
                        if (temp.id.Equals(tipo))
                        {
                            return(new Atributo(columna.name, temp, tipo));
                        }
                        mensajes.AddLast(mensa.error("No coinciden los tipos de List: " + tipo + " con: " + temp.id, l, c, "Semantico"));
                    }
                    else if (valor.GetType() == typeof(InstanciaUserType))
                    {
                        InstanciaUserType temp = (InstanciaUserType)valor;
                        if (columna.tipo.Equals(temp.tipo))
                        {
                            return(new Atributo(columna.name, (InstanciaUserType)valor, columna.tipo));
                        }
                        else
                        {
                            mensajes.AddLast(mensa.error("No se le puede asignar a la columna: " + columna.name + " un tipo: " + temp.tipo, l, c, "Semantico"));
                        }
                    }
                    else
                    {
                        ambito.listadoExcepciones.AddLast(new Excepcion("valuesexception", "No se puede asignar a la columna: " + columna.name + " el valor: " + valor));
                        mensajes.AddLast(mensa.error("No se puede asignar a la columna: " + columna.name + " el valor: " + valor, l, c, "Semantico"));
                    }
                }
                else
                {
                    if (columna.tipo.Equals("string") || columna.tipo.Equals("date") || columna.tipo.Equals("time"))
                    {
                        return(new Atributo(columna.name, null, columna.tipo));
                    }
                    else if (columna.tipo.Equals("boolean") || columna.tipo.Equals("int") || columna.tipo.Equals("double") || columna.tipo.Contains("map") || columna.tipo.Contains("list") || columna.tipo.Contains("set"))
                    {
                        ambito.listadoExcepciones.AddLast(new Excepcion("valuesexception", "No se puede asignar a la columna: " + columna.name + " el valor: " + valor + valor));

                        mensajes.AddLast(mensa.error("No se puede asignar a la columna: " + columna.name + " el valor: " + valor, l, c, "Semantico"));
                    }
                    else
                    {
                        return(new Atributo(columna.name, new InstanciaUserType(columna.tipo, null), columna.tipo));
                    }
                }
            }
            return(null);
        }
        public void CrearDataGriedView(bool Actuliazar = false)
        {
            Columna ColumnaSelect = Form1.Proyecto_.ColumnaSelect;

            if (ColumnaSelect != null)
            {
                if (ColumnaSelectAnt != ColumnaSelect)
                {
                    Info_D.Rows.Clear();
                    NameColum.Text = "Columna: " + ColumnaSelect.Name;

                    for (int i = 0; i < ColumnaSelect.Seccions.Count; i++)
                    {
                        if (ColumnaSelect.Seccions[i].Item1 != null | Actuliazar)
                        {
                            Color Color_RefMen = Color.FromArgb(250, 99, 99);
                            Color Color_RefCum = Color.FromArgb(29, 94, 243);
                            Info_D.Rows.Add();
                            Info_D.Rows[Info_D.Rows.Count - 1].Cells[0].Value = ColumnaSelect.Seccions[i].Item2;
                            Info_D.Rows[Info_D.Rows.Count - 1].Cells[1].Value = ColumnaSelect.Seccions[i].Item1.Material.FC.ToString();
                            Info_D.Rows.Add();
                            Info_D.Rows[Info_D.Rows.Count - 1].Cells[0].Value = ColumnaSelect.Seccions[i].Item2;
                            Info_D.Rows[Info_D.Rows.Count - 1].Cells[1].Value = ColumnaSelect.Seccions[i].Item1.Material.FC.ToString();
                            Info_D.Rows.Add();
                            Info_D.Rows[Info_D.Rows.Count - 1].Cells[0].Value = ColumnaSelect.Seccions[i].Item2;
                            Info_D.Rows[Info_D.Rows.Count - 1].Cells[1].Value = ColumnaSelect.Seccions[i].Item1.Material.FC.ToString();

                            DataGridViewTextBoxCellEx cell = (DataGridViewTextBoxCellEx)Info_D[0, Info_D.Rows.Count - 3];
                            cell.RowSpan = 3;
                            DataGridViewTextBoxCellEx cell2 = (DataGridViewTextBoxCellEx)Info_D[1, Info_D.Rows.Count - 3];
                            cell2.RowSpan = 3;

                            double FactorConversion = 10000;

                            Info_D.Rows[Info_D.Rows.Count - 3].Cells["Locali"].Value = "Top";
                            Info_D.Rows[Info_D.Rows.Count - 2].Cells["Locali"].Value = "Medium";
                            Info_D.Rows[Info_D.Rows.Count - 1].Cells["Locali"].Value = "Bottom";

                            double ptop    = ColumnaSelect.resultadosETABs[i].AsTopMediumButton[0] / ColumnaSelect.Seccions[i].Item1.Area;
                            double pmedium = ColumnaSelect.resultadosETABs[i].AsTopMediumButton[1] / ColumnaSelect.Seccions[i].Item1.Area;
                            double pbutton = ColumnaSelect.resultadosETABs[i].AsTopMediumButton[2] / ColumnaSelect.Seccions[i].Item1.Area;

                            //Cuantia Mayor al 4%

                            if (ptop >= 0.04)
                            {
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["AceroR"].Style.BackColor = Color.FromArgb(247, 114, 114);
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["AceroR"].ToolTipText     = "Acero requerido mayor a la cuantía máxima permisible.";
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["AceroR"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                            }
                            if (pmedium >= 0.04)
                            {
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["AceroR"].Style.BackColor = Color.FromArgb(247, 114, 114);
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["AceroR"].ToolTipText     = "Acero requerido mayor a la cuantía máxima permisible.";
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["AceroR"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                            }
                            if (pbutton >= 0.04)
                            {
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["AceroR"].Style.BackColor = Color.FromArgb(247, 114, 114);
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["AceroR"].ToolTipText     = "Acero requerido mayor a la cuantía máxima permisible.";
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["AceroR"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                            }

                            //Cuantia Mayor al 4%

                            Info_D.Rows[Info_D.Rows.Count - 3].Cells["AceroR"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].AsTopMediumButton[0] * FactorConversion, 2);
                            Info_D.Rows[Info_D.Rows.Count - 2].Cells["AceroR"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].AsTopMediumButton[1] * FactorConversion, 2);
                            Info_D.Rows[Info_D.Rows.Count - 1].Cells["AceroR"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].AsTopMediumButton[2] * FactorConversion, 2);

                            Info_D.Rows[Info_D.Rows.Count - 3].Cells["Asasign"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].As_asignado[0] * FactorConversion, 2);
                            Info_D.Rows[Info_D.Rows.Count - 2].Cells["Asasign"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].As_asignado[1] * FactorConversion, 2);
                            Info_D.Rows[Info_D.Rows.Count - 1].Cells["Asasign"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].As_asignado[2] * FactorConversion, 2);

                            if (ColumnaSelect.resultadosETABs[i].prequerida == null)
                            {
                                ColumnaSelect.CrearCuantiaProyectoAntiguos(i);
                            }

                            Info_D.Rows[Info_D.Rows.Count - 3].Cells["prequerida"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].prequerida[0], 2) + "%";
                            Info_D.Rows[Info_D.Rows.Count - 2].Cells["prequerida"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].prequerida[1], 2) + "%";
                            Info_D.Rows[Info_D.Rows.Count - 1].Cells["prequerida"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].prequerida[2], 2) + "%";

                            Info_D.Rows[Info_D.Rows.Count - 3].Cells["pasignada"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].pasignada[0], 2) + "%";
                            Info_D.Rows[Info_D.Rows.Count - 2].Cells["pasignada"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].pasignada[1], 2) + "%";
                            Info_D.Rows[Info_D.Rows.Count - 1].Cells["pasignada"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].pasignada[2], 2) + "%";

                            if (Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[0], 3) > 105 | Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[0], 3) < 95)
                            {
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["Porc_Ref"].Style.ForeColor = Color_RefMen;
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["Porc_Ref"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                            }
                            else
                            {
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["Porc_Ref"].Style.ForeColor = Color_RefCum;
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["Porc_Ref"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                            }
                            if (Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[1], 3) > 105 | Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[1], 3) < 95)
                            {
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["Porc_Ref"].Style.ForeColor = Color_RefMen;
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["Porc_Ref"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                            }
                            else
                            {
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["Porc_Ref"].Style.ForeColor = Color_RefCum;
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["Porc_Ref"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                            }
                            if (Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[2], 3) > 105 | Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[2], 3) < 95)
                            {
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["Porc_Ref"].Style.ForeColor = Color_RefMen;
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["Porc_Ref"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                            }
                            else
                            {
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["Porc_Ref"].Style.ForeColor = Color_RefCum;
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["Porc_Ref"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                            }

                            Info_D.Rows[Info_D.Rows.Count - 3].Cells["Porc_Ref"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[0], 2) + "%";
                            Info_D.Rows[Info_D.Rows.Count - 2].Cells["Porc_Ref"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[1], 2) + "%";
                            Info_D.Rows[Info_D.Rows.Count - 1].Cells["Porc_Ref"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[2], 2) + "%";

                            float FCMetros = 100;

                            if (ColumnaSelect.Seccions[i].Item1.Shape == TipodeSeccion.Rectangular)
                            {
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["B"].Value            = ColumnaSelect.Seccions[i].Item1.B * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["H"].Value            = ColumnaSelect.Seccions[i].Item1.H * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["TW"].Style.BackColor = Color.LightGray;
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["TF"].Style.BackColor = Color.LightGray;

                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["B"].Value            = ColumnaSelect.Seccions[i].Item1.B * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["H"].Value            = ColumnaSelect.Seccions[i].Item1.H * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["TW"].Style.BackColor = Color.LightGray;
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["TF"].Style.BackColor = Color.LightGray;

                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["B"].Value            = ColumnaSelect.Seccions[i].Item1.B * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["H"].Value            = ColumnaSelect.Seccions[i].Item1.H * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["TW"].Style.BackColor = Color.LightGray;
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["TF"].Style.BackColor = Color.LightGray;

                                DataGridViewTextBoxCellEx cell3 = (DataGridViewTextBoxCellEx)Info_D["B", Info_D.Rows.Count - 3];
                                DataGridViewTextBoxCellEx cell4 = (DataGridViewTextBoxCellEx)Info_D["H", Info_D.Rows.Count - 3];
                                DataGridViewTextBoxCellEx cell5 = (DataGridViewTextBoxCellEx)Info_D["TW", Info_D.Rows.Count - 3];
                                DataGridViewTextBoxCellEx cell6 = (DataGridViewTextBoxCellEx)Info_D["TF", Info_D.Rows.Count - 3];
                                cell3.RowSpan = 3; cell4.RowSpan = 3; cell5.RowSpan = 3;; cell6.RowSpan = 3;
                            }

                            if (ColumnaSelect.Seccions[i].Item1.Shape == TipodeSeccion.Circle)
                            {
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["B"].Value            = ColumnaSelect.Seccions[i].Item1.B * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["H"].Style.BackColor  = Color.LightGray;
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["TW"].Style.BackColor = Color.LightGray;
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["TF"].Style.BackColor = Color.LightGray;

                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["B"].Value            = ColumnaSelect.Seccions[i].Item1.B * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["H"].Style.BackColor  = Color.LightGray;
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["TW"].Style.BackColor = Color.LightGray;
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["TF"].Style.BackColor = Color.LightGray;

                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["B"].Value            = ColumnaSelect.Seccions[i].Item1.B * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["H"].Style.BackColor  = Color.LightGray;
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["TW"].Style.BackColor = Color.LightGray;
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["TF"].Style.BackColor = Color.LightGray;

                                DataGridViewTextBoxCellEx cell3 = (DataGridViewTextBoxCellEx)Info_D["B", Info_D.Rows.Count - 3];
                                DataGridViewTextBoxCellEx cell4 = (DataGridViewTextBoxCellEx)Info_D["H", Info_D.Rows.Count - 3];
                                DataGridViewTextBoxCellEx cell5 = (DataGridViewTextBoxCellEx)Info_D["TW", Info_D.Rows.Count - 3];
                                DataGridViewTextBoxCellEx cell6 = (DataGridViewTextBoxCellEx)Info_D["TF", Info_D.Rows.Count - 3];
                                cell3.RowSpan = 3; cell4.RowSpan = 3; cell5.RowSpan = 3;; cell6.RowSpan = 3;
                            }

                            if (ColumnaSelect.Seccions[i].Item1.Shape == TipodeSeccion.Tee | ColumnaSelect.Seccions[i].Item1.Shape == TipodeSeccion.L)
                            {
                                CSD SeccionTL = (CSD)ColumnaSelect.Seccions[i].Item1;

                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["B"].Value  = SeccionTL.B * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["H"].Value  = SeccionTL.H * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["TW"].Value = SeccionTL.TW * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 3].Cells["TF"].Value = SeccionTL.TF * FCMetros;

                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["B"].Value  = SeccionTL.B * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["H"].Value  = SeccionTL.H * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["TW"].Value = SeccionTL.TW * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 2].Cells["TF"].Value = SeccionTL.TF * FCMetros;

                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["B"].Value  = SeccionTL.B * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["H"].Value  = SeccionTL.H * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["TW"].Value = SeccionTL.TW * FCMetros;
                                Info_D.Rows[Info_D.Rows.Count - 1].Cells["TF"].Value = SeccionTL.TF * FCMetros;

                                DataGridViewTextBoxCellEx cell3 = (DataGridViewTextBoxCellEx)Info_D["B", Info_D.Rows.Count - 3];
                                DataGridViewTextBoxCellEx cell4 = (DataGridViewTextBoxCellEx)Info_D["H", Info_D.Rows.Count - 3];
                                DataGridViewTextBoxCellEx cell5 = (DataGridViewTextBoxCellEx)Info_D["TW", Info_D.Rows.Count - 3];
                                DataGridViewTextBoxCellEx cell6 = (DataGridViewTextBoxCellEx)Info_D["TF", Info_D.Rows.Count - 3];
                                cell3.RowSpan = 3; cell4.RowSpan = 3; cell5.RowSpan = 3;; cell6.RowSpan = 3;
                            }
                        }
                    }

                    ColumnaSelectAnt = ColumnaSelect;
                }
            }

            EstiloDatGridView(Info_D);
        }
        public void MostrarAcero()
        {
            Columna ColumnaSelect = Form1.Proyecto_.ColumnaSelect;

            Color Color_RefMen = Color.FromArgb(250, 99, 99);
            Color Color_RefCum = Color.FromArgb(29, 94, 243);

            if (Info_D.Rows.Count == Form1.mAgregarAlzado.D_Alzado.Rows.Count * 3)
            {
                for (int i = 0; i < Form1.mAgregarAlzado.D_Alzado.Rows.Count; i++)
                {
                    if (Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[0], 3) > 105 | Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[0], 3) < 95)
                    {
                        Info_D.Rows[(i * 3 + 3) - 3].Cells["Porc_Ref"].Style.ForeColor = Color_RefMen;
                        Info_D.Rows[(i * 3 + 3) - 3].Cells["Porc_Ref"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                    }
                    else
                    {
                        Info_D.Rows[(i * 3 + 3) - 3].Cells["Porc_Ref"].Style.ForeColor = Color_RefCum;
                        Info_D.Rows[(i * 3 + 3) - 3].Cells["Porc_Ref"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                    }
                    if (Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[1], 3) > 105 | Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[1], 3) < 95)
                    {
                        Info_D.Rows[(i * 3 + 3) - 2].Cells["Porc_Ref"].Style.ForeColor = Color_RefMen;
                        Info_D.Rows[(i * 3 + 3) - 2].Cells["Porc_Ref"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                    }
                    else
                    {
                        Info_D.Rows[(i * 3 + 3) - 2].Cells["Porc_Ref"].Style.ForeColor = Color_RefCum;
                        Info_D.Rows[(i * 3 + 3) - 2].Cells["Porc_Ref"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                    }
                    if (Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[2], 3) > 105 | Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[2], 3) < 95)
                    {
                        Info_D.Rows[(i * 3 + 3) - 1].Cells["Porc_Ref"].Style.ForeColor = Color_RefMen;
                        Info_D.Rows[(i * 3 + 3) - 1].Cells["Porc_Ref"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                    }
                    else
                    {
                        Info_D.Rows[(i * 3 + 3) - 1].Cells["Porc_Ref"].Style.ForeColor = Color_RefCum;
                        Info_D.Rows[(i * 3 + 3) - 1].Cells["Porc_Ref"].Style.Font      = new Font("Vderdana", 8, FontStyle.Bold);
                    }
                    double FactorConversion = 10000;

                    Info_D.Rows[(i * 3 + 3) - 3].Cells["Asasign"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].As_asignado[0] * FactorConversion, 2);
                    Info_D.Rows[(i * 3 + 3) - 2].Cells["Asasign"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].As_asignado[1] * FactorConversion, 2);
                    Info_D.Rows[(i * 3 + 3) - 1].Cells["Asasign"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].As_asignado[2] * FactorConversion, 2);

                    Info_D.Rows[(i * 3 + 3) - 3].Cells["Porc_Ref"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[0], 2) + "%";
                    Info_D.Rows[(i * 3 + 3) - 2].Cells["Porc_Ref"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[1], 2) + "%";
                    Info_D.Rows[(i * 3 + 3) - 1].Cells["Porc_Ref"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].Porct_Refuerzo[2], 2) + "%";

                    if (ColumnaSelect.resultadosETABs[i].prequerida == null)
                    {
                        ColumnaSelect.CrearCuantiaProyectoAntiguos(i);
                    }

                    Info_D.Rows[(i * 3 + 3) - 3].Cells["pasignada"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].pasignada[0], 2) + "%";
                    Info_D.Rows[(i * 3 + 3) - 2].Cells["pasignada"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].pasignada[1], 2) + "%";
                    Info_D.Rows[(i * 3 + 3) - 1].Cells["pasignada"].Value = Math.Round(ColumnaSelect.resultadosETABs[i].pasignada[2], 2) + "%";

                    // Info_D.Refresh();
                }
            }
        }