示例#1
0
        private void btnDodajLokal_Click(object sender, RoutedEventArgs e)
        {
            formaLokal fl = new formaLokal();

            fl.lblDemo.Visibility           = Visibility.Visible;
            MainWindow.instance.DataContext = fl;
        }
示例#2
0
        private void btnIzmeniLokal_Click(object sender, RoutedEventArgs e)
        {
            if (tableGridLokali.SelectedItem == null)
            {
                return;
            }

            Lokal      lokal = (Lokal)tableGridLokali.SelectedItem;
            formaLokal fl    = new formaLokal();

            MainWindow.zaIzmenu = true;

            fl.txtIme.Text         = lokal.Ime;
            fl.txtOznaka.Text      = lokal.ID.ToString();
            fl.txtOznaka.IsEnabled = false;

            fl.txtOpis.Text            = lokal.Opis;
            fl.txtKapacitet.Text       = lokal.Kapacitet.ToString();
            fl.checkHendikep.IsChecked = lokal.Hendikep;
            fl.checkCigare.IsChecked   = lokal.Pusenje;
            fl.checkRezerv.IsChecked   = lokal.Rezervacije;

            if (lokal.Datum != null)
            {
                fl.DatumIzbor.SelectedDate = DateTime.Parse(lokal.Datum);
            }

            fl.putanjaIkonice = lokal.Ikonica;

            if (lokal.Cene != null)
            {
                fl.comboCene.SelectedValue = lokal.Cene;
            }

            if (lokal.Alc != null)
            {
                fl.comboAlc.SelectedValue = lokal.Alc;
            }

            if (lokal.Ikonica != null)
            {
                fl.putanjaIkoniceTip = lokal.Ikonica;
                MainWindow.instance.postaviSliku(fl.putanjaIkoniceTip, fl.ico);
            }

            for (int i = 0; i < MainWindow.instance.tipoviLokala.Count; i++)
            {
                if (MainWindow.instance.tipoviLokala[i].ID == lokal.OznakaTipa)
                {
                    fl.putanjaIkoniceTip = MainWindow.instance.tipoviLokala[i].Ikonica; //pamti ikonicu tipa
                    break;
                }
            }
            fl.zaIzmenu = true;
            fl.tipID    = lokal.OznakaTipa;
            fl.comboTipovi.SelectedValue = lokal.Tip;

            formaLokal.etikete = lokal.etikete;

            MainWindow.instance.DataContext = fl;
        }