public Model.Models.Interval GetActiveInterval()
        {
            try
            {
                User user = UserSevice.CreateUserSingleton();

                var interval = _dbContext.Interval.FirstOrDefault(x => x.UserId == user.UserId);

                if (interval == null)
                {
                    return(null);
                }

                return(new Model.Models.Interval()
                {
                    Time = interval.Time,
                    IntervalId = interval.IntervalId,
                    UserId = interval.UserId
                });
            }
            catch (Exception ex)
            {
                _logService.InsertLog(new Data.Entities.Log()
                {
                    Exception = ex.Message, Request = ""
                });
            }

            return(null);
        }
Beispiel #2
0
        public List <App> GetAll()
        {
            try
            {
                User user = UserSevice.CreateUserSingleton();

                return(_dbSingletonContext.App.Where(x => x.UserId == user.UserId).ToList());
            }
            catch (Exception ex)
            {
                _logService.InsertLog(new Data.Entities.Log()
                {
                    Exception = ex.Message, Request = ""
                });
            }

            return(null);
        }
        public Notification GetNotification()
        {
            try
            {
                User user = UserSevice.CreateUserSingleton();

                return(_dbSingletonContext.Notification.FirstOrDefault(x => x.UserId == user.UserId));
            }
            catch (Exception ex)
            {
                _logService.InsertLog(new Data.Entities.Log()
                {
                    Exception = ex.Message, Request = ""
                });
            }

            return(null);
        }