Exemplo n.º 1
0
        //convertimos las fila de la array de row en una row tipo ordersSummarierow
        public BillingDataSet.OrdersSummariesRow CreateRowOrderSummaries2(DataRow[] OrderSummaries2)
        {
            BillingDataSet ds = new BillingDataSet();

            BillingDataSetTableAdapters.OrdersSummariesTableAdapter adapt = new BillingDataSetTableAdapters.OrdersSummariesTableAdapter();
            var rowOrder_summarie = ds.OrdersSummaries.NewOrdersSummariesRow();

            rowOrder_summarie.Reference       = OrderSummaries2[0]["Reference"].ToString().Trim();
            rowOrder_summarie.Code            = OrderSummaries2[0]["Code"].ToString().Trim();
            rowOrder_summarie.Name            = OrderSummaries2[0]["Name"].ToString().Trim();
            rowOrder_summarie.Address         = OrderSummaries2[0]["Address"].ToString().Trim();
            rowOrder_summarie.RequestedAmount = Convert.ToInt32(OrderSummaries2[0]["RequestedAmount"]);
            rowOrder_summarie.TankVolume      = Convert.ToDouble(OrderSummaries2[0]["TankVolume"]);
            rowOrder_summarie.TankLevel       = Convert.ToInt32(OrderSummaries2[0]["TankLevel"]);
            rowOrder_summarie.OperatorId      = Convert.ToInt32(OrderSummaries2[0]["OperatorId"]);
            rowOrder_summarie.Latitude        = float.Parse(OrderSummaries2[0]["Latitude"].ToString());
            rowOrder_summarie.Longitude       = float.Parse(OrderSummaries2[0]["Longitude"].ToString());
            rowOrder_summarie.StartDate       = Convert.ToDateTime(OrderSummaries2[0]["StartDate"].ToString());
            rowOrder_summarie.FinalDate       = Convert.ToDateTime(OrderSummaries2[0]["FinalDate"].ToString());
            rowOrder_summarie.FactoryId       = Convert.ToInt32(OrderSummaries2[0]["FactoryId"]);
            rowOrder_summarie.ProductId       = Convert.ToInt32(OrderSummaries2[0]["ProductId"]);
            rowOrder_summarie.VehicleSize     = Convert.ToInt32(OrderSummaries2[0]["VehicleSize"]);

            return(rowOrder_summarie);
        }
Exemplo n.º 2
0
        public override global::System.Data.DataSet Clone()
        {
            BillingDataSet cln = ((BillingDataSet)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Exemplo n.º 3
0
        public BillingDataSet.CompareDataOrderCepsaRow GetCompareMoreDataCepsa(string reference)
        {
            BillingDataSet ds = new BillingDataSet();

            BillingDataSetTableAdapters.CompareDataOrderCepsaTableAdapter adapt = new BillingDataSetTableAdapters.CompareDataOrderCepsaTableAdapter();

            return(adapt.GetDataMoreDataCompareByReference(reference.Trim())[0]);
        }
Exemplo n.º 4
0
        //creamos lista estatica (pedidos que provienen de cepsa)
        public BillingDataSet.OrdersSummariesDataTable createSecondList()
        {
            BillingDataSet ds = new BillingDataSet();

            BillingDataSetTableAdapters.OrdersSummariesTableAdapter adapt = new BillingDataSetTableAdapters.OrdersSummariesTableAdapter();
            BillingDataSet.OrdersSummariesDataTable orderSummaries2       = new BillingDataSet.OrdersSummariesDataTable();
            var rowOrder_summarie = ds.OrdersSummaries.NewOrdersSummariesRow();

            //primer registro
            rowOrder_summarie.Reference       = "CEG182411474887";
            rowOrder_summarie.Code            = "0002";
            rowOrder_summarie.Address         = "Indocin2";
            rowOrder_summarie.Name            = "jose";
            rowOrder_summarie.RequestedAmount = 817;
            rowOrder_summarie.TankVolume      = 45;
            rowOrder_summarie.TankLevel       = 56;
            rowOrder_summarie.OperatorId      = 1000;
            rowOrder_summarie.Latitude        = 1000;
            rowOrder_summarie.Longitude       = 1000;
            rowOrder_summarie.ClientId        = 7138;
            rowOrder_summarie.StartDate       = DateTime.Now;
            rowOrder_summarie.FinalDate       = DateTime.Now;
            rowOrder_summarie.FactoryId       = 13;
            rowOrder_summarie.ProductId       = 355;
            rowOrder_summarie.VehicleSize     = 8;
            //agregamos primer registro
            ds.OrdersSummaries.AddOrdersSummariesRow(rowOrder_summarie);

            //segundo registro
            var rowOrder_summarie2 = ds.OrdersSummaries.NewOrdersSummariesRow();

            rowOrder_summarie2.Reference       = "PV18009779";
            rowOrder_summarie2.Code            = "0001";
            rowOrder_summarie2.Address         = "AV LOPEZ BLANCO SN";
            rowOrder_summarie2.Name            = "jose";
            rowOrder_summarie2.RequestedAmount = 34;
            rowOrder_summarie2.TankVolume      = 45;
            rowOrder_summarie2.TankLevel       = 56;
            rowOrder_summarie2.OperatorId      = 1000;
            rowOrder_summarie2.Latitude        = 1000;
            rowOrder_summarie2.Longitude       = 1000;
            rowOrder_summarie2.ClientId        = 7138;
            rowOrder_summarie2.StartDate       = DateTime.Now;
            rowOrder_summarie2.FinalDate       = DateTime.Now;
            rowOrder_summarie2.FactoryId       = 13;
            rowOrder_summarie2.ProductId       = 355;
            rowOrder_summarie2.VehicleSize     = 8;
            //agregamos segundo registro
            ds.OrdersSummaries.AddOrdersSummariesRow(rowOrder_summarie2);

            //guardamos la tabla
            orderSummaries2 = ds.OrdersSummaries;

            //devolvemos la tabla
            return(orderSummaries2);
        }
Exemplo n.º 5
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            BillingDataSet ds = new BillingDataSet();

            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);
        }
Exemplo n.º 6
0
        public ActionResult Reportexport(int id)
        {
            var            model   = itemService.GetSingle(id);
            BillingDataSet dataset = new BillingDataSet();
            DataTable      table   = new DataTable();

            table = dataset.Barcode;
            ReportDocument report = new ReportDocument();

            report.Load(Path.Combine(Server.MapPath("~/Reports/billdelivery.rpt")));
            report.SetDataSource(table);
            Response.Buffer = false;
            Response.ClearContent();
            Response.ClearHeaders();
            Stream stream = report.ExportToStream
                                (CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

            stream.Seek(0, SeekOrigin.Begin);
            return(File(stream, "application/pdf", "Barcode.pdf"));
        }
Exemplo n.º 7
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();
                BillingDataSet ds = new BillingDataSet();

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