public IList<Vote> GetItemsByRestaurant(int restaurantID)
 {
     using (_connection = Utilities.GetProfiledOpenConnection())
     {
         return _connection.GetList<Vote>(new {RestaurantID = restaurantID}).ToList();
     }
 }
 public IEnumerable<RestaurantType> GetAll()
 {
     using (_connection = Utilities.GetProfiledOpenConnection())
     {
         return _connection.GetList<RestaurantType>(new {});
     }
 }
 public IEnumerable<Holiday> GetList(object parameters)
 {
     using (_connection = Utilities.GetProfiledOpenConnection())
     {
         return _connection.GetList<Holiday>(parameters);
     }
 }
 public IEnumerable<Veto> GetAll()
 {
     using (_connection = Utilities.GetProfiledOpenConnection())
     {
         return _connection.GetList<Veto>(new {});
     }
 }
Beispiel #5
0
        public IList<Search> GetItems(SearchDependencies? dependencies = null)
        {
            using (_connection = Utilities.Database.GetProfiledOpenConnection())
            {
                var result = _connection.GetList<Search>().ToList();
                if (result.Any() && dependencies != null)
                {
                    if ((dependencies & SearchDependencies.Logs) == SearchDependencies.Logs)
                    {
                        List<SearchHistoryLog> Logs = null;
                        var searchIds = (from s in result let searchId = s.SearchId select searchId).ToList();
                        if (searchIds.Any())
                        {
                            Logs = _searchHistoryLogRepository.GetItems(searchIds).ToList();
                        }

                        if (Logs != null && Logs.Any())
                        {
                            foreach (var search in result)
                            {
                                search.Logs = Logs.FindAll(s => s.SearchId == search.SearchId).ToList();
                                search.LastLog = search.Logs.OrderByDescending(l => l.SearchDate).FirstOrDefault();
                            }
                        }
                    }
                }
                return result.ToList();
            }
        }
 public IEnumerable<DBVersion> GetItems()
 {
     using (_connection = Utilities.GetProfiledOpenConnection())
     {
         return _connection.GetList<DBVersion>();
     }
 }
Beispiel #7
0
 public IList<IgnoreWord> GetItems()
 {
     using (_connection = Utilities.Database.GetProfiledOpenConnection())
     {
         var result = _connection.GetList<IgnoreWord>();
         return result.ToList();
     }
 }
 public IList<ApiAccessHistoryLog> GetItems(int apiApplicationId)
 {
     using (_connection = Utilities.Database.GetProfiledOpenConnection())
     {
         var result = _connection.GetList<ApiAccessHistoryLog>(new { ApiApplicationId = apiApplicationId});
         return result.ToList();
     }
 }
 public IList<SearchHistoryLog> GetItems(long searchId)
 {
     using (_connection = Utilities.Database.GetProfiledOpenConnection())
     {
         var result = _connection.GetList<SearchHistoryLog>(new { SearchId = searchId });
         return result.ToList();
     }
 }
 public ActionResult List()
 {
     IEnumerable<CarViewModel> result;
     using (_connection = Utilities.GetOpenConnection())
     {
         result = _connection.GetList<CarViewModel>();
     }
     return View(result);
 }
 public ActionResult Index()
 {
     IEnumerable<User> result;
     using (_connection = Utilities.GetOpenConnection())
     {
         result = _connection.GetList<User>();
     }
     return View(UserAddEdit.MapListUserToUserAddEdit(result));
 }
Beispiel #12
0
        public User Get(string email, UserDependencies? dependencies)
        {
            using (_connection = Utilities.GetProfiledOpenConnection())
            {
                var user = _connection.GetList<User>(new { Email = email }).FirstOrDefault();

                if ((dependencies & UserDependencies.Vetoes) == UserDependencies.Vetoes)
                {
                    List<Veto> vetoes = null;
                    if (user != null) vetoes = _vetoRepository.GetAll(user.Id).ToList();
                    if (vetoes != null)
                        user.Vetoes = vetoes.FindAll(v => v.UserId == user.Id);
                }

                return user;
            }
        }
Beispiel #13
0
 public IList<Vote> GetItemsByUser(int userID)
 {
     using (_connection = Utilities.GetProfiledOpenConnection())
     {
         return _connection.GetList<Vote>(new {UserID = userID}).ToList();
     }
 }
Beispiel #14
0
 public IEnumerable<User> GetList(object where)
 {
     using (_connection = Utilities.GetProfiledOpenConnection())
     {
         return _connection.GetList<User>(where);
     }
 }