Example #1
0
        private void WorkerMethodRpt(object sender, WaitWindowEventArgs e)
        {
            string path = Application.StartupPath;

            path = path.Replace("\\", "/");
            path = path.Replace("/bin/Debug", "");

            path = path + "/Dominio/Reportes/rptTotUser.rpt";

            rpt.Load(path);

            Conexion.CMD.CommandText = this.vSQL;
            int count = 0;

            using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD))
            {
                using (ReportsDS ds = new ReportsDS())
                {
                    ds.Clear();
                    da.Fill(ds, "TotUser");
                    count = ds.Tables["TotUser"].Rows.Count;

                    foreach (DataRow row in ds.Tables["TotUser"].Rows)
                    {
                        row["Digitador"] = General.TradUser(row["Digitador"].ToString());
                    }
                    rpt.SetDataSource(ds);
                }
            }

            e.Result = count.ToString();
        }
Example #2
0
        private void WorkerMethodRpt(object sender, WaitWindowEventArgs e)
        {
            string path = Application.StartupPath;

            path = path.Replace("\\", "/");
            path = path.Replace("/bin/Debug", "");

            path = path + "/Dominio/Reportes/rptFrecEnf.rpt";

            rpt.Load(path);

            Conexion.CMD.CommandText = this.sql;

            using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD))
            {
                using (ReportsDS ds = new ReportsDS())
                {
                    ds.Clear();
                    da.Fill(ds, 0, int.Parse(spinner1.Value.ToString()), "FrecEnf");
                    rpt.SetDataSource(ds);
                }
            }

            //rpt.SetParameterValue("consul", e.Arguments[0].ToString());
            //rpt.SetParameterValue("fi", e.Arguments[1].ToString());
            //rpt.SetParameterValue("ff", e.Arguments[2].ToString());
            rpt.SetParameterValue("texto", this.texto);

            e.Result = true;
        }
Example #3
0
        private void WorkerMethodRptPagEsp(object sender, WaitWindowEventArgs e)
        {
            string path = Application.StartupPath;

            path = path.Replace("\\", "/");
            path = path.Replace("/bin/Debug", "");

            path = path + "/Dominio/Reportes/rptPagEsp.rpt";

            rpt.Load(path);

            int count = 0;

            Conexion.CMD.CommandText = this.vSQL;
            using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD))
            {
                using (ReportsDS ds = new ReportsDS())
                {
                    ds.Clear();
                    da.Fill(ds, "PagEsp");
                    count = ds.Tables["PagEsp"].Rows.Count;
                    rpt.SetDataSource(ds);
                }
            }

            rpt.SetParameterValue("periodo", this.periodo);
            rpt.SetParameterValue("subtitle", this.subtitle);

            e.Result = count.ToString();
        }
Example #4
0
        private void WorkerMethodRpt(object sender, WaitWindowEventArgs e)
        {
            string path = Application.StartupPath;

            path = path.Replace("\\", "/");
            path = path.Replace("/bin/Debug", "");

            path = path + "/Dominio/Reportes/rptTotVenEsp.rpt";

            rpt.Load(path);

            Conexion.CMD.CommandText = this.sqlVenCons;

            using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD))
            {
                using (ReportsDS ds = new ReportsDS())
                {
                    ds.Clear();
                    da.Fill(ds, "VenCons");
                    rpt.SetDataSource(ds);
                }
            }

            e.Result = true;
        }
Example #5
0
        private void WorkerMethodRptProdMedCon(object sender, WaitWindowEventArgs e)
        {
            string path = Application.StartupPath;

            path = path.Replace("\\", "/");
            path = path.Replace("/bin/Debug", "");

            path = path + "/Dominio/Reportes/rptProdMedCon.rpt";

            rpt.Load(path);

            int    count = 0;
            string sql   = "SELECT X.año, X.mes, X.fecha_atencion, X.medico, X.consultorio, SUM(X.ccon) AS cantidad, SUM(X.tcon) AS total, X.turno, X.cturno, X.horas, X.colegiatura, X.sueldo from (" + this.vSQL + ") X WHERE ccon>0 GROUP BY X.año, X.mes, X.fecha_atencion, X.medico, X.consultorio, X.turno, X.cturno, X.horas, X.colegiatura, X.sueldo";

            sql = "SELECT Y.año, Y.mes, Y.fecha_atencion, Y.medico, Y.consultorio, SUM(Y.cantidad) AS cantidad, SUM(Y.total) AS total, Y.turno, Y.cturno, Y.horas, Y.colegiatura, SUM(Y.sueldo * Y.cturno) AS sueldo from (" + sql + ") Y GROUP BY Y.año, Y.mes, Y.fecha_atencion, Y.medico, Y.consultorio, Y.turno, Y.cturno, Y.horas, Y.colegiatura ORDER BY 4, 3, 8";
            Conexion.CMD.CommandText = sql;
            using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD))
            {
                using (ReportsDS ds = new ReportsDS())
                {
                    ds.Clear();
                    da.Fill(ds, "ProdMed");
                    count = ds.Tables["ProdMed"].Rows.Count;
                    rpt.SetDataSource(ds);
                }
            }

            rpt.SetParameterValue("periodo", this.periodo);
            rpt.SetParameterValue("subtitle", this.subtitle);

            e.Result = count.ToString();
        }
Example #6
0
        public override global::System.Data.DataSet Clone()
        {
            ReportsDS cln = ((ReportsDS)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Example #7
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            ReportsDS ds = new ReportsDS();

            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);
        }
