public IActionResult DeleteConfirmed(int id) { var employee = _employeeService.GetById(id); _employeeService.Delete(id); return(RedirectToAction("Index", "Employees", new { id = employee.Id })); }
public ActionResult Delete(int?Id) { if (Id == null) { HttpNotFound(); } EmpRepository.Delete(Id); TempData["message"] = "Deleted"; return(RedirectToAction("Index")); }
// DELETE public IActionResult Remove(int id) { if (User.IsInRole("Admin") == false) { return(RedirectToAction("Index", "Home")); } _employees.Delete(id); return(RedirectToAction("Index", "Employee")); }
public IActionResult Delete(int id) { if (id == null) { return(NotFound()); } employees.Delete(id); return(RedirectToAction("Index")); }
public ActionResult Delete(int id, EDepartment d) { try { depRepo.Delete(id); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public IHttpActionResult Delete(int id) { try { iEmployee.Delete(id); return(Ok()); } catch { return(NotFound()); } }
public bool Delete(int key) { try { conn.Delete(key); return(true); } catch (Exception) { return(false); } }
public ActionResult Delete(int id, EEmployee e) { try { empRepo.Delete(id); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public JsonResult DeleteData(int?id) { bool data = ES.Delete(id); if (data) { return(Json(new { success = true, message = "Successfully Delete..!" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = true, message = "Not Deleted..!" }, JsonRequestBehavior.AllowGet)); } }
public ActionResult Delete(Employee model) { var us = _repositoryUser.Find(u => u.Email.Equals(model.Email)); var user = us.FirstOrDefault(); if (user == null) { _repositoryEmployee.Delete(model.EmployeeId); _repositoryProject_Task.DeleteTasksNoAuto(model.EmployeeId); } else { var usBos = _repositoryUser.Find(u => u.Email.Equals(User.Identity.Name)); var userBos = usBos.FirstOrDefault(); var projects = _repositoryProject.Get(userBos.Id); _repositoryUser_Employee.Delete(userBos, model); _repositoryProject_Task.DeleteTasks(model.EmployeeId, projects); } return(RedirectToAction("Index", "SanctumSanctorum")); }
public void Delete(int id) { _employee.Delete(id, RequestContext.Principal.Identity.Name); }
public IActionResult Delete(Employee employee) { _employee.Delete(employee); _employee.Save(); return(View()); }
public ActionResult Delete(int id) { _employee.Delete(id); return(RedirectToAction("Index")); }
public IActionResult Delete(long Id) { var employee = _employee.Delete(Id); return(View("DeleteMessage", employee)); }
public ActionResult Remove(int id) { employeeRepository.Delete(employeeRepository.Get(id)); userLoginRepository.Delete(userLoginRepository.Get(id)); return(RedirectToAction("EmployeeList", "Employee")); }
public JsonResult DeleteEmployee([FromBody] int id) { return(Json(_employee.Delete(id))); }
public ViewResult Delete(int id) { employee.Delete(id); return(View()); }