コード例 #1
0
        public PartialViewResult PageVolunteers( int offSet = 0, int limit = 5 )
        {
            var repository = new VolunteersRepository();
            var model = repository.GetVolunteers( offSet, limit );

            return PartialView( "Partials/VolunteersTable", model );
        }
コード例 #2
0
        public PartialViewResult UpdateVolunteer( Volunteer volunteer )
        {
            var repository = new VolunteersRepository();
            repository.UpdateVolunteer( volunteer );
            var model = repository.GetVolunteer( volunteer.Id );

            return PartialView( "Partials/VolunteerTableRow", model.Volunteer );
        }
コード例 #3
0
 public PartialViewResult CreateVolunteer( Volunteer volunteer )
 {
     var repository = new VolunteersRepository();
     repository.CreateVolunteer( volunteer );
     var model = repository.GetVolunteers();
     
     return PartialView( "Partials/VolunteersTable", model );
 }
コード例 #4
0
        public PartialViewResult GetVolunteerForEdit( int id )
        {
            var repository = new VolunteersRepository();
            var model = repository.GetVolunteer( id );
            if ( model != null )
                model.FoodBanks = new FoodBanksRepository().GetFoodBanks( 0, 1000 ).FoodBanks;

            return PartialView( "Partials/Volunteer", model );
        }
コード例 #5
0
        public ActionResult Index()
        {
            var repository = new VolunteersRepository();
            VolunteersModel model = repository.GetVolunteers();
            if ( model != null )
                model.FoodBanks = new FoodBanksRepository().GetFoodBanks( 0, 1000 ).FoodBanks;

            return View( "Index", model );
        }
コード例 #6
0
 public bool DeleteVolunteer( int id )
 {
     var repository = new VolunteersRepository();
     return repository.DeleteVolunteer( id );
 }