コード例 #1
0
ファイル: CheckTicket.cs プロジェクト: SokolSib/FRANCE
        public static CheckTicket FromCheckXElement(XElement element, Guid customerId, Guid closeTicketCustomerId)
        {
            var checkTicket = new CheckTicket(FromXElement(element, customerId))
            {
                BarCode = element.GetXAttributeValue("barcodeCheck"),
                Date    = element.GetXAttributeValue("date").ToDateTime(),
                CloseTicketCustomerId = closeTicketCustomerId,
                TotalTtc = element.GetXAttributeValue("sum").ToDecimal(),
                Rendu    = element.GetXAttributeValue("Rendu").ToDecimal()
            };
            var returnBarCodeAttribute = element.GetXAttributeOrNull("returnBarcodeCheck");

            if (returnBarCodeAttribute != null)
            {
                checkTicket.ReturnBarCode = returnBarCodeAttribute.Value;
            }

            if (element.Attribute("DCBC") != null)
            {
                checkTicket.CheckDiscount = CloseTicketCheckDiscount.FromXElement(element, Guid.NewGuid(), closeTicketCustomerId);
            }

            foreach (var el in element.Elements("product"))
            {
                checkTicket.PayProducts.Add(PayProduct.FromCheckXElement(el, Guid.NewGuid(), checkTicket.CustomerId, closeTicketCustomerId));
            }

            return(checkTicket);
        }
コード例 #2
0
ファイル: PayProduct.cs プロジェクト: SokolSib/FRANCE
 public static XElement ToXElement(PayProduct obj)
 {
     return(new XElement("rec",
                         new XElement("IdCheckTicket", obj.IdCheckTicket),
                         new XElement("ProductId", obj.ProductId),
                         new XElement("Name", obj.Name),
                         new XElement("Barcode", obj.Barcode),
                         new XElement("Qty", obj.Qty),
                         new XElement("Tva", obj.Tva),
                         new XElement("PriceHt", obj.PriceHt),
                         new XElement("Total", obj.Total),
                         new XElement("ChecksTicketCustomerId", obj.ChecksTicketCustomerId),
                         new XElement("ChecksTicketCloseTicketCustomerId", obj.ChecksTicketCloseTicketCustomerId),
                         new XElement("Discount", obj.Discount),
                         new XElement("SumDiscount", obj.SumDiscount)));
 }