Esempio n. 1
0
        public virtual void Delete(int projectId)
        {
            var project = GetByID(projectId);

            if (project == null)
            {
                return;
            }

            ProjectSecurity.DemandEdit(project);

            factory.FileEngine.RemoveRoot(projectId);

            List <int> messages, tasks;

            projectDao.Delete(projectId, out messages, out tasks);

            NotifyClient.Instance.SendAboutProjectDeleting(new HashSet <Guid> {
                project.Responsible
            }, project);

            factory.MessageEngine.UnSubscribeAll(messages.Select(r => new Message {
                Project = project, ID = r
            }).ToList());
            factory.TaskEngine.UnSubscribeAll(tasks.Select(r => new Task {
                Project = project, ID = r
            }).ToList());
        }
Esempio n. 2
0
        public virtual void Delete(int projectId)
        {
            var project = GetByID(projectId);

            if (project == null)
            {
                return;
            }

            ProjectSecurity.DemandEdit(project);
            projectDao.Delete(projectId);
            TimeLinePublisher.Project(project, EngineResource.ActionText_Delete, UserActivityConstants.ActivityActionType, UserActivityConstants.Max);
        }
        public ActionResult Delete(int id)
        {
            var p = _projectDao.GetById(id);

            if (p == null)
            {
                return(NotFound());
            }

            if (_projectDao.Delete(p))
            {
                return(NoContent());
            }
            return(null);
        }
Esempio n. 4
0
        public virtual void Delete(int projectId)
        {
            var project = GetByID(projectId);

            if (project == null)
            {
                return;
            }

            ProjectSecurity.DemandEdit(project);

            factory.GetFileEngine().RemoveRoot(projectId);

            projectDao.Delete(projectId);

            NotifyClient.Instance.SendAboutProjectDeleting(new HashSet <Guid> {
                project.Responsible
            }, project);
        }
Esempio n. 5
0
        public int Delete(string token, string id)
        {
            Project oldProject = Get(token, id);

            return(_ProjectDao.Delete(oldProject));
        }