コード例 #1
0
        public IActionResult DeleteConfirmed(int id)
        {
            var employee = _employeeService.GetById(id);

            _employeeService.Delete(id);

            return(RedirectToAction("Index", "Employees", new { id = employee.Id }));
        }
コード例 #2
0
 public ActionResult Delete(int?Id)
 {
     if (Id == null)
     {
         HttpNotFound();
     }
     EmpRepository.Delete(Id);
     TempData["message"] = "Deleted";
     return(RedirectToAction("Index"));
 }
コード例 #3
0
        // DELETE
        public IActionResult Remove(int id)
        {
            if (User.IsInRole("Admin") == false)
            {
                return(RedirectToAction("Index", "Home"));
            }
            _employees.Delete(id);

            return(RedirectToAction("Index", "Employee"));
        }
コード例 #4
0
        public IActionResult Delete(int id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            employees.Delete(id);
            return(RedirectToAction("Index"));
        }
コード例 #5
0
 public ActionResult Delete(int id, EDepartment d)
 {
     try
     {
         depRepo.Delete(id);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
コード例 #6
0
 public IHttpActionResult Delete(int id)
 {
     try
     {
         iEmployee.Delete(id);
         return(Ok());
     }
     catch
     {
         return(NotFound());
     }
 }
コード例 #7
0
 public bool Delete(int key)
 {
     try
     {
         conn.Delete(key);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
コード例 #8
0
 public ActionResult Delete(int id, EEmployee e)
 {
     try
     {
         empRepo.Delete(id);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
コード例 #9
0
        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));
            }
        }
コード例 #10
0
        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"));
        }
コード例 #11
0
 public void Delete(int id)
 {
     _employee.Delete(id, RequestContext.Principal.Identity.Name);
 }
コード例 #12
0
 public IActionResult Delete(Employee employee)
 {
     _employee.Delete(employee);
     _employee.Save();
     return(View());
 }
コード例 #13
0
 public ActionResult Delete(int id)
 {
     _employee.Delete(id);
     return(RedirectToAction("Index"));
 }
コード例 #14
0
        public IActionResult Delete(long Id)
        {
            var employee = _employee.Delete(Id);

            return(View("DeleteMessage", employee));
        }
コード例 #15
0
 public ActionResult Remove(int id)
 {
     employeeRepository.Delete(employeeRepository.Get(id));
     userLoginRepository.Delete(userLoginRepository.Get(id));
     return(RedirectToAction("EmployeeList", "Employee"));
 }
コード例 #16
0
 public JsonResult DeleteEmployee([FromBody] int id)
 {
     return(Json(_employee.Delete(id)));
 }
コード例 #17
0
 public ViewResult Delete(int id)
 {
     employee.Delete(id);
     return(View());
 }