public VorstellungControl(Vorstellung Vorstellung, Action <Vorstellung> onSubmit)
        {
            InitializeComponent();

            _Vorstellung = Vorstellung;
            _OnSubmit    = onSubmit;

            cbx_Film.Items.Clear();
            cbx_Film.Items.AddList(ServiceConnector.GetFilme());
            cbx_Film.DisplayMemberPath = "Titel";
            cbx_Film.SelectedValuePath = "ID_Film";
            cbx_Film.SelectedValue     = (int)_Vorstellung.ID_Film;

            cbx_Saal.Items.Clear();
            cbx_Saal.Items.AddList(ServiceConnector.GetKinosaele());
            cbx_Saal.DisplayMemberPath = "Bezeichnung";
            cbx_Saal.SelectedValuePath = "ID_Saal";
            cbx_Saal.SelectedValue     = (int)_Vorstellung.ID_Saal;

            dtp_Datum.SelectedDate = _Vorstellung.Datum;
            tse_Uhrzeit.Value      = new TimeSpan(_Vorstellung.Datum.Hour, _Vorstellung.Datum.Minute, _Vorstellung.Datum.Second);
            ctb_Preis.Value        = _Vorstellung.Preis;

            var AnzeigeText = "";

            if (_Vorstellung.ID_Vorstellung != null)
            {
                AnzeigeText = "Vorstellung bearbeiten";
            }
            else
            {
                AnzeigeText = "Vorstellung anlegen";
            }
            btn_SubmitVorstellung.Content = AnzeigeText;
            gbx_VorstellungMask.Header    = AnzeigeText;
        }
Beispiel #2
0
 private void LoadHalls()
 {
     lbx_Halls.Items.Clear();
     lbx_Halls.Items.AddList(ServiceConnector.GetKinosaele());
     ctc_SaalControl.Content = new KinosaalControl(ObjectFactory.DefaultSaal(), SubmitSaal);
 }