Exemplo n.º 1
0
 private void WriteSingleResources(XmlWriter writer, IEnumerable <PreCompiledSingleResource> resources)
 {
     using (writer.Element("singleResources"))
     {
         foreach (var resource in resources)
         {
             using (writer.Element("resource", originalPath => resource.OriginalPath, compiledPath => resource.CompiledPath)) {}
         }
     }
 }
Exemplo n.º 2
0
 private void WriteResourceGroups(XmlWriter writer, IEnumerable <PreCompiledResourceGroup> groups)
 {
     using (writer.Element("groups"))
     {
         foreach (var @group in groups)
         {
             using (writer.Element("group", consolidatedUrl => @group.ConsolidatedUrl))
             {
                 foreach (var resource in @group.Resources)
                 {
                     using (writer.Element("resource", path => resource)) {}
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 private void WriteResourceReport(XmlWriter writer, string elementName, PreCompiledResourceReport resourceReport)
 {
     using (writer.Element(elementName))
     {
         WriteResourceGroups(writer, resourceReport.Groups);
         WriteSingleResources(writer, resourceReport.SingleResources);
     }
 }
Exemplo n.º 4
0
 private void SendSourceRef(XmlWriter xw, SourceRef sourceref)
 {
     using (xw.Element("source-loc"))
     {
         xw.Attribute("srcid", sourceref.SourceIdx)
         .Attribute("cf", sourceref.FromChar)
         .Attribute("ct", sourceref.ToChar)
         .Attribute("lf", sourceref.FromLine)
         .Attribute("lt", sourceref.ToLine);
     }
 }
Exemplo n.º 5
0
        public static void Waybill(ISession session, XmlWriter writer, Document document)
        {
            Order order = null;

            if (document.OrderId != null)
            {
                order = session.Get <Order>(document.OrderId.Value);
            }

            var lines = document.Lines;

            if (!lines.Any())
            {
                return;
            }

            writer.WriteStartElement("PACKET");
            writer.WriteAttributeString("NAME", "Электронная накладная");
            writer.WriteAttributeString("ID", document.ProviderDocumentId);
            writer.WriteAttributeString("FROM", document.Supplier.Name);
            writer.WriteAttributeString("TYPE", "12");

            writer.WriteStartElement("SUPPLY");
            writer.Element("INVOICE_NUM", document.ProviderDocumentId);
            writer.Element("INVOICE_DATE", document.DocumentDate.Value.ToString("dd.MM.yyyy"));
            writer.Element("DEP_ID", null);
            if (order != null)
            {
                writer.Element("ORDER_ID", order.ClientOrderId);
            }

            writer.WriteStartElement("ITEMS");
            foreach (var line in lines)
            {
                writer.WriteStartElement("ITEM");
                writer.Element("CODE", line.Code);
                writer.Element("NAME", line.Product);
                writer.Element("VENDOR", line.Producer);
                writer.Element("QTTY", line.Quantity);
                writer.Element("SPRICE", line.SupplierCostWithoutNDS);
                writer.Element("VPRICE", line.ProducerCostWithoutNDS);
                writer.Element("NDS", line.Nds);
                writer.Element("SNDSSUM", line.NdsAmount);
                writer.Element("SERIA", line.SerialNumber);
                writer.Element("VALID_DATE", line.Period);
                writer.Element("GTD", line.BillOfEntryNumber);
                writer.Element("SERT_NUM", line.Certificates);
                writer.Element("VENDORBARCODE", line.EAN13.Slice(12));
                writer.Element("REG_PRICE", line.RegistryCost);
                writer.Element("ISGV", line.VitallyImportant);
                writer.WriteEndElement();
            }
            writer.WriteEndElement();

            writer.WriteEndElement();

            writer.WriteEndElement();
        }
Exemplo n.º 6
0
        private static void ExportOffer(XmlWriter writer, NamedOffer offer)
        {
            writer.WriteStartElement("ITEM");

            writer.Element("CODE", String.Concat(offer.Code, offer.CodeCr));
            writer.Element("ACODE", offer.ProductId);
            writer.Element("ACODECR", offer.CodeFirmCr);
            writer.Element("NAME", offer.ProductSynonym);
            writer.Element("VENDOR", offer.ProducerSynonym);
            writer.Element("VENDORBARCODE", offer.EAN13.Slice(12));
            writer.Element("QTTY", offer.Quantity);
            writer.Element("VALID_DATE", offer.NormalizedPeriod);
            writer.Element("ISBAD", offer.Junk ? 1 : 0);
            writer.Element("COMMENT", offer.Note);
            writer.Element("XCODE", offer.Id.CoreId);
            writer.Element("MINQTTY", offer.MinOrderCount);
            writer.Element("MINSUM", offer.OrderCost);
            writer.Element("PACKQTTY", offer.RequestRatio);

            writer.WriteStartElement("PRICES");
            writer.Element("Базовая", offer.Cost);
            writer.WriteEndElement();

            writer.WriteEndElement();
        }