public ProcessResult <object> Registrar(PermisosRequest data)
        {
            ProcessResult <object> resultado = new ProcessResult <object>();

            try
            {
                if (data.CodigoPermisos > 0)
                {
                    PermisosEntity Entity = EntityRepository.GetById(data.CodigoPermisos);

                    if (Entity != null)
                    {
                        Entity.CodigoPermisos = data.CodigoPermisos;
                        Entity.CodigoPerfil   = data.CodigoPerfil;
                        Entity.CodigoAccion   = data.CodigoAccion;
                        Entity.CodigoOpcion   = data.CodigoOpcion;
                        Entity.EstadoPermiso  = data.EstadoPermiso;

                        EntityRepository.Editar(Entity);
                        resultado.IsSuccess = true;
                        EntityRepository.GuardarCambios();
                    }
                }
                else
                {
                    PermisosEntity Entity = new PermisosEntity();
                    Entity.CodigoPerfil  = data.CodigoPerfil;
                    Entity.CodigoAccion  = data.CodigoAccion;
                    Entity.CodigoOpcion  = data.CodigoOpcion;
                    Entity.EstadoPermiso = data.EstadoPermiso;

                    EntityRepository.Insertar(Entity);

                    resultado.IsSuccess = true;
                    EntityRepository.GuardarCambios();
                }
            }
            catch (Exception ex)
            {
                resultado.Exception = new ApplicationLayerException <PermisosService>(ex.Message);
            }
            return(resultado);
        }
        public ProcessResult <object> Eliminar(PermisosRequest filtro)
        {
            ProcessResult <object> resultado = new ProcessResult <object>();

            resultado.Result = string.Empty;

            try
            {
                PermisosEntity Entity = EntityRepository.GetById(filtro.CodigoPermisos);

                if (Entity != null)
                {
                    EntityRepository.Eliminar(Entity.CodigoPermisos);

                    resultado.IsSuccess = true;
                    EntityRepository.GuardarCambios();
                }
            }
            catch (Exception ex)
            {
                resultado.Exception = new ApplicationLayerException <PermisosService>(ex.Message);
            }
            return(resultado);
        }