Exemplo n.º 1
0
 protected override Component NewRecord(IDataReader reader)
 {
     return(new Component
     {
         Id = ConvertReader <int> .WithName(reader, "ID"),
         Name = ConvertReader <string> .WithName(reader, "Name"),
         Price = ConvertReader <decimal> .WithName(reader, "Price"),
         PerfomanceLevel = ConvertReader <int> .WithName(reader, "Perfomance"),
         TypePart = ConvertReader <TypePart> .EnumWithName(reader, "TypePart"),
         TypeFormat = ConvertReader <TypeFormat> .EnumWithName(reader, "TypeFormat"),
         TypeMemory = ConvertReader <TypeMemory> .EnumWithName(reader, "TypeMemory"),
         Socket = ConvertReader <string> .WithName(reader, "Socket"),
         HasIntegratedVideo = ConvertReader <bool> .WithName(reader, "HasIntegratedVideo"),
         Channels = ConvertReader <int> .WithName(reader, "Channels"),
         VideoLevel = ConvertReader <int> .WithName(reader, "VideoLevel"),
         FanLevel = ConvertReader <int> .WithName(reader, "FanLevel"),
         NeedHighFrecuency = ConvertReader <bool> .WithName(reader, "NeedHighFrecuency"),
         Capacity = ConvertReader <int> .WithName(reader, "Capacity"),
         FanSize = ConvertReader <int> .WithName(reader, "FanSize"),
         MaxFrecuency = ConvertReader <int> .WithName(reader, "MaxFrecuency"),
         Stock = ConvertReader <int> .WithName(reader, "Stock"),
         Watts = ConvertReader <int> .WithName(reader, "Watts"),
         StockLimit = ConvertReader <int> .WithName(reader, "Stock_Limit")
     });
 }
Exemplo n.º 2
0
 protected override Employee NewRecord(IDataReader reader)
 {
     return(new Employee()
     {
         Email = ConvertReader <string> .WithName(reader, "Email")
     });
 }
Exemplo n.º 3
0
 protected override ISpecification NewRecord(IDataReader reader)
 {
     return(new Specification(ConvertReader <int> .WithName(reader, "Cpu"),
                              ConvertReader <int> .WithName(reader, "Fan"),
                              ConvertReader <int> .WithName(reader, "Ram"),
                              ConvertReader <int> .WithName(reader, "Gpu"),
                              ConvertReader <int> .WithName(reader, "HDD"),
                              ConvertReader <int> .WithName(reader, "SSD"),
                              ConvertReader <string> .WithName(reader, "Name")));
 }
Exemplo n.º 4
0
 protected override Client NewRecord(IDataReader reader)
 {
     return(new Client()
     {
         Name = ConvertReader <string> .WithName(reader, "Name"),
         Number = ConvertReader <string> .WithName(reader, "Number"),
         Email = ConvertReader <string> .WithName(reader, "Email"),
         Adress = ConvertReader <string> .WithName(reader, "Adress")
     });
 }
Exemplo n.º 5
0
        protected override Computer NewRecord(IDataReader reader)
        {
            var computer = new Computer()
            {
                Id         = ConvertReader <int> .WithName(reader, "ID"),
                TypeUse    = ConvertReader <string> .WithName(reader, "TypeUse"),
                Completed  = ConvertReader <bool> .WithName(reader, "Completed"),
                CostBuild  = costRepo.BuildCost,
                Multiplier = costRepo.PricePerfomanceMultiplier
            };

            foreach (var component in componentRepository.GetByComputer(ConvertReader <int> .WithName(reader, "ID")))
            {
                computer.Add(component);
            }
            return(computer);
        }
Exemplo n.º 6
0
        protected override Order NewRecord(IDataReader reader)
        {
            var order = new Order
            {
                Id            = ConvertReader <int> .WithName(reader, "id"),
                DateRequested = ConvertReader <DateTime> .WithName(reader, "DateRequested"),
                DateDelivered = ConvertReader <DateTime> .WithName(reader, "DateDelivered"),
                Employee      = EmployeeRepository.GetByName(ConvertReader <string> .WithName(reader, "Email_Employee")),
                Client        = ClientRepository.GetByEmail(ConvertReader <string> .WithName(reader, "Email_client")),
                Commentary    = ConvertReader <string> .WithName(reader, "Commentary"),
                State         = ConvertReader <OrderState> .WithName(reader, "OrderState")
            };

            foreach (var computer in ComputerRepository.GetByOrder(ConvertReader <int> .WithName(reader, "id")).ToList())
            {
                order.Add(computer);
            }
            return(order);
        }