public static List <EAtencion_detalle> mostrar(int ID) { try { List <EAtencion_detalle> EDetalle = new List <EAtencion_detalle>(); List <atencion_detalle> DDetalle = new List <atencion_detalle>(); using (dbodontogramaEntity cn = new dbodontogramaEntity()) { DDetalle = (from c in cn.atencion_detalle where c.estado == 1 where c.atencion.pacienteID == ID select c).ToList(); foreach (var item in DDetalle) { EAtencion_detalle Obj = new EAtencion_detalle(); Obj.odontogramaID = item.odontogramaID; Obj.atencionID = item.atencionID; Obj.estado = item.estado; EDetalle.Add(Obj); } return(EDetalle); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public EAtencion_detalle mostrarTodo(int ID) { try { EAtencion_detalle EDetalle = new EAtencion_detalle(); atencion_detalle DDetalle = new atencion_detalle(); using (dbodontogramaEntity cn = new dbodontogramaEntity()) { DDetalle = (from c in cn.atencion_detalle where c.estado == 1 where c.atencion.pacienteID == 2 select c).First(); return(EDetalle); } } catch (Exception ex) { throw new Exception(ex.Message); } }