public DataSet Execute(RequestCollection requests)
        {
            //var xml = requests.ToXml();
            //var text = HttpPost(xml);
            //var bytes = Convert.FromBase64String(text);
            //var ds = Serializer.Decompress<DataSet>(bytes);
            //var ds = Serializer.FromBinary<DataSet>(bytes);

            var ds = DataAccess.DataProvider.Excute(requests);

            return(ds);
        }
        public static RequestCollection FromXml(string xml)
        {
            var result = new RequestCollection();

            var doc = new XmlDocument();

            doc.LoadXml(xml);

            var requests = doc.SelectNodes("//Request");

            foreach (XmlNode node in requests)
            {
                var request = new Request();

                var id = node.SelectSingleNode("Id").InnerText;

                request.Id = new Guid(id);

                var sections = node.SelectSingleNode("Sections");
                if (sections != null)
                {
                    foreach (XmlNode section_node in sections.ChildNodes)
                    {
                        var section = section_node.Name;

                        foreach (XmlNode item in section_node.ChildNodes)
                        {
                            var item_isnull = Convert.ToBoolean(item.SelectSingleNode("IsNull").InnerText);
                            var item_name   = item.SelectSingleNode("Name").InnerText;
                            var item_value  = item.SelectSingleNode("Value").InnerText;

                            if (item_isnull)
                            {
                                item_value = null;
                            }

                            request[section].Add(item_name, item_value);
                        }
                    }
                }

                result += request;
            }

            return(result);
        }
示例#3
0
 public static DataSet Execute(RequestCollection requests)
 {
     return(HttpDataServices.Execute(requests));
 }