Exemple #1
0
        public void Update(int Id, string NOMBRE)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    RepositorioCARGA_PRESTACIONES_ESTADO repositorio = new RepositorioCARGA_PRESTACIONES_ESTADO(context);
                    CARGA_PRESTACIONES_ESTADO            _CARGA_PRESTACIONES_ESTADO = repositorio.GetById(Id);
                    if (Equals(_CARGA_PRESTACIONES_ESTADO, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado CARGA_PRESTACIONES_ESTADO con Id =", Id.ToString()));
                    }

                    //properties

                    if (!string.IsNullOrEmpty(NOMBRE))
                    {
                        _CARGA_PRESTACIONES_ESTADO.NOMBRE = NOMBRE;
                    }

                    //parents


                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
Exemple #2
0
        public void Delete(int Id)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    RepositorioCARGA_PRESTACIONES_ESTADO repositorio = new RepositorioCARGA_PRESTACIONES_ESTADO(context);
                    CARGA_PRESTACIONES_ESTADO            _CARGA_PRESTACIONES_ESTADO = repositorio.GetById(Id);

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

                    _CARGA_PRESTACIONES_ESTADO.ACTIVO = false;

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
Exemple #3
0
        public int Add(string NOMBRE)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    CARGA_PRESTACIONES_ESTADO _CARGA_PRESTACIONES_ESTADO = new CARGA_PRESTACIONES_ESTADO();

                    //properties

                    _CARGA_PRESTACIONES_ESTADO.NOMBRE = NOMBRE;
                    _CARGA_PRESTACIONES_ESTADO.ACTIVO = true;

                    //parents


                    context.AddObject("CARGA_PRESTACIONES_ESTADO", _CARGA_PRESTACIONES_ESTADO);
                    context.SaveChanges();

                    return(_CARGA_PRESTACIONES_ESTADO.ID);
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
Exemple #4
0
        public void Update(int Id, int CARGA_PRESTACIONES_ESTADOId, int TIPO_PRESTACIONId, System.DateTime FECHA_CARGA, string ARCHIVO)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    RepositorioCARGA_PRESTACIONES_ENCABEZADO repositorio = new RepositorioCARGA_PRESTACIONES_ENCABEZADO(context);
                    CARGA_PRESTACIONES_ENCABEZADO            _CARGA_PRESTACIONES_ENCABEZADO = repositorio.GetById(Id);
                    if (Equals(_CARGA_PRESTACIONES_ENCABEZADO, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado CARGA_PRESTACIONES_ENCABEZADO con Id =", Id.ToString()));
                    }

                    RepositorioCARGA_PRESTACIONES_ESTADO _repositorioCARGA_PRESTACIONES_ESTADO = new RepositorioCARGA_PRESTACIONES_ESTADO(context);
                    CARGA_PRESTACIONES_ESTADO            _objCARGA_PRESTACIONES_ESTADO         = _repositorioCARGA_PRESTACIONES_ESTADO.GetById(CARGA_PRESTACIONES_ESTADOId);
                    if (Equals(_objCARGA_PRESTACIONES_ESTADO, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado CARGA_PRESTACIONES_ESTADO con Id =", CARGA_PRESTACIONES_ESTADOId.ToString()));
                    }

                    RepositorioTIPO_PRESTACION _repositorioTIPO_PRESTACION = new RepositorioTIPO_PRESTACION(context);
                    TIPO_PRESTACION            _objTIPO_PRESTACION         = _repositorioTIPO_PRESTACION.GetById(TIPO_PRESTACIONId);
                    if (Equals(_objTIPO_PRESTACION, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado TIPO_PRESTACION con Id =", TIPO_PRESTACIONId.ToString()));
                    }

                    //properties

                    _CARGA_PRESTACIONES_ENCABEZADO.FECHA_CARGA = FECHA_CARGA;
                    if (!string.IsNullOrEmpty(ARCHIVO))
                    {
                        _CARGA_PRESTACIONES_ENCABEZADO.ARCHIVO = ARCHIVO;
                    }

                    //parents

                    _CARGA_PRESTACIONES_ENCABEZADO.CARGA_PRESTACIONES_ESTADO = _objCARGA_PRESTACIONES_ESTADO;
                    _CARGA_PRESTACIONES_ENCABEZADO.TIPO_PRESTACION           = _objTIPO_PRESTACION;

                    context.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
Exemple #5
0
        public int Add(int CARGA_PRESTACIONES_ESTADOId, int TIPO_PRESTACIONId, System.DateTime FECHA_CARGA, string ARCHIVO)
        {
            Init();
            try
            {
                using (LQCEEntities context = new LQCEEntities())
                {
                    RepositorioCARGA_PRESTACIONES_ESTADO _repositorioCARGA_PRESTACIONES_ESTADO = new RepositorioCARGA_PRESTACIONES_ESTADO(context);
                    CARGA_PRESTACIONES_ESTADO            _objCARGA_PRESTACIONES_ESTADO         = _repositorioCARGA_PRESTACIONES_ESTADO.GetById(CARGA_PRESTACIONES_ESTADOId);
                    if (Equals(_objCARGA_PRESTACIONES_ESTADO, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado CARGA_PRESTACIONES_ESTADO con Id =", CARGA_PRESTACIONES_ESTADOId.ToString()));
                    }

                    RepositorioTIPO_PRESTACION _repositorioTIPO_PRESTACION = new RepositorioTIPO_PRESTACION(context);
                    TIPO_PRESTACION            _objTIPO_PRESTACION         = _repositorioTIPO_PRESTACION.GetById(TIPO_PRESTACIONId);
                    if (Equals(_objTIPO_PRESTACION, null))
                    {
                        throw new Exception(String.Concat("No se ha encontrado TIPO_PRESTACION con Id =", TIPO_PRESTACIONId.ToString()));
                    }

                    CARGA_PRESTACIONES_ENCABEZADO _CARGA_PRESTACIONES_ENCABEZADO = new CARGA_PRESTACIONES_ENCABEZADO();

                    //properties

                    _CARGA_PRESTACIONES_ENCABEZADO.FECHA_CARGA = FECHA_CARGA;
                    _CARGA_PRESTACIONES_ENCABEZADO.ARCHIVO     = ARCHIVO;
                    _CARGA_PRESTACIONES_ENCABEZADO.ACTIVO      = true;

                    //parents

                    _CARGA_PRESTACIONES_ENCABEZADO.CARGA_PRESTACIONES_ESTADO = _objCARGA_PRESTACIONES_ESTADO;
                    _CARGA_PRESTACIONES_ENCABEZADO.TIPO_PRESTACION           = _objTIPO_PRESTACION;

                    context.AddObject("CARGA_PRESTACIONES_ENCABEZADO", _CARGA_PRESTACIONES_ENCABEZADO);
                    context.SaveChanges();

                    return(_CARGA_PRESTACIONES_ENCABEZADO.ID);
                }
            }
            catch (Exception ex)
            {
                ISException.RegisterExcepcion(ex);
                Error = ex.Message;
                throw ex;
            }
        }
 public static CARGA_PRESTACIONES_ESTADO CreateCARGA_PRESTACIONES_ESTADO(int id, string nOMBRE, bool aCTIVO)
 {
     CARGA_PRESTACIONES_ESTADO cARGA_PRESTACIONES_ESTADO = new CARGA_PRESTACIONES_ESTADO();
     cARGA_PRESTACIONES_ESTADO.ID = id;
     cARGA_PRESTACIONES_ESTADO.NOMBRE = nOMBRE;
     cARGA_PRESTACIONES_ESTADO.ACTIVO = aCTIVO;
     return cARGA_PRESTACIONES_ESTADO;
 }
 public void AddToCARGA_PRESTACIONES_ESTADO(CARGA_PRESTACIONES_ESTADO cARGA_PRESTACIONES_ESTADO)
 {
     base.AddObject("CARGA_PRESTACIONES_ESTADO", cARGA_PRESTACIONES_ESTADO);
 }