private void buttonTraziOpremu_Click(object sender, RoutedEventArgs e) { TempOprema.Clear(); foreach (var oprema in Oprema) { switch (SelectedKriterijum) { case "Sifra": //if (oprema.Sifra.IndexOf(Pretraga, StringComparison.CurrentCultureIgnoreCase) != -1) //{ TempOprema.Add(oprema); //} break; case "Sala": //if (oprema.Sifra.IndexOf(Pretraga, StringComparison.CurrentCultureIgnoreCase) != -1) //{ TempOprema.Add(oprema); //} break; default: TempOprema.Add(oprema); break; } } }
private void UpdateTempOprema() { Oprema.Clear(); TempOprema.Clear(); List <ConsumableEquipment> cons = ec.ViewConsumableEquipment(); if (cons != null) { foreach (ConsumableEquipment e in cons) { Oprema oprema = new Oprema(); //oprema.Naziv = e.Name; oprema.Kolicina = e.Quantity; //oprema.Sala = e.Id; oprema.Tip = TypeOfEquipment.CONSUMABLE; oprema.VrstaP = e.Type; oprema.Sifra = e.Id; oprema.Sala = erc.viewEquipmentInRooms(e.Id); Oprema.Add(oprema); } } List <NonConsumableEquipment> nCons = ec.ViewNonConsumableEquipment(); if (nCons != null) { foreach (NonConsumableEquipment e in nCons) { Oprema oprema = new Oprema(); //oprema.Naziv = e.Name; //oprema.Kolicina = e.Quantity; //oprema.Sala = e.Id; oprema.Tip = TypeOfEquipment.NON_CONSUMABLE; oprema.VrstaN = e.Type; oprema.Sifra = e.Id; oprema.Sala = erc.viewEquipmentInRooms(e.Id); Oprema.Add(oprema); } } foreach (var oprema in Oprema) { TempOprema.Add(oprema); } }