Esempio n. 1
0
        public MainViewModel(DAO.DAO dao)
        {
            this.FilmCollection        = new ObservableCollectionExtended <Film>(dao.mKino.Film.Local.ToList());
            this.VorfuehrungCollection = new ObservableCollectionExtended <Vorfuehrung>(dao.mKino.Vorfuehrung.Local.ToList());
            this.BuchungCollection     = new ObservableCollectionExtended <Buchung>(dao.mKino.Buchung.Local.ToList());
            this.SaalCollection        = new ObservableCollectionExtended <Saal>(dao.mKino.Saal.Local.ToList());

            this.mDao = dao;

            this.FilmCollection.ItemAdded                  += FilmCollection_ItemAdded;
            this.FilmCollection.ItemPropertyChanged        += FilmCollection_ItemPropertyChanged;
            this.FilmCollection.ItemRemoved                += FilmCollection_ItemRemoved;
            this.VorfuehrungCollection.ItemAdded           += VorfuehrungCollection_ItemAdded;
            this.VorfuehrungCollection.ItemPropertyChanged += VorfuehrungCollection_ItemPropertyChanged;
            this.VorfuehrungCollection.ItemRemoved         += VorfuehrungCollection_ItemRemoved;
            this.BuchungCollection.ItemAdded               += BuchungCollection_ItemAdded;
            this.BuchungCollection.ItemPropertyChanged     += BuchungCollection_ItemPropertyChanged;
            this.BuchungCollection.ItemRemoved             += BuchungCollection_ItemRemoved;
            this.SaalCollection.ItemAdded                  += SaalCollection_ItemAdded;
            this.SaalCollection.ItemPropertyChanged        += SaalCollection_ItemPropertyChanged;
            this.SaalCollection.ItemRemoved                += SaalCollection_ItemRemoved;

            this.FilmCollection.CollectionChanged        += FilmCollection_CollectionChanged;
            this.VorfuehrungCollection.CollectionChanged += VorfuehrungCollection_CollectionChanged;
            this.BuchungCollection.CollectionChanged     += BuchungCollection_CollectionChanged;
            this.SaalCollection.CollectionChanged        += SaalCollection_CollectionChanged;

            this.FilmCollection.PropertyChanged        += FilmCollection_PropertyChanged;
            this.VorfuehrungCollection.PropertyChanged += VorfuehrungCollection_PropertyChanged;
            this.BuchungCollection.PropertyChanged     += BuchungCollection_PropertyChanged;
            this.SaalCollection.PropertyChanged        += SaalCollection_PropertyChanged;
        }
Esempio n. 2
0
        public bool Create(DAO.Credit credit)
        {
            try
            {
                _creditDao.CreateOrUpdate(credit);
                _debtDao.SaveToBase();

                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
Esempio n. 3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            DAO.DAO dao = new DAO.DAO();

            dao.Load();

            m_viewModel = new MainViewModel(dao);
            m_viewModel.ModelChanged           += M_viewModel_ModelChanged;
            filmBindingSource.DataSource        = m_viewModel.FilmCollection;
            saalBindingSource.DataSource        = m_viewModel.SaalCollection;
            vorfuehrungBindingSource.DataSource = m_viewModel.VorfuehrungCollection;
            buchungBindingSource.DataSource     = m_viewModel.BuchungCollection;

            // Validität überprüfen
            if (!m_viewModel.ValidateBuchung(true))
            {
                dao.Save();
                MessageBox.Show("Ungültige Buchungen wurden in der Datenbank entfernt");
            }
        }
Esempio n. 4
0
 public Bus()
 {
     dao = new DAO.DAO();
 }
Esempio n. 5
0
 void frm_AfterUpdateSupportSuccesfully(DAO.DOYeuCau doYeuCau)
 {
     this.UpdateContent(doYeuCau.NGUOI_GUI_ID, doYeuCau.NGUOI_NHAN_ID,
         doYeuCau.NGAY_GUI, doYeuCau.NOI_DUNG, doYeuCau.DSTapTinDinhKem,
         FieldFileName, FieldNoiDung, new object[] { doYeuCau.CHU_DE, doYeuCau.TINH_TRANG });
 }
Esempio n. 6
0
 void frm_AfterUpdateReplySuccesfully(DAO.DOPhanHoi doPhanHoi)
 {
     this.UpdateContent(doPhanHoi.NGUOI_GUI_ID, doPhanHoi.NGUOI_NHAN_ID,
         doPhanHoi.NGAY_GUI, doPhanHoi.NOI_DUNG, doPhanHoi.DSTapTinDinhKem,
         FieldFileName, FieldNoiDung);
 }