Esempio n. 1
0
 private void DeleteButton_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow r in dataGridView1.SelectedRows)
     {
         ps.DeleteProject(Convert.ToInt32(r.Cells[0].Value));
         dataGridView1.Rows.RemoveAt(r.Index);
     }
 }
Esempio n. 2
0
        public async Task <IActionResult> OnPostDeleteAsync(String projectID)
        {
            _logger.LogInformation($"Deleting project {projectID}");

            await _projectsService.DeleteProject(projectID);

            _logger.LogInformation($"{projectID} deleted");

            return(RedirectToPage("Index"));
        }
Esempio n. 3
0
 public IActionResult DeleteProject([FromRoute] int projectId)
 {
     service.CurrentUser = CurrentUser;
     if (service.DeleteProject(projectId))
     {
         return(Ok());
     }
     else
     {
         return(NotFound());
     }
 }
        private async Task DeleteHandlerAsync(ProjectViewModel arg)
        {
            try
            {
                await _projectsService.DeleteProject(arg.Identify);

                Projects.Remove(arg);
            }
            catch (Exception ex)
            {
                _loggerService.Error(ex.ToString());
            }
        }
        public async Task <ActionResult> DeleteProject(int id)
        {
            if (id <= 0)
            {
                return(BadRequest());
            }
            try
            {
                await service.DeleteProject(id);

                return(NoContent());
            }
            catch (ArgumentException)
            {
                return(NotFound("Entity with this Id hasn't already exists. Please try again with another Id"));
            }
        }
        public async Task <ActionResult> DeleteProject(string id)
        {
            await _projectsService.DeleteProject(id);

            return(new OkResult());
        }
Esempio n. 7
0
        public async Task <IActionResult> DeleteProject(int projectId)
        {
            await projectsService.DeleteProject(projectId);

            return(Ok());
        }
 public async ValueTask <ProjectReadDto> DeleteProject([FromRoute] Guid id)
 {
     return(await _projectsService.DeleteProject(id));
 }
Esempio n. 9
0
 public void DeleteProjectsExceptionTest()
 {
     mockRepository.Setup(m => m.Get(It.IsAny <Int32>())).Returns(() => null);
     Assert.ThrowsException <Exception>(() => projectsService.DeleteProject(1));
 }
Esempio n. 10
0
 public async Task <IActionResult> DeleteProject(long id)
 {
     return(Ok(await _projectsService.DeleteProject(id)));
 }
Esempio n. 11
0
 public async Task DeleteProject(Guid pid)
 {
     await service.DeleteProject(UserId, pid);
 }