Пример #1
0
        public List <IDevices> ListOfDevices(string filter)
        {
            Devices dev = new Devices();

            Models.ITventoryEntities ent = new Models.ITventoryEntities();
            IDevices        test         = new ComputerViewModel();
            List <IDevices> komputery    = new List <IDevices>();

            komputery.AddRange(ent.Devices.Where(x => x.dev_Nazwa.Contains(filter)).Select(x => new ComputerViewModel()
            {
                Id        = x.dev_id,
                GAno      = x.dev_GAno,
                SilesiaNo = x.dev_SilesiaNo
            }));
            //List<IDevices> komputery = ent.Devices.Select(x => new ComputerViewModel()
            //{
            //    Id = x.dev_id,
            //    GAno = x.dev_GAno,
            //    SilesiaNo = x.dev_SilesiaNo

            //}).ToList();
            return(komputery);
        }
Пример #2
0
 private void addSaveBtn_Click(object sender, RoutedEventArgs e)
 {
     ViewModel.ComputerViewModel wnd = (ViewModel.ComputerViewModel)DataContext;
     wnd.SaveToDatabase();
     this.Close();
 }
Пример #3
0
 public AddComputer()
 {
     InitializeComponent();
     DataContext = new ViewModel.ComputerViewModel();
     //   uzytkownicyLista.ItemsSource = new ViewModel.ComputerViewModel().ListOfNames();
 }
Пример #4
0
 public AddComputer(ViewModel.ComputerViewModel model)
 {
     InitializeComponent();
     DataContext = model;
 }
Пример #5
0
 public databaseViewEditGrid()
 {
     InitializeComponent();
     DataContext = new ViewModel.ComputerViewModel().ListOfDevices();
 }