public PodaciOKupcuProzor() { InitializeComponent(); this.DataContext = this; SmartSoftwareServiceInterfaceClient service = new SmartSoftwareServiceInterfaceClient(); SmartSoftwareServiceReference.DbItemKorisnici[] korisnici = service.PrikaziKorisnike(null); this.popuniListuKorisnika(korisnici); }
private void TextBox_KeyUp(object sender, KeyEventArgs e) { string zaPretragu = (sender as TextBox).Text; SmartSoftwareServiceInterfaceClient service = new SmartSoftwareServiceInterfaceClient(); SmartSoftwareServiceReference.DbItemKorisnici[] korisnici = null; if (zaPretragu == null || zaPretragu == "") { korisnici = service.PrikaziKorisnike(null); } else { korisnici = service.PretragaKorisnika(zaPretragu); } this.popuniListuKorisnika(korisnici); }
private void btnUlogujSe_Click(object sender, RoutedEventArgs e) { SmartSoftwareServiceInterfaceClient service = new SmartSoftwareServiceInterfaceClient(); SmartSoftwareServiceReference.DbItemOblastiOpreme[] niz = service.OblastiOpreme(); SmartSoftwareServiceReference.DbItemKorisnici[] nizKorisnika = service.PrikaziKorisnike(null); this.popuniListuKorisnika(nizKorisnika); string textBoxUser = textBoxKorisnickoIme.Text; string textBoxPass = textBoxLozinka.Text; int brojac = 0; foreach (var item in ListaKorisnika) { if (textBoxUser == item.Username && textBoxPass == item.Lozinka) { if (item.IdUloge != 1 && item.IdUloge != 2) { MessageBox.Show("morate se ulogovati kao administrator ili prodavac"); } else { brojac++; GlavniProzor glavni = new GlavniProzor(item.IdUloge); this.Close(); glavni.Show(); } break; } } if (brojac == 0) { MessageBox.Show("Korisničko ime i/ili lozinka je netačna"); } }