using System; using System.Collections.Generic; using System.Linq; using System.Web; using DataLibrary.XmlCons; using System.Data; namespace DataLibrary { public class XmlService { private String gcoopPath = ""; public XmlService(String gcoopPath) { this.gcoopPath = gcoopPath; } public List GetConnectionStrings() { List list = new List(); DataTable dt = new XmlConfigService(gcoopPath).ConnectionStringData; for(int i = 0; i < dt.Rows.Count; i++) { XmlConnection xc = new XmlConnection(); xc.ID = Convert.ToInt32( dt.Rows[i]["id"] ); xc.Profile = dt.Rows[i]["profile"].ToString(); xc.ConnectionString = dt.Rows[i]["connection_string"].ToString(); list.Add(xc); } return list; } public String GetConnectionString(int id) { List x = this.GetConnectionStrings(); return x[id].ConnectionString; } public XmlConnection GetXmlConnection(int id) { List list = new List(); DataTable dt = new XmlConfigService(gcoopPath).ConnectionStringData; for (int i = 0; i < dt.Rows.Count; i++) { if (i == id) { XmlConnection xc = new XmlConnection(); xc.ID = Convert.ToInt32(dt.Rows[i]["id"]); xc.Profile = dt.Rows[i]["profile"].ToString(); xc.ConnectionString = dt.Rows[i]["connection_string"].ToString(); return xc; } } return null; } public bool PBprocess125ExtendFlag { get { try { XmlConfigService xml = new XmlConfigService(gcoopPath); return xml.PBprocess125ExtendFlag; } catch { return false; } } } public bool PBpreport125ExtendFlag { get { try { XmlConfigService xml = new XmlConfigService(gcoopPath); return xml.PBpreport125ExtendFlag; } catch { return false; } } } } }