public void Delete(Subtask subtask, Task task) { if (subtask == null) { throw new ArgumentNullException("subtask"); } if (task == null) { throw new ArgumentNullException("task"); } ProjectSecurity.DemandEdit(task, subtask); _subtaskDao.Delete(subtask.ID); TimeLinePublisher.Subtask(subtask, task, EngineResource.ActionText_Delete, UserActivityConstants.ActivityActionType, UserActivityConstants.NormalActivity); var objectID = task.UniqID + "_" + task.Project.ID; var recipients = NotifySource.Instance.GetSubscriptionProvider().GetRecipients(NotifyConstants.Event_NewCommentForTask, objectID) .Where(r => r.ID != SecurityContext.CurrentAccount.ID.ToString()).ToList(); if (recipients.Any()) { NotifyClient.Instance.SendAboutSubTaskDeleting(recipients, task, subtask); } }
public virtual void Delete(Task task) { using (var tx = Db.BeginTransaction()) { var id = task.ID; task.Links.ForEach(RemoveLink); task.SubTasks.ForEach(subTask => SubtaskDao.Delete(subTask.ID)); Db.ExecuteNonQuery(Delete(CommentsTable).Where("target_uniq_id", task.UniqID)); Db.ExecuteNonQuery(Delete(TasksResponsibleTable).Where("task_id", id)); Db.ExecuteNonQuery(Delete(TasksTable).Where("id", id)); tx.Commit(); } }
public void Delete(Task task) { if (task == null) { throw new ArgumentNullException("task"); } ProjectSecurity.DemandDelete(task); task.Links.ForEach(link => taskDao.RemoveLink(link)); task.SubTasks.ForEach(subTask => subtaskDao.Delete(subTask.ID)); taskDao.Delete(task.ID); var recipients = GetSubscribers(task); if (recipients.Count != 0) { NotifyClient.Instance.SendAboutTaskDeleting(recipients, task); } }
public void Delete(Subtask subtask, Task task) { if (subtask == null) { throw new ArgumentNullException("subtask"); } if (task == null) { throw new ArgumentNullException("task"); } ProjectSecurity.DemandEdit(task, subtask); subtaskDao.Delete(subtask.ID); var recipients = GetSubscribers(task); if (recipients.Any()) { NotifyClient.Instance.SendAboutSubTaskDeleting(recipients, task, subtask); } }
public void Delete(Task task) { if (task == null) { throw new ArgumentNullException("task"); } ProjectSecurity.DemandEdit(task); task.SubTasks.ForEach(subTask => _subtaskDao.Delete(subTask.ID)); _taskDao.Delete(task.ID); var milestone = task.Milestone != 0 ? _milestoneDao.GetById(task.Milestone) : null; TimeLinePublisher.Task(task, milestone, EngineResource.ActionText_Delete, UserActivityConstants.ActivityActionType, UserActivityConstants.NormalActivity); var objectID = task.UniqID + "_" + task.Project.ID; var recipients = NotifySource.Instance.GetSubscriptionProvider().GetRecipients(NotifyConstants.Event_NewCommentForTask, objectID) .Where(r => r.ID != SecurityContext.CurrentAccount.ID.ToString()).ToList(); if (recipients.Count != 0) { NotifyClient.Instance.SendAboutTaskDeleting(recipients, task); } }