예제 #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
파일: XMLExport.cs 프로젝트: SeleVlad/Work
        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());
        }