Ejemplo n.º 1
0
        public Request GetRequest(string data)
        {
            var requestXml = new XmlDocument();
            requestXml.LoadXml(data);
            var obj = new Request();

            foreach (var property in obj.GetType().GetFields())
            {
                if (requestXml.ChildNodes[0].Attributes != null)
                    foreach (var attribute in requestXml.ChildNodes[0].Attributes)
                    {

                        if (((XmlAttribute) attribute).Name == property.Name)
                        {
                            if (property.FieldType == typeof(string))
                                property.SetValue(obj, ((XmlAttribute) attribute).Value);
                            else if (property.FieldType == typeof(int))
                                property.SetValue(obj, Convert.ToInt32(((XmlAttribute)attribute).Value));
                        }
                    }
            }

            return obj;
        }
Ejemplo n.º 2
0
 public ParcerNewTrasferEventArgs(Request req, ContactResponse response, ContactTransfer transfer)
 {
     Req = req;
     Response = response;
     Transfer = transfer;
 }