Ejemplo n.º 1
0
 public IHttpActionResult GetById(int id)
 {
     try
     {
         return(Ok(HmoCRUD.GetHmoById(id)));
     }
     catch (Exception e)
     {
         return(InternalServerError());
     }
 }
Ejemplo n.º 2
0
 public IHttpActionResult Delete(HMO_PROGECTEntities ctx, HMO_TBL hmo)
 {
     try
     {
         HmoCRUD.delete(ctx, hmo);
         return(Ok());
     }
     catch (Exception)
     {
         return(InternalServerError());
     }
 }
Ejemplo n.º 3
0
 //public static List<HMO_TBL> GetAllHmos()
 //{
 //    using (HMO_PROGECTEntities ctx = new HMO_PROGECTEntities())
 //    {
 //        return HmoCRUD.GetAllHmos(ctx);
 //    }
 //}
 public static List <HMO_DTO> GetAllHmo()
 {
     using (HMO_PROGECTEntities ctx = new HMO_PROGECTEntities())
     {
         var            hmoList = HmoCRUD.GetAllHmos(ctx);
         List <HMO_DTO> hmos    = new List <HMO_DTO>();
         foreach (var hmo in hmoList)
         {
             hmos.Add(HMO_Casting.CastToDTO(hmo));
         }
         return(hmos);
     }
 }