Пример #1
0
        // DELETE: api/WebApiProject/5
        public IHttpActionResult Delete(int id)
        {
            Project P = PS.GetById(id);

            PS.Delete(P);
            PS.Commit();
            return(Ok());
        }
Пример #2
0
        public IActionResult Delete(int id)
        {
            var projectsFromRepo = _services.GetByID(id);

            if (projectsFromRepo == null)
            {
                return(BadRequest("Not a value project id"));
            }
            _services.Delete(projectsFromRepo);
            _services.SaveChange();

            return(Ok());
        }
Пример #3
0
        public ActionResult Delete(int id, ProjectViewModel PVM)
        {
            Project p = ps.GetById(id);

            PVM.ProjectId   = p.ProjectId;
            PVM.ProjectName = p.ProjectName;
            PVM.Start_Date  = p.Start_Date;
            PVM.End_Date    = p.End_Date;
            PVM.Duration    = p.Duration;
            PVM.Description = p.Description;
            ps.Delete(p);
            ps.Commit();



            return(RedirectToAction("Index"));
        }
Пример #4
0
        public IHttpActionResult DeleteProject(long projectId)
        {
            Project project = _services.Delete(projectId);

            return(Ok(project));
        }