public Dependencias(int appid, int usuarioid, string nombre)
        {
            Aplicacion objapp = new Aplicacion();

            objapp.ObtenObjetosDB3(usuarioid, appid, nombre);
            XobjetosDB = objapp.AplicaionXML;
        }
Example #2
0
        public JsonResult GeneraDiagramaDetalle(int appid, string nombre, int maxe)
        {
            string nomapp = TempData["nomapp"].ToString();

            TempData.Keep("nomapp");
            Aplicacion appobj = new Aplicacion();
            string     diagramahtml = string.Empty;
            int        xini = 0, xfin = 0, yini = 0, yfin = 0, xinc = 0, yinc = 0;
            string     dim = string.Empty;

            DiagramaDimension(maxe, ref xini, ref xfin, ref yini, ref yfin, ref xinc, ref yinc, ref dim);
            int ide_padre = 49;

            if (dim.Equals("2"))
            {
                ide_padre = 21;
            }

            if (appobj.ObtenObjetosDB3(1, appid, nombre))
            {
                int contador = 0;
                for (int x = xini; x < xfin; x += xinc)
                {
                    for (int y = yini; y < yfin; y += yinc)
                    {
                        de.Add(new Utilerias.diagramElem(contador, x, y, string.Empty, 0, 0, 0, ""));
                        contador++;
                    }
                }
                ValidaXMLDiagrama(appobj.AplicaionXML, "ObjetosDB", 1, maxe, false);
                XmlNode select = appobj.AplicaionXML.DocumentElement.SelectSingleNode("ObjetosDB");
                de[ide_padre].name = nomapp; de[ide_padre].ocp = 1; de[ide_padre].idepadre = -1; de[ide_padre].ispadre = 1;
                ide_padre++;
                de[ide_padre].name = ""; de[ide_padre].ocp = 1; de[ide_padre].idepadre = (ide_padre - 1); de[ide_padre].ispadre = 1;
                int ide_hijo = 0;
                foreach (XmlNode area in select.SelectNodes("row[@visible='true']"))
                {
                    ide_hijo          = EncuentraHijoAmigo(ide_padre, de, xini);
                    de[ide_hijo].name = area.Attributes["Objeto"].Value.ToString(); de[ide_hijo].ocp = 1; de[ide_hijo].idepadre = ide_padre;
                }
                diagramahtml = ArmandoDIagrama(de, maxe);
            }

            TempData["ControlDiv"] = de;
            TempData["xmlActual"]  = appobj.AplicaionXML;
            return(Json(diagramahtml, JsonRequestBehavior.AllowGet));
        }