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

            if (res)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
 public ActionResult DeleteProject(ProjectVM project)
 {
     ProjectDAL.DeleteProject(Mapper.Map <ProjectDM>(project));
     return(View());
 }
Exemplo n.º 4
0
        public void DeleteProject(int projectId)
        {
            ProjectDAL projectDAL = new ProjectDAL();

            projectDAL.DeleteProject(projectId);
        }