Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
 public CONVENIO_EXAMEN GetByIdWithReferences(int ID)
 {
     Init();
     try
     {
         using (LQCEEntities context = new LQCEEntities())
         {
             RepositorioCONVENIO_EXAMEN repositorio = new RepositorioCONVENIO_EXAMEN(context);
             return(repositorio.GetByIdWithReferences(ID));
         }
     }
     catch (Exception ex)
     {
         ISException.RegisterExcepcion(ex);
         Error = ex.Message;
         throw ex;
     }
 }
Esempio n. 4
0
 public List <CONVENIO_EXAMEN> GetAllWithReferences()
 {
     Init();
     try
     {
         using (LQCEEntities context = new LQCEEntities())
         {
             RepositorioCONVENIO_EXAMEN repositorio = new RepositorioCONVENIO_EXAMEN(context);
             return(repositorio.GetAllWithReferences().OrderBy(i => i.ID).ToList());
         }
     }
     catch (Exception ex)
     {
         ISException.RegisterExcepcion(ex);
         Error = ex.Message;
         throw ex;
     }
 }
Esempio n. 5
0
 public List <CONVENIO_EXAMEN> GetByFilterWithReferences(int?CONVENIO_TARIFARIOId = null, int?EXAMENId = null, int?VALOR = null)
 {
     Init();
     try
     {
         using (LQCEEntities context = new LQCEEntities())
         {
             RepositorioCONVENIO_EXAMEN repositorio = new RepositorioCONVENIO_EXAMEN(context);
             return(repositorio.GetByFilterWithReferences(CONVENIO_TARIFARIOId, EXAMENId, VALOR).OrderBy(i => i.ID).ToList());
         }
     }
     catch (Exception ex)
     {
         ISException.RegisterExcepcion(ex);
         Error = ex.Message;
         throw ex;
     }
 }