示例#1
0
        public System.IO.Stream GetStream(object args)
        {
            OrderShipmentProviderParameters _args = new OrderShipmentProviderParameters();

            _args = args as OrderShipmentProviderParameters;
            _args.tagnamespace = "http://kaifa.b2b.schemas/OrderShipment";
            string orderkey = GetOrderKey(_args);

            if (!string.IsNullOrEmpty(orderkey))
            {
                MemoryStream      ms  = new MemoryStream();
                XmlWriterSettings xws = new XmlWriterSettings();
                xws.OmitXmlDeclaration = true;
                xws.Indent             = true;

                using (XmlWriter xw = XmlWriter.Create(ms, xws))
                {
                    OrderShipmentGenerator report = new OrderShipmentGenerator(orderkey, _args.configPath, _args.fromRole, _args.tostxRole, _args.toe2openRole, _args.warehous, _args.connectionstring, _args.tagnamespace);
                    XDocument doc = report.Generator();
                    doc.WriteTo(xw);
                }
                ms.Seek(0, SeekOrigin.Begin);
                //System.Diagnostics.Trace.WriteLine("");


                UpdateFlag(_args, orderkey);
                System.Diagnostics.Trace.WriteLine(string.Format("Create OrderShipment {0}", orderkey), "OrderShipmentProvider");
                return(ms);
            }
            else
            {
                return(null);
            }
        }
        public System.IO.Stream GetStream(object args)
        {
            OrderShipmentProviderParameters _args = new OrderShipmentProviderParameters();
            _args = args as OrderShipmentProviderParameters;
            _args.tagnamespace = "http://kaifa.b2b.schemas/OrderShipment";
            string orderkey = GetOrderKey(_args);
            if (!string.IsNullOrEmpty(orderkey))
            {

                MemoryStream ms = new MemoryStream();
                XmlWriterSettings xws = new XmlWriterSettings();
                xws.OmitXmlDeclaration = true;
                xws.Indent = true;

                using (XmlWriter xw = XmlWriter.Create(ms, xws))
                {
                    OrderShipmentGenerator report = new OrderShipmentGenerator(orderkey, _args.configPath, _args.fromRole, _args.tostxRole, _args.toe2openRole, _args.warehous, _args.connectionstring, _args.tagnamespace);
                    XDocument doc = report.Generator();
                    doc.WriteTo(xw);
                }
                ms.Seek(0, SeekOrigin.Begin);
                //System.Diagnostics.Trace.WriteLine("");


                UpdateFlag(_args, orderkey);
                System.Diagnostics.Trace.WriteLine(string.Format("Create OrderShipment {0}", orderkey), "OrderShipmentProvider");
                return ms;


                
            }
            else
            {
                return null;
            }
        }