public IActionResult DeleteEmployee(int ID)
 {
     try
     {
         var result = BusinessLayer.DeleteEmployee(ID);
         //if result is not equal to zero then details Deleted sucessfully
         if (!result.Equals(null))
         {
             var Status  = "Success";
             var Message = "Employee Data deleted Sucessfully";
             return(this.Ok(new { Status, Message, Data = ID }));
         }
         else                                           //Data is not deleted
         {
             var Status  = "Unsuccess";
             var Message = "Employee Data is not deleted Sucessfully";
             return(this.BadRequest(new { Status, Message, Data = ID }));
         }
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
예제 #2
0
        public IHttpActionResult DeleteEmployee(int id)
        {
            Employee employeeRet = _objEmployeeBal.DeleteEmployee(id);

            return(Ok(employeeRet));
        }