private void btnLogin_Click(object sender, EventArgs e) { String stranica = DataProvider.login(txtUser.Text, txtPass.Text); if (stranica == null) { MessageBox.Show("Unesite validan email i sifru."); } if (stranica == "sef") { Sef sef = new Sef(); sef = DataProvider.vratiSefaPoEmailu(txtUser.Text); //vratiSefa(txtUser.Text); ProfilSef profilSefa = new ProfilSef(sef); profilSefa.Show(); } else if (stranica == "vodja") { Vodja vodja = new Vodja(); vodja = DataProvider.vratiVodjuPoEmailu(txtUser.Text); //vratiSefa(txtUser.Text); ProfilVodja profilVodje = new ProfilVodja(vodja); profilVodje.Show(); } else if (stranica == "radnik") { Radnik radnik = new Radnik(); radnik = DataProvider.vratiRadnikaPoEmailu(txtUser.Text); //vratiSefa(txtUser.Text); ProfilRadnik profilRadnika = new ProfilRadnik(radnik); profilRadnika.Show(); } //MessageBox.Show(stranica); }
public async Task <IActionResult> Edit(int id, [Bind("ID,ime,prezime,email,adresaStanovanja,brojTelefona")] Sef sef) { if (id != sef.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sef); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SefExists(sef.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(sef)); }
public async Task <IActionResult> Create([Bind("ID,ime,prezime,email,adresaStanovanja,brojTelefona")] Sef sef) { if (ModelState.IsValid) { _context.Add(sef); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(sef)); }
public ProfilSef(Sef s) { this.sef = s; InitializeComponent(); }
public upravljanjeProjektima(Sef s) { InitializeComponent(); sef = s; projekti = DataProvider.vratiProjekteZaSefa(sef.idSefa); }