Esempio n. 1
0
        /** Actualiza un atributo*/
        public void modificaAtributo(string nameEnt, string nameAtri, CNodoAtributo nuevo)
        {
            CNodoEntidad nodoVert = null;
            CNodoAtributo nodoAtri;

            if (nameAtri.CompareTo(nuevo.getNombre()) != 0)
            {
                BajaAtributo(nameEnt, nameAtri);
                AltaAtributo(nuevo, nameEnt);
            }
            else
            {
                buscaEntidad(ref nodoVert, nameEnt);
                if (nodoVert != null)
                {
                    AbrirArchivo();

                    nodoAtri = nodoVert.getCabListAtri();
                    while (nodoAtri != null && nodoAtri.getNombre().CompareTo(nameAtri) != 0)
                        nodoAtri = nodoAtri.getSigAtri();

                    if (nodoAtri != null)
                    {
                        nodoAtri.setClavePrimaria(nuevo.getClave());
                        nodoAtri.setTipo(nuevo.getTipo());
                        nodoAtri.setNameTipo(nuevo.getNameTipo());
                        nodoAtri.setTamaño(nuevo.getTamaño());
                        nodoAtri.setEntRel(nuevo.getEntRel());
                        nodoAtri.setApEntRel(nuevo.getApEntRel());
                        nuevo.setDir(nodoAtri.getDir());
                        nuevo.setApSigAtri(nodoAtri.getApSigAtri());
                        escribeAtributo(nuevo, nuevo.getDir());
                    }

                    CerrarArchivo();
                }
            }
        }
Esempio n. 2
0
        public void getInfo(CNodoAtributo aux, ref int tamA, ref int des, ref int tipo, ref int tamB)
        {
            bool band = true;
            CNodoAtributo aux2;

            aux2 = aux.getEntRel().getCabListAtri();
            while (aux2 != null)
            {
                if (band == true)
                    if (aux2.getClave() != 1)
                        des += aux2.getTamaño();
                    else
                    {
                        tipo = aux2.getTipo();
                        tamA = aux2.getTamaño();
                        band = false;
                    }

                tamB += aux2.getTamaño();
                aux2 = aux2.getSigAtri();
            }
            tamB += 8;
        }