Ejemplo n.º 1
0
        public override global::System.Data.DataSet Clone()
        {
            OutsoleDeliveryDataSet cln = ((OutsoleDeliveryDataSet)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Ejemplo n.º 2
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            OutsoleDeliveryDataSet ds = new OutsoleDeliveryDataSet();

            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);
        }
        private void bwReport_DoWork(object sender, DoWorkEventArgs e)
        {
            outsoleRawMaterialList = OutsoleRawMaterialController.Select();
            outsoleMaterialList    = OutsoleMaterialController.SelectByOutsoleRawMaterial();
            sizeRunList            = SizeRunController.SelectByOutsoleRawMaterial();
            outsoleSupplierList    = OutsoleSuppliersController.Select();
            ordersList             = OrdersController.SelectByOutsoleRawMaterial();

            DataTable dt = new OutsoleDeliveryDataSet().Tables["OutsoleDeliveryTable"];

            List <String> productNoList = outsoleRawMaterialList.Select(r => r.ProductNo).Distinct().ToList();

            foreach (string productNo in productNoList)
            {
                OrdersModel order = ordersList.Where(o => o.ProductNo == productNo).FirstOrDefault();
                List <OutsoleRawMaterialModel> outsoleRawMaterialOfProductNoList = outsoleRawMaterialList.Where(o => o.ProductNo == productNo).ToList();
                List <SizeRunModel>            sizeRunOfProductNoList            = sizeRunList.Where(s => s.ProductNo == productNo).ToList();
                List <OutsoleMaterialModel>    outsoleMaterialOfProductNoList    = outsoleMaterialList.Where(o => o.ProductNo == productNo).ToList();
                foreach (OutsoleRawMaterialModel outsoleRawMaterial in outsoleRawMaterialOfProductNoList)
                {
                    DateTime etd    = outsoleRawMaterial.ETD.Date;
                    bool     isFull = OutsoleRawMaterialController.IsFull(sizeRunOfProductNoList, new List <OutsoleRawMaterialModel>()
                    {
                        outsoleRawMaterial,
                    }, outsoleMaterialOfProductNoList);
                    if (etd != new DateTime(2000, 1, 1) && etd == dateSearch.Date && isFull == false)
                    {
                        DataRow dr = dt.NewRow();
                        dr["ProductNo"] = productNo;
                        if (order != null)
                        {
                            dr["ArticleNo"]   = order.ArticleNo;
                            dr["OutsoleCode"] = order.OutsoleCode;
                            dr["Quantity"]    = order.Quantity;
                            dr["ETD"]         = order.ETD;
                        }
                        dr["SupplierETD"] = etd;
                        dr["Remarks"]     = sizeRunOfProductNoList.Sum(s => (s.Quantity - outsoleMaterialOfProductNoList.Where(o => o.OutsoleSupplierId == outsoleRawMaterial.OutsoleSupplierId && o.SizeNo == s.SizeNo).Sum(o => (o.Quantity - o.QuantityReject)))).ToString();
                        OutsoleSuppliersModel outsoleSupplier = outsoleSupplierList.Where(o => o.OutsoleSupplierId == outsoleRawMaterial.OutsoleSupplierId).FirstOrDefault();
                        if (outsoleSupplier != null)
                        {
                            dr["Supplier"] = outsoleSupplier.Name;
                        }

                        dt.Rows.Add(dr);
                    }
                }
            }
            e.Result = dt;
        }
Ejemplo n.º 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();
                OutsoleDeliveryDataSet ds = new OutsoleDeliveryDataSet();

                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 = "OutsoleDeliveryTableDataTable";
                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);
            }
Ejemplo n.º 5
0
        private void bwReport_DoWork(object sender, DoWorkEventArgs e)
        {
            reportList = ReportController.GetOutsoleDeliveryFromTo(dateSearchFrom, dateSearchTo);
            //outsoleRawMaterialList = OutsoleRawMaterialController.Select();
            //outsoleMaterialList = OutsoleMaterialController.SelectByOutsoleRawMaterial();
            //sizeRunList = SizeRunController.SelectByOutsoleRawMaterial();
            //outsoleSupplierList = OutsoleSuppliersController.Select();
            //ordersList = OrdersController.SelectByOutsoleRawMaterial();

            DataTable dt = new OutsoleDeliveryDataSet().Tables["OutsoleDeliveryTable"];

            foreach (var report in reportList)
            {
                DataRow dr = dt.NewRow();
                dr["ProductNo"]        = report.ProductNo;
                dr["ArticleNo"]        = report.ArticleNo;
                dr["OutsoleCode"]      = report.OutsoleCode;
                dr["Quantity"]         = report.Quantity;
                dr["ETD"]              = report.ETD;
                dr["QuantityDelivery"] = report.QuantityDelivery;
                dr["Reject"]           = report.Reject > 0 ? report.Reject.ToString() : "";
                dr["Remarks"]          = report.Balance > 0 ? report.Balance.ToString() : "";
                dr["SupplierETD"]      = report.SupplierEFD;
                dr["Supplier"]         = report.SupplierName;

                dt.Rows.Add(dr);
            }

            //List<String> productNoList = outsoleRawMaterialList.Select(r => r.ProductNo).Distinct().ToList();
            //foreach (string productNo in productNoList)
            //{
            //    OrdersModel order = ordersList.FirstOrDefault(f => f.ProductNo == productNo);
            //    List<OutsoleRawMaterialModel> outsoleRawMaterialOfProductNoList = outsoleRawMaterialList.Where(o => o.ProductNo == productNo).ToList();
            //    List<SizeRunModel> sizeRunOfProductNoList = sizeRunList.Where(s => s.ProductNo == productNo).ToList();
            //    List<OutsoleMaterialModel> outsoleMaterialOfProductNoList = outsoleMaterialList.Where(o => o.ProductNo == productNo).ToList();
            //    foreach (OutsoleRawMaterialModel outsoleRawMaterial in outsoleRawMaterialOfProductNoList)
            //    {
            //        DateTime etd = outsoleRawMaterial.ETD.Date;
            //        bool isFull = OutsoleRawMaterialController.IsFull(sizeRunOfProductNoList, new List<OutsoleRawMaterialModel>() { outsoleRawMaterial, }, outsoleMaterialOfProductNoList);
            //        if (etd != new DateTime(2000, 1, 1) && (etd >= dateSearchFrom.Date && etd <= dateSearchTo.Date) && isFull == false)
            //        {
            //            DataRow dr = dt.NewRow();
            //            dr["ProductNo"] = productNo;
            //            if (order != null)
            //            {
            //                dr["ArticleNo"] = order.ArticleNo;
            //                dr["OutsoleCode"] = order.OutsoleCode;
            //                dr["Quantity"] = order.Quantity;
            //                dr["ETD"] = order.ETD;
            //            }
            //            dr["SupplierETD"] = etd;
            //            dr["Remarks"] = sizeRunOfProductNoList.Sum(s => (s.Quantity - outsoleMaterialOfProductNoList.Where(o => o.OutsoleSupplierId == outsoleRawMaterial.OutsoleSupplierId && o.SizeNo == s.SizeNo).Sum(o => (o.Quantity - o.QuantityReject)))).ToString();
            //            OutsoleSuppliersModel outsoleSupplier = outsoleSupplierList.FirstOrDefault(f => f.OutsoleSupplierId == outsoleRawMaterial.OutsoleSupplierId);
            //            if (outsoleSupplier != null)
            //            {
            //                dr["Supplier"] = outsoleSupplier.Name;
            //            }

            //            dt.Rows.Add(dr);
            //        }
            //    }
            //}
            e.Result = dt;
        }