public bool Delete() { try { Dalc.HORARIO r = CommonBC.Modelo.HORARIO.First(rx => rx.ID == Id); CommonBC.Modelo.HORARIO.Remove(r); CommonBC.Modelo.SaveChanges(); return(true); } catch (Exception ex) { return(false); } }
public bool LeerPorIdServicio() { try { Dalc.HORARIO r = CommonBC.Modelo.HORARIO.Single(rx => rx.ID_SERVICIO == IdServicio); Id = r.ID; DiaAtencion = r.DIA_ATENCION; HoraAtencion = r.HORA_ATENCION; IdServicio = r.ID_SERVICIO; IdOdontologo = r.ID_ODONTOLOGO; return(true); } catch (Exception ex) { return(false); } }
public bool Update() { try { Dalc.HORARIO r = CommonBC.Modelo.HORARIO.First(rx => rx.ID == Id); r.ID = Id; r.DIA_ATENCION = DiaAtencion; r.HORA_ATENCION = HoraAtencion; r.ID_SERVICIO = IdServicio; r.ID_ODONTOLOGO = IdOdontologo; CommonBC.Modelo.SaveChanges(); return(true); } catch (Exception ex) { return(false); } }
public bool Create() { Dalc.HORARIO r = new Dalc.HORARIO(); try { r.ID = Id; r.DIA_ATENCION = DiaAtencion; r.HORA_ATENCION = HoraAtencion; r.ID_SERVICIO = IdServicio; r.ID_ODONTOLOGO = IdOdontologo; CommonBC.Modelo.HORARIO.Add(r); CommonBC.Modelo.SaveChanges(); return(true); } catch (Exception ex) { CommonBC.Modelo.HORARIO.Remove(r); return(false); } }