Beispiel #1
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;
        }
Beispiel #2
0
        private void editInstrument(object sender, RoutedEventArgs e)
        {
            try
            {
                edit = true;
                DodajInstrument dodajInstrument = new DodajInstrument();
                dodajInstrument.lblTitle.Content = "IZMENI INSTRUMENT";

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

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

                while (reader.Read())
                {
                    dodajInstrument.tbInstrumentNaziv.Text = reader["InstrumentNaziv"].ToString();
                }

                dodajInstrument.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;
            }
        }