Пример #1
0
        public virtual bool LoadFormFromXml(string formName, MEDMSql model, XmlNode xrequest, XmlNode xresponse)
        {
            string formpath = Path.Combine(MFunc.GetBaseDir(AppContext.BaseDirectory), "Forms", formName + ".xml");

            if (System.IO.File.Exists(formpath))
            {
                XmlDocument xdoc = new XmlDocument();
                FileStream  fs   = new FileStream(formpath, FileMode.Open, FileAccess.Read, FileShare.Read);
                xdoc.Load(fs);
                fs.Dispose();
                string s = xdoc.InnerXml;
                int    i = s.IndexOf("?>");
                if (i > 0)
                {
                    s = s.Substring(i + 2);
                }
                xresponse.InnerXml = s;
                return(true);
            }
            return(false);
        }