Ejemplo 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;
            }
        }
Ejemplo 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;
            }
        }
Ejemplo n.º 3
0
        public int Add(int EXAMENId, int EXAMEN1Id)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    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()));
                    }

                    EXAMEN_DETALLE _EXAMEN_DETALLE = new EXAMEN_DETALLE();

                    //properties

                    _EXAMEN_DETALLE.ACTIVO = true;

                    //parents

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

                    context.AddObject("EXAMEN_DETALLE", _EXAMEN_DETALLE);
                    context.SaveChanges();

                    return(_EXAMEN_DETALLE.ID);
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
Ejemplo n.º 4
0
 public void AddToEXAMEN_DETALLE(EXAMEN_DETALLE eXAMEN_DETALLE)
 {
     base.AddObject("EXAMEN_DETALLE", eXAMEN_DETALLE);
 }
Ejemplo n.º 5
0
 public static EXAMEN_DETALLE CreateEXAMEN_DETALLE(int id, bool aCTIVO)
 {
     EXAMEN_DETALLE eXAMEN_DETALLE = new EXAMEN_DETALLE();
     eXAMEN_DETALLE.ID = id;
     eXAMEN_DETALLE.ACTIVO = aCTIVO;
     return eXAMEN_DETALLE;
 }