public CalendarEngine(IEventBroker broker)
        {
            m_Broker = broker;
            m_Broker.RegisterFor(EventType.LanguageChanged, this);
            _Positions = new ObservableCollection <PositionOfDay>();

            try
            {
                m_notesDB = DBSingleton <RealNotesContext> .Instancja;
                var notes = m_notesDB.BrokerNotes.Count();
                _isDataBaseOK = true;
                //DataBaseState = Properties.Resources.DataBaseStateOK;
            }
            catch (Exception e)
            {
                m_notesDB     = DBSingleton <FakeNotesContext> .Instancja;
                _isDataBaseOK = false;
                //DataBaseState = Properties.Resources.DataBaseStateFails;
            }
            finally
            {
                if (_isDataBaseOK)
                {
                    DataBaseState = Properties.Resources.DataBaseStateOK;
                }
                else
                {
                    DataBaseState = Properties.Resources.DataBaseStateFails;
                }
            }

            DateTime dt_tmp = DateTime.Now;

            Selected_Date = new DateTime(dt_tmp.Year, dt_tmp.Month, dt_tmp.Day);
        }
        public CalendarEngine(IEventBroker broker)
        {
            m_Broker = broker;
            m_Broker.RegisterFor(EventType.LanguageChanged, this);
            _Positions = new ObservableCollection<PositionOfDay>();

            try
            {
                m_notesDB = DBSingleton<RealNotesContext>.Instancja;
                var notes = m_notesDB.BrokerNotes.Count();
                _isDataBaseOK = true;
                //DataBaseState = Properties.Resources.DataBaseStateOK;
            }
            catch(Exception e)
            {
                m_notesDB = DBSingleton<FakeNotesContext>.Instancja;
                _isDataBaseOK = false;
                //DataBaseState = Properties.Resources.DataBaseStateFails;
            }
            finally
            {
                if (_isDataBaseOK)
                {
                    DataBaseState = Properties.Resources.DataBaseStateOK;
                }else
                {
                    DataBaseState = Properties.Resources.DataBaseStateFails;
                }
            }

            DateTime dt_tmp = DateTime.Now;
            Selected_Date = new DateTime(dt_tmp.Year, dt_tmp.Month, dt_tmp.Day);
        }
Пример #3
0
 public NotesController(INotesContext notesContext)
 {
     this.notesContext = notesContext;
 }
Пример #4
0
 public NotesRepository()
 {
     this._notesContext = new NotesContext();
 }
Пример #5
0
 public NotesRepository(INotesContext notesContext)
 {
     this._notesContext = notesContext;
 }
 public NotesController(INotesContext dbContext)
 {
     _dbContext = dbContext;
 }
Пример #7
0
 public NotesController()
 {
     context = new NotesTestContext();
 }
Пример #8
0
 public UnitOfWork(INotesContext context)
 {
     _context = context;
 }