public void Delete(int Id) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioCONVENIO_TARIFARIO repositorio = new RepositorioCONVENIO_TARIFARIO(context); CONVENIO_TARIFARIO _CONVENIO_TARIFARIO = repositorio.GetById(Id); if (Equals(_CONVENIO_TARIFARIO, null)) { throw new Exception(String.Concat("No se ha encontrado CONVENIO_TARIFARIO con Id =", Id.ToString())); } _CONVENIO_TARIFARIO.ACTIVO = false; context.SaveChanges(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public void Update(int Id, int CONVENIO_TARIFARIOId, int EXAMENId, int VALOR) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioCONVENIO_EXAMEN repositorio = new RepositorioCONVENIO_EXAMEN(context); CONVENIO_EXAMEN _CONVENIO_EXAMEN = repositorio.GetById(Id); if (Equals(_CONVENIO_EXAMEN, null)) { throw new Exception(String.Concat("No se ha encontrado CONVENIO_EXAMEN con Id =", Id.ToString())); } RepositorioCONVENIO_TARIFARIO _repositorioCONVENIO_TARIFARIO = new RepositorioCONVENIO_TARIFARIO(context); CONVENIO_TARIFARIO _objCONVENIO_TARIFARIO = _repositorioCONVENIO_TARIFARIO.GetById(CONVENIO_TARIFARIOId); if (Equals(_objCONVENIO_TARIFARIO, null)) { throw new Exception(String.Concat("No se ha encontrado CONVENIO_TARIFARIO con Id =", CONVENIO_TARIFARIOId.ToString())); } RepositorioEXAMEN _repositorioEXAMEN = new RepositorioEXAMEN(context); EXAMEN _objEXAMEN = _repositorioEXAMEN.GetById(EXAMENId); if (Equals(_objEXAMEN, null)) { throw new Exception(String.Concat("No se ha encontrado EXAMEN con Id =", EXAMENId.ToString())); } //properties _CONVENIO_EXAMEN.VALOR = VALOR; //parents _CONVENIO_EXAMEN.CONVENIO_TARIFARIO = _objCONVENIO_TARIFARIO; _CONVENIO_EXAMEN.EXAMEN = _objEXAMEN; context.SaveChanges(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public CONVENIO_TARIFARIO GetByIdWithReferences(int ID) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioCONVENIO_TARIFARIO repositorio = new RepositorioCONVENIO_TARIFARIO(context); return(repositorio.GetByIdWithReferences(ID)); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public List <CONVENIO_TARIFARIO> GetAllWithReferences() { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioCONVENIO_TARIFARIO repositorio = new RepositorioCONVENIO_TARIFARIO(context); return(repositorio.GetAllWithReferences().OrderBy(i => i.ID).ToList()); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public List <CONVENIO_TARIFARIO> GetByFilterWithReferences(int?CONVENIOId = null, System.DateTime?FECHA_VIGENCIA = null) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioCONVENIO_TARIFARIO repositorio = new RepositorioCONVENIO_TARIFARIO(context); return(repositorio.GetByFilterWithReferences(CONVENIOId, FECHA_VIGENCIA).OrderBy(i => i.ID).ToList()); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }
public void Update(int Id, int CONVENIOId, System.DateTime FECHA_VIGENCIA) { Init(); try { using (LQCEEntities context = new LQCEEntities()) { RepositorioCONVENIO_TARIFARIO repositorio = new RepositorioCONVENIO_TARIFARIO(context); CONVENIO_TARIFARIO _CONVENIO_TARIFARIO = repositorio.GetById(Id); if (Equals(_CONVENIO_TARIFARIO, null)) { throw new Exception(String.Concat("No se ha encontrado CONVENIO_TARIFARIO con Id =", Id.ToString())); } RepositorioCONVENIO _repositorioCONVENIO = new RepositorioCONVENIO(context); CONVENIO _objCONVENIO = _repositorioCONVENIO.GetById(CONVENIOId); if (Equals(_objCONVENIO, null)) { throw new Exception(String.Concat("No se ha encontrado CONVENIO con Id =", CONVENIOId.ToString())); } //properties _CONVENIO_TARIFARIO.FECHA_VIGENCIA = FECHA_VIGENCIA; //parents _CONVENIO_TARIFARIO.CONVENIO = _objCONVENIO; context.SaveChanges(); } } catch (Exception ex) { ISException.RegisterExcepcion(ex); Error = ex.Message; throw ex; } }