Exemple #1
0
 private void btnLogIn_Click(object sender, EventArgs e)
 {
     if (chkAdmin.Checked)
     {
         Admin admin = new Admin(txtUsername.Text, txtPassword.Text);
         if (DataProvider.findAdmin(admin))
         {
             AdminHome ah = new AdminHome();
             ah.ShowDialog();
         }
         else
         {
             MessageBox.Show("Pogresni podaci.");
         }
     }
     else
     {
         DomainModel.User user = DataProvider.findUser(txtUsername.Text, txtPassword.Text);
         if (user != null)
         {
             //DomainModel.User u = new User();
             //u.email = txtUsername.Text;
             //u.password = txtPassword.Text;
             UserForm uf = new UserForm(user);
             uf.ShowDialog();
         }
         else
         {
             MessageBox.Show("Korisnik ne postoji,molimo Vas registrujte se.");
         }
     }
 }
Exemple #2
0
 public UserForm(DomainModel.User user)
 {
     InitializeComponent();
     _user            = user;
     panel1.BackColor = Color.LightSeaGreen;
     lblIme.Text      = user.firstName;
     lblMail.Text     = user.email;
     lblPrezime.Text  = user.lastName;
     lbSveSerije.Items.Clear();
     lbSveSerije.Items.AddRange(DataProvider.getAvailableTVShows(_user).ToArray());
     lbPTW.Items.Clear();
     lbPTW.Items.AddRange(DomainModel.DataProvider.planToWatchFunc(_user).ToArray());
     lbWatched.Items.Clear();
     lbWatched.Items.AddRange(DomainModel.DataProvider.WatchedFunc(_user).ToArray());
     comboBox1.Items.AddRange(DataProvider.getGenres().ToArray());
 }