public ActionResult DeleteConfirmed(int id) { ProjectData myProject = new ProjectData(); myProject.DeleteProject(id); ViewBag.Message = "Deletion of project is ongoing in the background..."; return(RedirectToAction("ProjectList")); }
public string DeleteProjectService(int id) { if (data.DeleteProject(id)) { return("El proyecto ha sido eliminado con exitó"); } else { return("Ha ocurrido un problema. Intentelo más tarde."); } }
public void DeleteProjectDeailsByID() { ProjectData projectData = new ProjectData(); projectData.CreateProject(new Project { Project1 = "SampleProject", StartDate = DateTime.Now, Priority = 1 }); project = projectData._dbContext.Projects.Where(a => a.Project1 == "SampleProject").FirstOrDefault(); var result = projectData.DeleteProject(project.Project_ID); Assert.AreEqual(true, result); }
public void DeleteProject(int Id) { ProjectData projectData = new ProjectData(); try { projectData.DeleteProject(Id); } catch (Exception ex) { throw ex; } }
public void Delete_the_project_in_db() { // Arrange ProjectData projectData = new ProjectData(); projectData.CreateProject(new Project { Project1 = "TestFname", Start_Date = DateTime.Now, Priority = 1 }); project = projectData._dbContext.Projects.Where(a => a.Project1 == "TestFname").FirstOrDefault(); // Act var result = projectData.DeleteProject(project.Project_Id); // Assert Assert.AreEqual(true, result); }
public void Delete(int projectId) { ProjectData data = new ProjectData(); data.DeleteProject(projectId); }