public ActionResult Index()
 {
     var repository = new FoodBanksRepository();
     var model = repository.GetStatistics();
     
     return View( "Index", model );
 }
        public PartialViewResult GetFoodBankForEdit( int id )
        {
            var repository = new FoodBanksRepository();
            var model = repository.GetFoodBank( id );

            return PartialView( "Partials/FoodBank", model );
        }
        public PartialViewResult PageFoodBanks( int offSet = 0, int limit = 5 )
        {
            var repository = new FoodBanksRepository();
            var model = repository.GetFoodBanks( offSet, limit );

            return PartialView( "Partials/FoodBanksTable", model );
        }
        public PartialViewResult UpdateFoodBank( FoodBank foodBank )
        {
            var repository = new FoodBanksRepository();
            repository.UpdateFoodBank( foodBank );
            var model = repository.GetFoodBank( foodBank.Id );

            return PartialView( "Partials/FoodBankTableRow", model.FoodBank );
        }
        public PartialViewResult CreateFoodBank( FoodBank foodBank )
        {
            var repository = new FoodBanksRepository();
            repository.CreateFoodBank( foodBank );
            var model = repository.GetFoodBanks();

            return PartialView( "Partials/FoodBanksTable", model );
        }
 public bool DeleteFoodBank(int id)
 {
     var repository = new FoodBanksRepository();
     return repository.DeleteFoodBank( id );
 }