// DELETE api/<controller>/5
        public IHttpActionResult Delete(int id)
        {
            bool res = dal.DeleteProject(id);

            if (res)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
示例#2
0
        public ActionResult Destroy(int ProjectId)
        {
            if (User.IsInRole("User"))
            {
                return(RedirectToAction("Index", "../Home"));
            }
            if (User.IsInRole("User"))
            {
                return(RedirectToAction("Index", "../Home"));
            }
            var project = BugReporter_v2.DAL.ProjectDAL.FindProject(ProjectId);
            RouteValueDictionary routeValues;

            if (project == null)
            {
                routeValues = this.GridRouteValues();

                return(RedirectToAction("Index", routeValues));
            }
            ProjectDAL.DeleteProject(ProjectId);
            routeValues = this.GridRouteValues();
            return(RedirectToAction("Index", routeValues));
        }
示例#3
0
 public ActionResult DeleteProject(ProjectVM project)
 {
     ProjectDAL.DeleteProject(Mapper.Map <ProjectDM>(project));
     return(View());
 }
示例#4
0
        public void DeleteProject(int projectId)
        {
            ProjectDAL projectDAL = new ProjectDAL();

            projectDAL.DeleteProject(projectId);
        }