Example #8
0
        private void WorkerMethodRPT(object sender, WaitWindowEventArgs e)
        {
            int    option   = (int)e.Arguments[0];
            string sql      = e.Arguments[1].ToString();
            string rptName  = e.Arguments[2].ToString();
            string rptTable = e.Arguments[3].ToString();
            string nText    = e.Arguments[4].ToString();

            //define la ruta por defecto de la app
            string path = Application.StartupPath;

            path = path.Replace("\\", "/");
            path = path.Replace("/bin/Debug", "");

            //define el reporte dependiendo del tipo de seleccion
            path = path + "/Dominio/Reportes/" + rptName + ".rpt";

            //carga el reporte
            rpt.Load(path);

            Conexion.CMD.CommandText = sql;
            using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD))
            {
                using (ReportsDS ds = new ReportsDS())
                {
                    ds.Clear();
                    da.Fill(ds, rptTable);
                    rpt.SetDataSource(ds);
                }
            }

            //setea los parametros del reporte Parte de atencion diario
            rpt.SetParameterValue("nText", nText);

            if (e.Arguments.Count > 0)
            {
                e.Result = e.Arguments[0].ToString();
            }
            else
            {
                e.Result = "Proceso culminado.";
            }
        }
Example #9
0
        private void WorkerMethodRpt(object sender, WaitWindowEventArgs e)
        {
            string path = Application.StartupPath;

            path = path.Replace("\\", "/");
            path = path.Replace("/bin/Debug", "");

            string rptName = "";
            string table   = "";

            if (rbVentas.Checked)
            {
                rptName = "rptVenxPac";
                table   = "VenxPac";
            }
            else
            {
                rptName = "rptAtenxPac";
                table   = "AtenxPac";
            }

            path = path + "/Dominio/Reportes/" + rptName + ".rpt";

            rpt.Load(path);

            Conexion.CMD.CommandText = this.sql;

            using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD))
            {
                using (ReportsDS ds = new ReportsDS())
                {
                    ds.Clear();
                    da.Fill(ds, table);
                    rpt.SetDataSource(ds);
                }
            }

            rpt.SetParameterValue("paciente", txtPaciente.Text);


            e.Result = true;
        }
Example #10
0
        private void WorkerMethodRptProdMedPrcSOP(object sender, WaitWindowEventArgs e)
        {
            string path = Application.StartupPath;

            path = path.Replace("\\", "/");
            path = path.Replace("/bin/Debug", "");

            path = path + "/Dominio/Reportes/rptProdMedPrcSOP.rpt";

            rpt.Load(path);

            int count = 0;

            string sql = "";

            if (e.Arguments[0].ToString() == "PROCEDIMIENTO")
            {
                sql = "SELECT X.año, X.mes, X.fecha_atencion, X.medico, X.consultorio, X.producto, SUM(X.cprc) AS cantidad, SUM(X.tprc) AS total, '" + e.Arguments[0].ToString() + "' AS modo, X.sueldo FROM (" + this.vSQL + ") X WHERE X.cprc > 0 GROUP BY X.año, X.mes, X.fecha_atencion, X.medico, X.consultorio, X.producto, X.sueldo ORDER BY 9, 4, 3, 5, 6";
            }
            else
            {
                sql = "SELECT X.año, X.mes, X.fecha_atencion, X.medico, X.consultorio, X.producto, SUM(X.csop) AS cantidad, SUM(X.tsop) AS total, '" + e.Arguments[0].ToString() + "' AS modo, X.sueldo FROM (" + this.vSQL + ") X WHERE X.csop > 0 GROUP BY X.año, X.mes, X.fecha_atencion, X.medico, X.consultorio, X.producto, X.sueldo ORDER BY 9, 4, 3, 5, 6";
            }

            Conexion.CMD.CommandText = sql;
            using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD))
            {
                using (ReportsDS ds = new ReportsDS())
                {
                    ds.Clear();
                    da.Fill(ds, "ProdMedPrcSOP");
                    count = ds.Tables["ProdMedPrcSOP"].Rows.Count;
                    rpt.SetDataSource(ds);
                }
            }

            rpt.SetParameterValue("periodo", this.periodo);
            rpt.SetParameterValue("subtitle", this.subtitle);

            e.Result = count.ToString();
        }
Example #11
0
        private void WorkerMethodRPT(object sender, WaitWindowEventArgs e)
        {
            //define la ruta por defecto de la app
            string path = Application.StartupPath;

            path = path.Replace("\\", "/");
            path = path.Replace("/bin/Debug", "");

            //define el reporte dependiendo del tipo de seleccion
            path = path + "/Dominio/Reportes/rptTalon.rpt";

            //carga el reporte
            rpt.Load(path);

            Conexion.CMD.CommandText = getSql(e.Arguments[0].ToString(), e.Arguments[1].ToString(), e.Arguments[2].ToString(), e.Arguments[3].ToString());
            using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD))
            {
                using (ReportsDS ds = new ReportsDS())
                {
                    ds.Clear();
                    da.Fill(ds, "Talon");
                    rpt.SetDataSource(ds);
                }
            }

            //setea los parametros del reporte Parte de atencion diario
            rpt.SetParameterValue("TituloReporte", "Talonario de documentos de venta");
            rpt.SetParameterValue("Fecha", DateTime.Now.ToLongDateString());

            if (e.Arguments.Count > 0)
            {
                e.Result = e.Arguments[0].ToString();
            }
            else
            {
                e.Result = "Proceso culminado.";
            }
        }
Example #12
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();
                ReportsDS ds = new ReportsDS();

                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 = "RptTblDataTable";
                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);
            }