Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="instance"></param>
        /// <returns></returns>
        public static string ToXml(DocsPaVO.ExportFascicolo.ContentDocumento instance)
        {
            XmlSerializer serializer = new XmlSerializer(instance.GetType());

            using (MemoryStream stream = new MemoryStream())
            {
                serializer.Serialize(stream, instance);
                stream.Seek(0, SeekOrigin.Begin);
                return(new StreamReader(stream).ReadToEnd());
            }
        }
Example #2
0
        public static DocsPaVO.ExportFascicolo.ContentDocumento GeneraReportOfn(DocsPaVO.utente.InfoUtente infoUtente, string IdFascicolo)
        {
            DocsPaVO.ExportFascicolo.MetaInfoFascicolo fascicolo = BusinessLogic.ExportFascicolo.ExportFascicoloManager.GetInfoFascicolo(infoUtente, IdFascicolo);
            string style = "<style TYPE=\"text/css\"><!-- ul {  margin-top: 0px;  margin-bottom: 0px;  padding-top: 0px;  padding-bottom: 0px;} --></style>";

            string report = String.Format("<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"utf-8\"><title>Indice Fascicolo {0} </title> {1} </head><body><p><h1>Contenuto Fascicolo {0}</h1></p>\r\n", fascicolo.Nome, style);

            report  = GetMetaInfoDocumentoOFN(infoUtente, fascicolo, ref report, null);
            report += "</body></html>";
            DocsPaVO.ExportFascicolo.ContentDocumento contentDocumento = new DocsPaVO.ExportFascicolo.ContentDocumento {
                MimeType = "text/html", FileExtension = ".htm", FileContent = System.Text.ASCIIEncoding.ASCII.GetBytes(report)
            };
            return(contentDocumento);
        }