public void SetEngineVolumes(List <KVPBase> data)
 {
     data = data.OrderBy(p => p.Name).ToList();
     EngineVolumes.Clear();
     foreach (var item in data)
     {
         EngineVolumes.Add(item);
     }
 }
Пример #2
0
 public void SetEngineVolumes(List <KVPBase> data)
 {
     data = data.OrderBy(p => p.Name).ToList();
     EngineVolumes.Clear();
     data.ForEach(o => EngineVolumes.Add(o));
     if (LoadEnginsComplete != null)
     {
         LoadEnginsComplete(this, new EventArgs());
     }
 }
Пример #3
0
        void DemoData()
        {
            for (var i = 1; i <= 5; i++)
            {
                _posts.Add(new PostModel
                {
                    Id       = i,
                    Name     = string.Format("Пост № {0:00}", i),
                    TimeFrom = new TimeSpan(i % 2 == 0 ? 8 : 9, 0, 0),
                    TimeTo   = new TimeSpan(i % 2 == 0 ? 19 : 18, 0, 0)
                });
            }
            _orders.Add(new OrderModel
            {
                OrderNumer = 1,
                Car        = new CarViewModel("Demo 1"),
                DateWork   = DateTime.Now.AddHours(1).AddMinutes(25),
                DtCreate   = DateTime.Now,
                PostId     = 4,
                UserId     = 1
            });
            _orders.Add(new OrderModel
            {
                OrderNumer = 2,
                Car        = new CarViewModel("Demo 2"),
                DateWork   = DateTime.Now.AddHours(3).AddMinutes(32),
                DtCreate   = DateTime.Now,
                PostId     = 2,
                UserId     = 2
            });
            _users.Add(new UserLightModel {
                Id = 1, Nm = "Иванов Иван Иванович"
            });
            _users.Add(new UserLightModel {
                Id = 2, Nm = "Петров Петр Петрович"
            });

            _works.Add(new WorksInfoDataModel {
                Name = "Периодические", Id = 1, IdParent = 0
            });
            _works.Add(new WorksInfoDataModel {
                Name = "Остальные", Id = 2, IdParent = 0
            });
            // Значение NavUrl = Id для работы и пустое для подгруппы
            _works.Add(new WorksInfoDataModel {
                Name = "Двигатель", Id = 3, IdParent = 1, NavUrl = "3", Nh = 15
            });
            _works.Add(new WorksInfoDataModel {
                Name = "КПП", Id = 4, IdParent = 2, NavUrl = "4", Nh = 5
            });

            for (var i = 1; i < 5; i++)
            {
                Marks.Add(new KVPBase {
                    id = i, Name = "Марка " + i
                });
                Models.Add(new KVPBase {
                    id = i, Name = "Модель " + i
                });
                BodyTypes.Add(new KVPBase {
                    id = i, Name = "Тип кузова " + i
                });
                EngineTypes.Add(new KVPBase {
                    id = i, Name = "Тип двигателя " + i
                });
                EngineVolumes.Add(new KVPBase {
                    id = i, Name = string.Format("{0} л", i / 2.0)
                });
            }
            TransTypes.Add(new KVPBase {
                id = 1, Name = "автомат"
            });
            TransTypes.Add(new KVPBase {
                id = 2, Name = "механика"
            });
        }