コード例 #1
0
 public static Ticket MapFromEntity(data.Entities.Ticket entity)
 {
     return(new Ticket()
     {
         TicketId = entity.TicketId,
         VendorId = entity.VendorId,
         Vendor = Vendor.MapFromEntity(entity.Vendor),
         AccountId = entity.AccountId,
         Account = Account.MapFromObject(entity.vAccount),
         MaterialVendorId = entity.MaterialVendorId,
         MaterialVendor = MaterialVendor.MapFromEntity(entity.MaterialVendor),
         TicketNumber = entity.TicketNumber,
         Date = entity.Date,
         Quantity = entity.Quantity,
         Cost = entity.Cost,
         InvoiceId = entity.InvoiceId,
         Invoice = Invoice.MapFromEntity(entity.Invoice)
     });
 }
コード例 #2
0
ファイル: Material.cs プロジェクト: RyanLadley/DtsOps
        public static Material MapFromEntity(data.Entities.Material entity, bool includeVendor = false)
        {
            var materialVendors = new List <MaterialVendor>();

            if (includeVendor)
            {
                foreach (var material in entity.MaterialVendors)
                {
                    materialVendors.Add(MaterialVendor.MapFromEntity(material, false));
                }
            }

            return(new Material()
            {
                MaterialId = entity.MaterialId,
                Name = entity.Name,
                Unit = entity.Unit,
                MaterialVendors = (includeVendor) ? materialVendors : null
            });
        }