Exemplo n.º 1
0
        public void Delete(int Id)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    RepositorioEXAMEN_DETALLE repositorio     = new RepositorioEXAMEN_DETALLE(context);
                    EXAMEN_DETALLE            _EXAMEN_DETALLE = repositorio.GetById(Id);

                    if (Equals(_EXAMEN_DETALLE, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado EXAMEN_DETALLE con Id =", Id.ToString()));
                    }

                    _EXAMEN_DETALLE.ACTIVO = false;

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
Exemplo n.º 2
0
        public void Update(int Id, int EXAMENId, int EXAMEN1Id)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    RepositorioEXAMEN_DETALLE repositorio     = new RepositorioEXAMEN_DETALLE(context);
                    EXAMEN_DETALLE            _EXAMEN_DETALLE = repositorio.GetById(Id);
                    if (Equals(_EXAMEN_DETALLE, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado EXAMEN_DETALLE con Id =", Id.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()));
                    }

                    RepositorioEXAMEN _repositorioEXAMEN1 = new RepositorioEXAMEN(context);
                    EXAMEN            _objEXAMEN1         = _repositorioEXAMEN1.GetById(EXAMEN1Id);
                    if (Equals(_objEXAMEN1, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado EXAMEN1 con Id =", EXAMEN1Id.ToString()));
                    }

                    //properties


                    //parents

                    _EXAMEN_DETALLE.EXAMEN  = _objEXAMEN;
                    _EXAMEN_DETALLE.EXAMEN1 = _objEXAMEN1;

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
Exemplo n.º 3
0
 public EXAMEN_DETALLE GetByIdWithReferences(int ID)
 {
     Init();
     try
     {
         using (LQCEEntities context = new LQCEEntities())
         {
             RepositorioEXAMEN_DETALLE repositorio = new RepositorioEXAMEN_DETALLE(context);
             return(repositorio.GetByIdWithReferences(ID));
         }
     }
     catch (Exception ex)
     {
         ISException.RegisterExcepcion(ex);
         Error = ex.Message;
         throw ex;
     }
 }
Exemplo n.º 4
0
 public List <EXAMEN_DETALLE> GetAllWithReferences()
 {
     Init();
     try
     {
         using (LQCEEntities context = new LQCEEntities())
         {
             RepositorioEXAMEN_DETALLE repositorio = new RepositorioEXAMEN_DETALLE(context);
             return(repositorio.GetAllWithReferences().OrderBy(i => i.ID).ToList());
         }
     }
     catch (Exception ex)
     {
         ISException.RegisterExcepcion(ex);
         Error = ex.Message;
         throw ex;
     }
 }
Exemplo n.º 5
0
 public List <EXAMEN_DETALLE> GetByFilter(int?EXAMENId = null, int?EXAMEN1Id = null)
 {
     Init();
     try
     {
         using (LQCEEntities context = new LQCEEntities())
         {
             RepositorioEXAMEN_DETALLE repositorio = new RepositorioEXAMEN_DETALLE(context);
             return(repositorio.GetByFilter(EXAMENId, EXAMEN1Id).OrderBy(i => i.ID).ToList());
         }
     }
     catch (Exception ex)
     {
         ISException.RegisterExcepcion(ex);
         Error = ex.Message;
         throw ex;
     }
 }