Advertisement
Guest User

forma login

a guest
Apr 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using BusinessLayer;
  11. using Provjera;
  12.  
  13. namespace Rasadnik
  14. {
  15. public partial class FormLogin : Form
  16. {
  17. Zaposlenik zap = new Zaposlenik();
  18. public FormLogin()
  19. {
  20. InitializeComponent();
  21. }
  22.  
  23. private void btnLogin_Click(object sender, EventArgs e)
  24. {
  25. Provjera.Provj ma = new Provjera.Provj();
  26. int prava, IDZaposlenik, IDRasadnik;
  27. bool us, pw;
  28. string user = tBxUsername.Text.ToString();
  29. string pass = tBxPassword.Text.ToString();
  30. us = ma.ProvjeraUsername(user);
  31. pw = ma.ProvjeraUsername(pass);
  32. if (us == true)
  33. {
  34. if (pw == true)
  35. {
  36. if (zap.LoginTrue(user, pass))
  37. {
  38. prava = zap.AdministratorTrue(user, pass);
  39. IDZaposlenik = zap.idZaposlenik(user,pass);
  40. IDRasadnik = zap.idRasadnik(user,pass);
  41. this.Hide();
  42. FormMain FM = new FormMain(prava,IDZaposlenik, IDRasadnik);
  43. FM.ShowDialog();
  44. this.Close();
  45. }
  46. }
  47. }
  48. else
  49. {
  50. MessageBox.Show("Korisničko ime ili lozinka nisu ispravni");
  51. }
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement