Exemple #1
0
        public IActionResult DeleteView(int id)
        {
            //self written code. need to cover delete of photo too.
            MEmployee deletedEmployee = _emp_repository.DeleteEmployee(id);

            return(RedirectToAction("listview"));
        }
 public IHttpActionResult DeleteEmployee(int id)
 {
     _employee.DeleteEmployee(id);
     //sending mail while deleting user
     Common.BAL.SendMail("*****@*****.**", "", "Employee Deleted", "Employee has been deleted.");
     return(Ok(new { message = "Employee is deleted successfully." }));
 }
        public IActionResult DeleteEmployee(int employeeId)
        {
            var employee = _employee.getbyId(employeeId);

            _employee.DeleteEmployee(employee);
            return(RedirectToAction("Index"));
        }
Exemple #4
0
 private static void ExecuteDatabase(IEmployee employee, int ID = 0)
 {
     employee.InsertEmployee();
     employee.UpdateEmployee(ID);
     employee.SelectEmployeesAll();
     employee.SelectEmployeeByID(ID);
     employee.DeleteEmployee(ID);
 }
 public IActionResult DeleteEmployee(int id)
 {
     if (id < 0)
     {
         return(BadRequest());
     }
     _employerepo.DeleteEmployee(id);
     return(Ok());
 }
        public EmpMaster DeleteEmployee(int id)
        {
            if (id == 0)
            {
                return(null);
            }
            var empResultSet = _employee.DeleteEmployee(id);

            return(empResultSet);
        }
Exemple #7
0
        public async Task <JsonResult> DeleteEmployee(int employeeId)
        {
            JsonData <JsonStatus> data = new JsonData <JsonStatus>(new JsonStatus());

            if (true == await _employee.DeleteEmployee(employeeId))
            {
                data.Result.Status = true;
            }

            return(Json(data)); // returns.
        }
 public TblEmployee DeleteEmployee(int Id)
 {
     try
     {
         return(employee.DeleteEmployee(Id));
     }
     catch (Exception ex)
     {
         StaticHelper.LogException(path: up.GetLogFilePath(), errorMessage: ex.Message, methodName: $"Class Name: {nameof(EmployeePresenter)} - Method name:  {nameof(DeleteEmployee)}", stackTrace: ex.StackTrace);
         return(null);
     }
 }
        public HttpResponseMessage Delete(String id)
        {
            try
            {
                employeeManager.DeleteEmployee(id);
                return(Request.CreateResponse(HttpStatusCode.OK, "Employee deleted!"));
            }

            catch (Exception e)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Error occured while executing Delete:" + e.Message));
            }
        }
Exemple #10
0
 public async Task <IActionResult> DeleteAsync([FromHeader] int id)
 {
     try
     {
         return(StatusCode(200, await _repo.DeleteEmployee(id)));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex.Message);
         _logger.LogError(ex.StackTrace);
         return(StatusCode(StatusCodes.Status500InternalServerError, "Something went wrong!"));
     }
 }
 public ActionResult DeleteEmployee(Employee employeeToDelete)
 {
     try
     {
         _employeeRepo.DeleteEmployee(employeeToDelete);
         return(Ok());
     }
     catch (Exception ex)
     {
         LogHelper.LogExceptionMessage(ex);
         return(BadRequest(ex.GetBaseException().ToString()));
     }
 }
Exemple #12
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Employee emp = employee.GetEmployeeById(id);

            if (emp == null)
            {
                return(HttpNotFound());
            }
            employee.DeleteEmployee(emp);
            return(RedirectToAction("Index"));
        }
Exemple #13
0
        public async Task <ActionResult <Employee> > DeleteEmployee(int id)
        {
            try
            {
                var EmployeeToDelete = await _employeeRepository.GetEmployee(id);

                if (EmployeeToDelete == null)
                {
                    return(NotFound($"Not Found Employee with id={id}"));
                }
                return(await _employeeRepository.DeleteEmployee(id));
            }
            catch (Exception)
            {
                throw;
            }
        }
        public async Task <IActionResult> DeleteEmployees(int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var employees = _employee.DeleteEmployee(id);

            //var employees = _context.Employees.FirstOrDefault(e => e.EmployeeId == id);
            if (employees == 0)
            {
                return(NotFound());
            }

            //_context.Employees.Remove(employees);
            //await _context.SaveChangesAsync();

            return(Ok(employees));
        }
Exemple #15
0
        public async Task <ActionResult> Delete(int id, EmployeeModel employeeDetail)
        {
            try
            {
                EmployeeModel employee = await _employeeService.GetEmployeeById(id);

                if (employee != null)
                {
                    bool flag = await _employeeService.DeleteEmployee(employee);

                    if (flag)
                    {
                        return(RedirectToAction("Index"));
                    }
                }
            }

            catch
            {
                return(View());
            }
            return(View());
        }
        // GET: EmployeesController/Delete/5
        public ActionResult Delete(int id)
        {
            var employeeId = _employee.DeleteEmployee(id);

            return(View(employeeId));
        }
 public void Delete(int id)
 {
     _employeeRepository.DeleteEmployee(id);
 }
Exemple #18
0
 //Xóa nhân viên
 public void deleteEmployee(int employee)
 {
     employeeDao.DeleteEmployee(employee);
 }
Exemple #19
0
 public void Delete(int id)
 {
     _emp.DeleteEmployee(id);
 }
 public void Delete(int id)
 {
     objemployee.DeleteEmployee(id);
 }
 public IActionResult DeleteConfirmed(int id)
 {
     _employee.DeleteEmployee(id);
     return(RedirectToAction("Index"));
 }
Exemple #22
0
        public ActionResult DeleteEmployee(int id)
        {
            var deleteEmpoyee = _employee.DeleteEmployee(id);

            return(Ok(deleteEmpoyee));
        }
 public int Delete(int id)
 {
     return(employeeDataAccess.DeleteEmployee(id));
 }
Exemple #24
0
 public ActionResult Delete(int Id)
 {
     objEmpBO.DeleteEmployee(Id, 1, DateTime.Now);
     return(RedirectToAction("Index"));
 }
Exemple #25
0
        public ActionResult DeleteApplyLeavee(int id)
        {
            EmployeeDetail applyLeave = _EmpRepository.DeleteEmployee(id);

            return(Ok());
        }
 public int Delete(int id)
 {
     return(objemployee.DeleteEmployee(id));
 }
 public IActionResult Delete(int id)
 {
     _employee.DeleteEmployee(id);
     _employeeSkill.DeleteRecord(id);
     return(RedirectToAction(nameof(Index)));
 }
Exemple #28
0
 public void Delete(string id)
 {
     objemployee.DeleteEmployee(id);
 }
Exemple #29
0
        public IActionResult DeleteConfirmed(int id)
        {
            _employeerepository.DeleteEmployee(id);

            return(RedirectToAction(nameof(Index)));
        }
Exemple #30
0
 public IActionResult Delete(int employeeId)
 {
     objemployee.DeleteEmployee(employeeId);
     return(Ok());
 }