示例#1
0
        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"));
        }
示例#2
0
 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.");
     }
 }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#6
0
        public void Delete(int projectId)
        {
            ProjectData data = new ProjectData();

            data.DeleteProject(projectId);
        }