Example #1
0
 private void btnLogin_Click(object sender, RoutedEventArgs e)
 {
     list     = baza.Select();
     userName = txtBoxUserName.Text;
     password = txtBoxPassword.Text;
     foreach (korisnik l in list)
     {
         // MessageBox.Show(l.korisnickoIme);
         if (userName == l.korisnickoIme && password == l.sifra)
         {
             if (l.tip == 1)
             {
                 var adminPanel = new admin();
                 adminPanel.Show();
                 this.Close();
             }
             else if (l.tip == 2)
             {
                 var userPanel = new user();
                 userPanel.Show();
                 this.Close();
             }
             else
             {
                 MessageBox.Show("Greska!");
             }
         }
         else
         {
             MessageBox.Show("Korisnik ne postoji u bazi");
         }
     }
 }
Example #2
0
        public addNewMembership()
        {
            InitializeComponent();
            db      = new baza();
            dt      = new DateTime();
            dtUntil = new DateTime();
            model   = new List <model>();
            user    = new List <korisnik>();
            model   = db.SelectModel();
            user    = db.Select();
            foreach (model m in model)
            {
                listBoxModel.Items.Add(m);
            }

            foreach (korisnik k in user)
            {
                listBoxUser.Items.Add(k);
            }
        }
Example #3
0
 public editAll(dataToSend dts)
 {
     InitializeComponent();
     tableName        = dts.getTableName;
     db               = new baza();
     tableFieldNames  = new List <string>();
     tableFieldValues = new List <string>();
     listTextBox      = new List <TextBox>();
     listLabel        = new List <Label>();
     MessageBox.Show(dts.getNumber);
     if (dts.getNumber == "1")
     {
         actor = new List <glumac>();
         actor = db.SelectActor();
         createInterface(actor);
     }
     else if (dts.getNumber == "2")
     {
         model = new List <model>();
         model = db.SelectModel();
         createInterface(model);
     }
     else if (dts.getNumber == "3")
     {
         user = new List <korisnik>();
         user = db.Select();
         createInterface(user);
     }
     else if (dts.getNumber == "4")
     {
         address = new List <adresa>();
         address = db.SelectAddress();
         createInterface(address);
     }
     else if (dts.getNumber == "5")
     {
         movie = new List <film>();
         movie = db.SelectMovie();
         createInterface(movie);
     }
     else if (dts.getNumber == "6")
     {
         distributor = new List <distributer>();
         distributor = db.SelectDistributor();
         createInterface(distributor);
     }
     else if (dts.getNumber == "7")
     {
         nationality = new List <nacionalnost>();
         nationality = db.SelectNationality();
         createInterface(nationality);
     }
     else if (dts.getNumber == "8")
     {
         director = new List <redatelj>();
         director = db.SelectDirector();
         createInterface(director);
     }
     //txtBoxField1.Margin = new Thickness(10, 10, 10, 10);
     //stackPanelMain.Children.Add(txtBoxField1);
     //stackPanelMain.Children.Add(textBoxField2);
 }