public ActionResult UnlinkEvent(Guid id, ViewModels.Events.EventTaskViewModel viewModel)
        {
            long taskId;

            Common.Models.Events.EventTask model;
            Common.Models.Account.Users    currentUser;

            currentUser = Data.Account.Users.Get(User.Identity.Name);

            taskId = long.Parse(Request["TaskId"]);

            model = Data.Events.EventTask.Get(taskId, id);

            Data.Events.EventTask.Delete(model, currentUser);

            return(RedirectToAction("Events", "Tasks", new { id = model.Task.Id.Value }));
        }
        public ActionResult UnlinkMatter(long id, ViewModels.Events.EventTaskViewModel viewModel)
        {
            Guid eventId;

            Common.Models.Events.EventTask model;
            Common.Models.Account.Users    currentUser;

            currentUser = Data.Account.Users.Get(User.Identity.Name);

            eventId = Guid.Parse(Request["EventId"]);

            model = Data.Events.EventTask.Get(id, eventId);

            Data.Events.EventTask.Delete(model, currentUser);

            return(RedirectToAction("Tasks", "Events", new { id = model.Event.Id.Value }));
        }
        public ActionResult AssignTask(Guid id, ViewModels.Events.EventTaskViewModel viewModel)
        {
            long taskId;

            Common.Models.Account.Users currentUser;

            currentUser = Data.Account.Users.Get(User.Identity.Name);

            taskId = long.Parse(Request["TaskId"]);

            Data.Events.EventTask.Create(new Common.Models.Events.EventTask()
            {
                Event = new Common.Models.Events.Event()
                {
                    Id = id
                },
                Task = new Common.Models.Tasks.Task()
                {
                    Id = taskId
                },
            }, currentUser);

            return(RedirectToAction("Tasks", "Events", new { id = id }));
        }