public IActionResult Create(int activityId)
 {
     var activity = _dataAccess.GetActivity(activityId);
     if (activity == null || !User.IsTenantAdmin(activity.TenantId))
     {
         return HttpUnauthorized();
     }
     var viewModel = new TaskEditViewModel()
     {
         ActivityId = activity.Id,
         ActivityName = activity.Name,
         CampaignId = activity.CampaignId,
         CampaignName = activity.Campaign.Name,
         TenantId = activity.TenantId
     };
     return View("Edit", viewModel);
 }
        public IActionResult Create(int activityId, TaskEditViewModel model)
        {
            if (model.EndDateTime < model.StartDateTime)
            {
                ModelState.AddModelError("EndDateTime", "Ending time cannot be earlier than the starting time");
            }

            if (ModelState.IsValid)
            {
                if (!User.IsTenantAdmin(model.TenantId))
                {
                    return HttpUnauthorized();
                }
                _bus.Send(new EditTaskCommand() { Task = model });
                return RedirectToAction("Details", "Activity", new { id = activityId });
            }
            return View("Edit", model);
        }