Exemplo n.º 1
0
 public Car(ModelsForWpf.Car car)
 {
     this.Id     = car.Id;
     this.RegNum = car.RegNum;
     this.Color  = car.Color;
     this.Info   = car.Info;
 }
Exemplo n.º 2
0
        static public ModelsForWpf.Car ToCar(Car car, ModelsForWpf.User owner = null)
        {
            var ret = new ModelsForWpf.Car();

            ret.Id         = car.Id;
            ret.Info       = car.Info;
            ret.RegNum     = car.RegNum;
            ret.Owner      = owner;
            ret.UserTalons = new List <ModelsForWpf.Talon>();
            using (var rep = new TalonRep())
            {
                foreach (var t in rep.GetItems())
                {
                    if (t.Car_Id == ret.Id)
                    {
                        var talon = ToTalon(t);
                        talon.Car = ret;
                        ret.UserTalons.Add(talon);
                    }
                }
            }
            return(ret);
        }