private string FormMapDB()
        {
            StringBuilder myHTML    = new StringBuilder();
            const string  sqlSelect = "so.id, so.name as dbtable,(select count(syscolumns.id) from syscolumns where syscolumns.id=so.id) as nbfields";

            ds = EvoDB.GetData(EvoDB.BuildSQL(sqlSelect, "sysobjects as so", whereMapDB, "dbtable", 500), _SqlConnection, ref ErrorMsg);
            DataTable t0 = ds.Tables[0];
            int       ml = t0.Rows.Count;

            if (ml > 0)
            {
                myHTML.Append("<p>Please select the database tables to build UI for:</p><p>");
                for (int i = 0; i < ml; i++)
                {
                    DataRow ri  = t0.Rows[i];
                    string  cId = ri["ID"].ToString();
                    myHTML.Append(EvoUI.HTMLInputCheckBox("table2map", cId, String.Format("{0} ({1} columns)", ri["dbtable"], ri["nbfields"]), false, cId));
                    myHTML.Append("</br>");
                }
                myHTML.Append("</p>");
            }
            else
            {
                return(EvoUI.HTMLMessage("No database objects available.", EvoUI.MsgType.Error));
            }
            return(myHTML.ToString());
        }
Ejemplo n.º 2
0
        private string FormInstall()
        {
            StringBuilder myHTML = new StringBuilder();
            bool          xmlOK  = false;
            XmlDocument   myDOM2 = new XmlDocument();

            try
            {
                myDOM2.Load(FileNameWithMask(_PathXML + "Wizard_Install.xml"));
                xmlOK = true;
            }
            catch                                                                                   //(Exception ex)
            {
                myHTML.Append(EvoUI.HTMLMessage("XML not found or invalid.", EvoUI.MsgType.Error)); //.Append(ex.Message);
            }
            if (xmlOK)
            {
                XmlNode nApps = myDOM2.SelectSingleNode("wizard_install");
                if (nApps != null)
                {
                    foreach (XmlNode nGroup in nApps.ChildNodes)
                    {
                        if (nGroup.NodeType == XmlNodeType.Element && nGroup.Name == "appgroup")
                        {
                            myHTML.AppendFormat("<p>{0}:</p>", nGroup.Attributes[xAttribute.label].Value);
                            foreach (XmlNode nApp in nGroup.ChildNodes)
                            {
                                string icon = String.Empty;
                                if (nApp.Attributes[xAttribute.icon] != null)
                                {
                                    icon = nApp.Attributes[xAttribute.icon].Value;
                                }
                                if (!String.IsNullOrEmpty(icon))
                                {
                                    icon = EvoUI.HTMLIcon(_PathPix, icon);
                                }
                                string label = icon + nApp.Attributes[xAttribute.label].Value;
                                string id    = nApp.Attributes["file"].Value;
                                if (id.Length > 0)
                                {
                                    id = id.Substring(0, id.Length - 4);
                                    myHTML.Append(EvoUI.HTMLInputCheckBox("frmID", id, label, false, id));
                                    myHTML.Append(EvoUI.tag_BR);
                                }
                            }
                        }
                    }
                }
                else
                {
                    myHTML.Append(EvoUI.HTMLMessage("XML is invalid.", EvoUI.MsgType.Error));
                }
            }
            myDOM = null;
            myHTML.Append(EvoUI.tag_BR);
            return(myHTML.ToString());
        }