public void Delete(int Id) { 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())); } _CONVENIO_EXAMEN.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 void AddToCONVENIO_EXAMEN(CONVENIO_EXAMEN cONVENIO_EXAMEN) { base.AddObject("CONVENIO_EXAMEN", cONVENIO_EXAMEN); }
public static CONVENIO_EXAMEN CreateCONVENIO_EXAMEN(int id, int vALOR, bool aCTIVO) { CONVENIO_EXAMEN cONVENIO_EXAMEN = new CONVENIO_EXAMEN(); cONVENIO_EXAMEN.ID = id; cONVENIO_EXAMEN.VALOR = vALOR; cONVENIO_EXAMEN.ACTIVO = aCTIVO; return cONVENIO_EXAMEN; }