Esempio n. 1
0
 protected override byte[] GetItem(byte[] id)
 {
     using (var rep = new SlotRep())
     {
         var conv = new ModelsForWpf.Converter <ModelsForWpf.Slot>();
         var us   = new Slot(conv.ByteArrayToObject(id));
         return(conv.ObjectToByteArray(Converter.ToSlot(rep.GetItem(us.Id))));
     }
 }
Esempio n. 2
0
        static public ModelsForWpf.Talon ToTalon(Talon talon)
        {
            var ret = new ModelsForWpf.Talon(talon.Id, talon.One, talon.Two, null, null);

            using (var rep = new CarRep())
                ret.Car = ToCar(rep.GetItem(talon?.Car_Id ?? -1));
            using (var rep = new SlotRep())
                ret.Slot = ToSlot(rep.GetItem(talon?.Slot_Id ?? -1));

            return(ret);
        }