public PartForSubProduct GetFromItem(XElement item)
 {
     return(new PartForSubProduct(item.Element("Id").Value,
                                  partController.Get(new Guid(item.Element("Part").Value)),
                                  subProductController.Get(new Guid(item.Element("SubProduct").Value)),
                                  item.Element("Quantity").Value,
                                  item.Element("CreationDate").Value,
                                  item.Element("ModificationDate").Value,
                                  item.Element("Status").Value));
 }
Пример #2
0
        public SubProductForTransaction GetFromItem(XElement item)
        {
            SubProductForTransaction result = new SubProductForTransaction(item.Element("Id").Value,
                                                                           subProductController.Get(new Guid(item.Element("SubProduct").Value)),
                                                                           null,
                                                                           item.Element("Quantity").Value,
                                                                           item.Element("UnitPrice").Value,
                                                                           item.Element("CreationDate").Value,
                                                                           item.Element("ModificationDate").Value,
                                                                           item.Element("Status").Value);

            BasicTransaction transaction = quoteController.Get(new Guid(item.Element("Transaction").Value));

            if (transaction == null)
            {
                transaction = saleController.Get(new Guid(item.Element("Transaction").Value));
            }
            result.Transaction = transaction;
            return(result);
        }