示例#1
0
        public String export(string searchString)
        {
            TicketService tService = new TicketService();
            var           data     = tService.getTickets(searchString).ToList();

            string JSONresult;

            JSONresult = JsonConvert.SerializeObject(data, Formatting.Indented);
            return(JSONresult);
        }
示例#2
0
        public String export(string searchString)
        {
            TicketService tService = new TicketService();
            var           data     = tService.getTickets(searchString).ToList();

            var          serializer = new System.Xml.Serialization.XmlSerializer(data.GetType());
            StringWriter textWriter = new StringWriter();

            serializer.Serialize(textWriter, data);

            return(textWriter.ToString());
        }