예제 #1
0
        public override global::System.Data.DataSet Clone()
        {
            dsConfirmacionEnvioCorreo cln = ((dsConfirmacionEnvioCorreo)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
예제 #2
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            dsConfirmacionEnvioCorreo ds = new dsConfirmacionEnvioCorreo();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
예제 #3
0
        private bool generarPDFEnvioCorreoInforme(string ruta, long idCorreo, int codProyecto
                                                  , ref string archivoNotificacion, ref string mensajeError)
        {
            bool generado = false;

            try
            {
                dsConfirmacionEnvioCorreo dsConfirmacionEnvio = new dsConfirmacionEnvioCorreo();

                var datosCorreo = informesBLL.getCorreoInforme(idCorreo);

                dtInfoEnvioRow dtInfoRow = dsConfirmacionEnvio.dtInfoEnvio.NewdtInfoEnvioRow();

                dtInfoRow.EmailRecibe    = datosCorreo.emailRecibe;
                dtInfoRow.FechaHoraEnvio = datosCorreo.fechaHoraEnvio;
                dtInfoRow.Mensaje        = datosCorreo.mensaje.Replace("<br />", System.Environment.NewLine);
                dtInfoRow.NombreEnvia    = datosCorreo.nombreEnvia;
                dtInfoRow.NombreRecibe   = datosCorreo.nombreRecibe;

                dsConfirmacionEnvio.dtInfoEnvio.AdddtInfoEnvioRow(dtInfoRow);

                ReportDataSource reportDataInfoEnvio = new ReportDataSource();
                reportDataInfoEnvio.Value = dsConfirmacionEnvio.dtInfoEnvio;
                reportDataInfoEnvio.Name  = "dsInfoEnvio";

                LocalReport report = new LocalReport();

                report.DataSources.Add(reportDataInfoEnvio);

                report.ReportPath = @"PlanDeNegocioV2\Administracion\Interventoria\InformeConsolidado\Report\confirmacionEnvioCorreo.rdlc";

                byte[] fileBytes = report.Render("PDF");

                if (fileBytes != null)
                {
                    //Response.ContentType = "application/pdf";
                    //Response.AddHeader("content-disposition", fileBytes.Length.ToString());
                    //Response.BinaryWrite(fileBytes);
                    string strFilePath = ruta;
                    string strFileName = codProyecto + "-CorreoNotInformeConsolidado" + idCorreo + ".pdf";
                    string filename    = Path.Combine(strFilePath, strFileName);
                    using (FileStream fs = new FileStream(filename, FileMode.Create))
                    {
                        fs.Write(fileBytes, 0, fileBytes.Length);
                    }

                    archivoNotificacion = strFileName;
                }

                generado = true;

                //MemoryStream ms = new MemoryStream(fileBytes, 0, 0, true, true);
                //Response.AddHeader("content-disposition", "attachment;filename= CorreoNotificacionInforme.pdf");
                //Response.Buffer = true;
                //Response.Clear();
                //Response.OutputStream.Write(ms.GetBuffer(), 0, ms.GetBuffer().Length);
                //Response.OutputStream.Flush();
                //Response.End();
            }
            catch (Exception ex)
            {
                generado     = false;
                mensajeError = "No se logró crear el pdf de notificacion: " + ex.Message;
            }
            return(generado);
        }
예제 #4
0
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                dsConfirmacionEnvioCorreo ds = new dsConfirmacionEnvioCorreo();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "dtInfoEnvioDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }