Esempio n. 1
0
        public static void modifyDatabase(string name, GeispDatabase db)
        {
            XElement xmlDb = doc.Elements("asoc").Where(d => d.Attribute("name").Value.ToString() == name).FirstOrDefault();

            xmlDb.Attribute("name").SetValue(db.name);
            xmlDb.Element("name").SetValue(db.name);
            xmlDb.Element("mdb").SetValue(db.mdb);
            xmlDb.Element("excel").SetValue(db.excel);
            xmlDb.Element("mdb2").SetValue(db.mdb2);
            doc.Save(directory + "GEISP\\GEISP.xml");
        }
Esempio n. 2
0
        public static List <GeispDatabase> getDatabases()
        {
            List <GeispDatabase> asocs = new List <GeispDatabase>();

            foreach (var a in doc.Elements("asoc"))
            {
                var db = new GeispDatabase(a.Element("name").Value, a.Element("mdb").Value,
                                           a.Element("excel").Value, a.Element("mdb2").Value);
                asocs.Add(db);
            }
            return(asocs);
        }
Esempio n. 3
0
        public static void modifyDatabase(string name, GeispDatabase db)
        {
            string   directory = AppDomain.CurrentDomain.BaseDirectory;
            XElement doc       = XElement.Load(directory + "GEISP\\GEISP.xml");
            XElement xmlDb     = doc.Elements("databases").FirstOrDefault().Elements("database").Where(d => d.Attribute("name").Value.ToString() == name).FirstOrDefault();

            xmlDb.SetAttributeValue("name", db.name);
            xmlDb.SetAttributeValue("path", db.path);
            xmlDb.SetAttributeValue("codBas", db.codBas);
            xmlDb.SetAttributeValue("societaId", db.societatId);
            doc.Save(directory + "GEISP\\GEISP.xml");
        }
Esempio n. 4
0
        public static void addDatabase(GeispDatabase db)
        {
            XElement asocs = doc;
            XElement xmlDb = new XElement("asoc");

            xmlDb.SetAttributeValue("name", db.name);
            xmlDb.SetElementValue("name", db.name);
            xmlDb.SetElementValue("mdb", db.mdb);
            xmlDb.SetElementValue("excel", db.excel);
            xmlDb.SetElementValue("mdb2", db.mdb2);
            asocs.Add(xmlDb);
            doc.Save(directory + "GEISP\\GEISP.xml");
        }
Esempio n. 5
0
        public static void addDatabase(GeispDatabase db)
        {
            string   directory = AppDomain.CurrentDomain.BaseDirectory;
            XElement doc       = XElement.Load(directory + "GEISP\\GEISP.xml");
            XElement databases = doc.Elements("databases").FirstOrDefault();
            XElement xmlDb     = new XElement("database");

            xmlDb.SetAttributeValue("name", db.name);
            xmlDb.SetAttributeValue("path", db.path);
            xmlDb.SetAttributeValue("codBas", db.codBas);
            xmlDb.SetAttributeValue("societaId", db.societatId);
            databases.Add(xmlDb);
            doc.Save(directory + "GEISP\\GEISP.xml");
        }
Esempio n. 6
0
        public static List <GeispDatabase> getDatabases()
        {
            List <GeispDatabase> databases = new List <GeispDatabase>();
            string   directory             = AppDomain.CurrentDomain.BaseDirectory;
            XElement doc = XElement.Load(directory + "GEISP\\GEISP.xml");

            foreach (var d in doc.Elements("databases").FirstOrDefault().Elements("database"))
            {
                var db = new GeispDatabase(d.Attribute("name").Value.ToString(),
                                           d.Attribute("codBas").Value.ToString(),
                                           d.Attribute("path").Value.ToString(), d.Attribute("societaId").Value.ToString());
                databases.Add(db);
            }
            return(databases);
        } //gg