예제 #1
0
        // GET: Empleados/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Empleado empleado = EmpleadoBLL.Get(id);

            if (empleado == null)
            {
                return(HttpNotFound());
            }
            return(View(empleado));
        }
예제 #2
0
 public IHttpActionResult Get(int id)
 {
     try
     {
         Empleado result = EmpleadoBLL.Get(id);
         if (result == null)
         {
             return(NotFound());
         }
         return(Content(HttpStatusCode.OK, result));
     }
     catch (Exception ex)
     {
         return(Content(HttpStatusCode.BadRequest, ex));
     }
 }