public override global::System.Data.DataSet Clone() { Maternal cln = ((Maternal)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { Maternal ds = new Maternal(); 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); }
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(); Maternal ds = new Maternal(); 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 = "MaternalDataTable"; 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); }
public void ProcesarFondoMaternal(System.ComponentModel.BackgroundWorker worker, string periodo) { worker.ReportProgress(0); Maternal m = new Maternal { A1 = Convert.ToString(DatosCuentasFBL3N("7002000002", periodo) * -1), A2 = Convert.ToString(DatosCuentasFBL3N("7002000005", periodo) * -1), A31 = Convert.ToString(DatosCuentasFBL3N("7002000006", periodo) * -1), A32 = Convert.ToString(DatosCuentasFBL3N("7002000007", periodo) * -1), A41 = Convert.ToString(DatosCuentasFBL3N("7002000004", periodo) * -1), A42 = Convert.ToString(DatosCuentasFBL3N("7002000003", periodo) * -1), C1 = Convert.ToString(DatosCuentasFBL3N("8006000009", periodo)), C2 = Convert.ToString(DatosCuentasFBL3N("8006000010", periodo)), C3 = Convert.ToString(DatosCuentasFBL3N("8006000021", periodo)), C4 = Convert.ToString(DatosCuentasFBL3N("8006000011", periodo)), C5 = Convert.ToString(0), C61 = Convert.ToString(DatosCuentasFBL3N("8006000022", periodo)), C62 = Convert.ToString(DatosCuentasFBL3N("8006000023", periodo)), C63 = Convert.ToString(DatosCuentasFBL3N("8006000024", periodo)), C64 = Convert.ToString(DatosCuentasFBL3N("8006000025", periodo)), C65 = Convert.ToString(0), C71 = Convert.ToString(DatosCuentasFBL3N("8006000026", periodo)), C72 = Convert.ToString(DatosCuentasFBL3N("8006000027", periodo)), C73 = Convert.ToString(DatosCuentasFBL3N("8006000028", periodo)), C74 = Convert.ToString(DatosCuentasFBL3N("8006000029", periodo)), C75 = Convert.ToString(0), C81 = Convert.ToString(DatosCuentasFBL3N("8006000030", periodo)), C82 = Convert.ToString(DatosCuentasFBL3N("8006000031", periodo)), C83 = Convert.ToString(DatosCuentasFBL3N("8006000032", periodo)), C84 = Convert.ToString(DatosCuentasFBL3N("8006000033", periodo)), C85 = Convert.ToString(0), C91 = Convert.ToString(DatosCuentasFBL3N("8006000034", periodo)), C92 = Convert.ToString(DatosCuentasFBL3N("8006000035", periodo)), C93 = Convert.ToString(DatosCuentasFBL3N("8006000036", periodo)), C94 = Convert.ToString(DatosCuentasFBL3N("8006000037", periodo)), C95 = Convert.ToString(0), E1 = Convert.ToString(DatosCuentasFBL3N("8006000012", periodo)), E2 = Convert.ToString(DatosCuentasFBL3N("8006000013", periodo)), E3 = Convert.ToString(DatosCuentasFBL3N("8006000038", periodo)), E4 = Convert.ToString(DatosCuentasFBL3N("8006000014", periodo)), E5 = Convert.ToString(0), F1 = Convert.ToString(DatosCuentasFBL3N("8006000015", periodo)), F2 = Convert.ToString(DatosCuentasFBL3N("8006000016", periodo)), F3 = Convert.ToString(DatosCuentasFBL3N("8006000039", periodo)), F4 = Convert.ToString(DatosCuentasFBL3N("8006000017", periodo)), F5 = Convert.ToString(0), G1 = Convert.ToString(0), G2 = Convert.ToString(0), G3 = Convert.ToString(0), G4 = Convert.ToString(0), }; worker.ReportProgress(80); mc.ProcesarFondo(m, periodo); worker.ReportProgress(100); }
public void ProcesarFondo(Maternal m, string periodo) { var excelAppOut = new ExcelX.Application(); var fecha = DateTime.Now.ToString().Replace("/", "").Replace(":", "").Replace(" ", ""); //var periodo = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString().PadLeft(2, '0'); var rutaEntrada = @"C:\Fondos Nacionales\Templates\IF_MATERNAL"; var rutaSalida = @"C:\Fondos Nacionales\out\" + periodo + @"\Maternal\"; Utilidades.AbrirLibro(excelAppOut, rutaEntrada); //"Feb-17" ExcelX._Worksheet Salida = (ExcelX.Worksheet)excelAppOut.Sheets["Template"]; Salida.Cells["14", "K"] = m.A1.Replace(".", "").Replace(",", ""); Salida.Cells["15", "K"] = m.A2.Replace(".", "").Replace(",", ""); Salida.Cells["18", "I"] = m.A31.Replace(".", "").Replace(",", ""); Salida.Cells["19", "I"] = m.A32.Replace(".", "").Replace(",", ""); Salida.Cells["22", "I"] = m.A41.Replace(".", "").Replace(",", ""); Salida.Cells["23", "I"] = m.A42.Replace(".", "").Replace(",", ""); Salida.Cells["30", "K"] = m.C1.Replace(".", "").Replace(",", ""); Salida.Cells["31", "K"] = m.C2.Replace(".", "").Replace(",", ""); Salida.Cells["32", "K"] = m.C3.Replace(".", "").Replace(",", ""); Salida.Cells["33", "K"] = m.C4.Replace(".", "").Replace(",", ""); Salida.Cells["34", "K"] = m.C5.Replace(".", "").Replace(",", ""); Salida.Cells["37", "I"] = m.C61.Replace(".", "").Replace(",", ""); Salida.Cells["38", "I"] = m.C62.Replace(".", "").Replace(",", ""); Salida.Cells["39", "I"] = m.C63.Replace(".", "").Replace(",", ""); Salida.Cells["40", "I"] = m.C64.Replace(".", "").Replace(",", ""); Salida.Cells["41", "I"] = m.C65.Replace(".", "").Replace(",", ""); Salida.Cells["44", "I"] = m.C71.Replace(".", "").Replace(",", ""); Salida.Cells["45", "I"] = m.C72.Replace(".", "").Replace(",", ""); Salida.Cells["46", "I"] = m.C73.Replace(".", "").Replace(",", ""); Salida.Cells["47", "I"] = m.C74.Replace(".", "").Replace(",", ""); Salida.Cells["48", "I"] = m.C75.Replace(".", "").Replace(",", ""); Salida.Cells["51", "I"] = m.C81.Replace(".", "").Replace(",", ""); Salida.Cells["52", "I"] = m.C82.Replace(".", "").Replace(",", ""); Salida.Cells["53", "I"] = m.C83.Replace(".", "").Replace(",", ""); Salida.Cells["54", "I"] = m.C84.Replace(".", "").Replace(",", ""); Salida.Cells["55", "I"] = m.C85.Replace(".", "").Replace(",", ""); Salida.Cells["58", "I"] = m.C91.Replace(".", "").Replace(",", ""); Salida.Cells["59", "I"] = m.C92.Replace(".", "").Replace(",", ""); Salida.Cells["60", "I"] = m.C93.Replace(".", "").Replace(",", ""); Salida.Cells["61", "I"] = m.C94.Replace(".", "").Replace(",", ""); Salida.Cells["62", "I"] = m.C95.Replace(".", "").Replace(",", ""); Salida.Cells["68", "K"] = m.E1.Replace(".", "").Replace(",", ""); Salida.Cells["69", "K"] = m.E2.Replace(".", "").Replace(",", ""); Salida.Cells["70", "K"] = m.E3.Replace(".", "").Replace(",", ""); Salida.Cells["71", "K"] = m.E4.Replace(".", "").Replace(",", ""); Salida.Cells["72", "K"] = m.E5.Replace(".", "").Replace(",", ""); Salida.Cells["76", "K"] = m.F1.Replace(".", "").Replace(",", ""); Salida.Cells["77", "K"] = m.F2.Replace(".", "").Replace(",", ""); Salida.Cells["78", "K"] = m.F3.Replace(".", "").Replace(",", ""); Salida.Cells["79", "K"] = m.F4.Replace(".", "").Replace(",", ""); Salida.Cells["80", "K"] = m.F5.Replace(".", "").Replace(",", ""); Salida.Cells["84", "K"] = m.G1.Replace(".", "").Replace(",", ""); Salida.Cells["85", "K"] = m.G2.Replace(".", "").Replace(",", ""); Salida.Cells["86", "K"] = m.G3.Replace(".", "").Replace(",", ""); Salida.Cells["87", "K"] = m.G4.Replace(".", "").Replace(",", ""); System.IO.FileAttributes attr; try { attr = System.IO.File.GetAttributes(rutaSalida); } catch (Exception ex) { System.IO.Directory.CreateDirectory(rutaSalida); } Salida.Name = periodo; Salida.SaveAs(rutaSalida + "IFMaternal_" + fecha + Utilidades.ExtensionLibro(Salida.Application.ActiveWorkbook)); excelAppOut.Quit(); System.Runtime.InteropServices.Marshal.FinalReleaseComObject(excelAppOut); }