Example #1
0
        private void editIspit(object sender, RoutedEventArgs e)
        {
            try
            {
                edit = true;
                DodajIspit dodajIspit = new DodajIspit();
                dodajIspit.lblTitle.Content = "IZMENI ISPIT";

                this.conn.Open();
                DataRowView row = (DataRowView)this.dgMain.SelectedItems[0];
                selectedRow = row;
                this.query  = @"select * from tblIspit where IspitID = " + row["ID"];

                SqlCommand    cmd    = new SqlCommand(this.query, this.conn);
                SqlDataReader reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    dodajIspit.cbUcenici.SelectedValue    = reader["UcenikID"].ToString();
                    dodajIspit.cbIspitanici.SelectedValue = reader["IspitanikID"].ToString();
                    dodajIspit.cbPitanja.SelectedValue    = reader["PitanjeID"].ToString();
                    dodajIspit.tbOsvojenihBodova.Text     = reader["IspitOsvojenihBodova"].ToString();
                }

                dodajIspit.ShowDialog();
            }
            catch (ArgumentOutOfRangeException)
            {
                MessageBox.Show("Morate selektovati red!");
            }
            finally
            {
                this.conn.Close();
                this.btnRNRefresh_Click(sender, e);
                this.dgMain.SelectedIndex = this.dgMain.Items.Count - 1;
                this.dgMain.ScrollIntoView(this.dgMain.SelectedItem);
                edit = false;
            }
        }
Example #2
0
        private void chooseToAdd()
        {
            this.blurEffect.Radius = 5;
            this.Effect            = this.blurEffect;
            switch (this.currentlyActive)
            {
            case 1:     // otvori dodaj ucenika
                Add addNew = new Add();
                addNew.ShowDialog();
                break;

            case 2:     // otvori dodaj profesora
                DodajProfesora dodajProfesora = new DodajProfesora();
                dodajProfesora.ShowDialog();
                break;

            case 3:     // otvori dodaj instrument
                DodajInstrument dodajInstrument = new DodajInstrument();
                dodajInstrument.ShowDialog();
                break;

            case 4:     // otvori dodaj ispitanika
                DodajIspitanika dodajIspitanika = new DodajIspitanika();
                dodajIspitanika.ShowDialog();
                break;

            case 5:     // otvori dodaj ispit
                DodajIspit dodajIspit = new DodajIspit();
                dodajIspit.ShowDialog();
                break;

            case 6:     // otvori dodaj ispit
                DodajPitanje dodajPitanje = new DodajPitanje();
                dodajPitanje.ShowDialog();
                break;
            }
            this.Effect = null;
        }