public ActionResult EditActivity(EditActivityViewModel viewModel)
        {
            if (activitiesService.IsValidModelState())
            {
                bool isExistingActivity = activitiesService.IsExistingActivity(a => a.ActivityId == viewModel.ActivityId);
                if (isExistingActivity == false)
                {
                    TempData["ErrorMessage"] = "There is no existing activity with that id. You can add one if you want.";
                    return(RedirectToAction("ViewActivities", "Activities"));
                }

                Activity dbActivity = activitiesService.GetById(viewModel.ActivityId);
                dbActivity.ActivityId = viewModel.ActivityId;
                dbActivity.Duration   = viewModel.Duration;
                dbActivity.Name       = viewModel.Name;
                dbActivity.Price      = viewModel.Price;
                bool hasSuccessfullySaved = activitiesService.Edit(dbActivity);
                if (hasSuccessfullySaved)
                {
                    TempData["SuccessfullMessage"] = "Activity edited successfully";
                    return(RedirectToAction("ViewActivities", "Activities"));
                }
                else
                {
                    TempData["ErrorMessage"] = "Server error when trying to update the activity";
                    return(RedirectToAction("Index", "Home"));
                }
            }

            return(View(viewModel));
        }