Esempio n. 1
0
        public static OrderProduct ToOrderProduct(OrderProductViewModel orderProduct)
        {
            OrderProduct vm = new OrderProduct
            {
                Id          = orderProduct.Id,
                GenotypeId  = orderProduct.GenotypeId,
                MaterialId  = orderProduct.MaterialId,
                OrderId     = orderProduct.OrderId,
                Quantity    = orderProduct.Quantity,
                Note        = orderProduct.Note,
                VirusTested = orderProduct.VirusTested,
                DateSent    = orderProduct.DateSent
            };

            return(vm);
        }
Esempio n. 2
0
        public static OrderProductViewModel Create(OrderProduct op)
        {
            OrderProductViewModel vm = new OrderProductViewModel
            {
                Id           = op.Id,
                GenotypeId   = op.GenotypeId,
                MaterialId   = op.MaterialId,
                OrderId      = op.OrderId,
                Quantity     = op.Quantity,
                Note         = op.Note,
                VirusTested  = op.VirusTested,
                GenotypeName = op.Genotype.Name,
                GenotypeVM   = op.Genotype.ToGenotypeVM(),
                DateSent     = op.DateSent
            };

            return(vm);
        }