Пример #1
0
        static public ModelsForWpf.Parking ToParking(Parking parking)
        {
            var ret = new ModelsForWpf.Parking(parking.Id, parking.Name, parking.Adress, new List <ModelsForWpf.Slot>());

            using (var slotRep = new SlotRep())
            {
                foreach (var s in slotRep.GetItems())
                {
                    if (s.Parking_Id == ret.Id)
                    {
                        ret.Slots.Add(ToSlot(s, ret));
                    }
                }
            }
            return(ret);
        }
Пример #2
0
        static public ModelsForWpf.Slot ToSlot(Slot slot, ModelsForWpf.Parking p = null)
        {
            var ret = new ModelsForWpf.Slot(slot.Id, new List <ModelsForWpf.Talon>(), slot.XCord, slot.YCord, null);

            using (var talonRep = new TalonRep())
            {
                foreach (var t in talonRep.GetItems())
                {
                    if (t.Slot_Id == ret.Id)
                    {
                        ret.Talons.Add(ToTalon(t));
                    }
                }
            }

            ret.Parking = p;
            return(ret);
        }
Пример #3
0
 public Parking(ModelsForWpf.Parking parking)
 {
     this.Id     = parking.Id;
     this.Name   = parking.Name;
     this.Adress = parking.Adress;
 }