Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 private void addSaveBtn_Click(object sender, RoutedEventArgs e)
 {
     ViewModel.ComputerViewModel wnd = (ViewModel.ComputerViewModel)DataContext;
     wnd.SaveToDatabase();
     this.Close();
 }
Ejemplo n.º 3
0
 public AddComputer()
 {
     InitializeComponent();
     DataContext = new ViewModel.ComputerViewModel();
     //   uzytkownicyLista.ItemsSource = new ViewModel.ComputerViewModel().ListOfNames();
 }
Ejemplo n.º 4
0
 public AddComputer(ViewModel.ComputerViewModel model)
 {
     InitializeComponent();
     DataContext = model;
 }
Ejemplo n.º 5
0
 public databaseViewEditGrid()
 {
     InitializeComponent();
     DataContext = new ViewModel.ComputerViewModel().ListOfDevices();
 }