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

            try
            {
                if (data.CodigoOpcion > 0)
                {
                    OpcionEntity Entity = EntityRepository.GetById(data.CodigoOpcion);

                    if (Entity != null)
                    {
                        Entity.CodigoOpcion = data.CodigoOpcion;
                        Entity.CodigoModulo = data.CodigoModulo;
                        Entity.OpcionPadre  = data.OpcionPadre;
                        Entity.Nombre       = data.Nombre;
                        Entity.Descripcion  = data.Descripcion;
                        Entity.Glyphicon    = data.Glyphicon;
                        Entity.Controlador  = data.Controlador;
                        Entity.Metodo       = data.Metodo;
                        Entity.Area         = data.Area;

                        EntityRepository.Editar(Entity);
                        resultado.IsSuccess = true;
                        EntityRepository.GuardarCambios();
                    }
                }
                else
                {
                    OpcionEntity Entity = new OpcionEntity();
                    Entity.CodigoModulo = data.CodigoModulo;
                    Entity.OpcionPadre  = data.OpcionPadre;
                    Entity.Nombre       = data.Nombre;
                    Entity.Descripcion  = data.Descripcion;
                    Entity.Glyphicon    = data.Glyphicon;
                    Entity.Controlador  = data.Controlador;
                    Entity.Metodo       = data.Metodo;
                    Entity.Area         = data.Area;

                    EntityRepository.Insertar(Entity);

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

            resultado.Result = string.Empty;

            try
            {
                OpcionEntity Entity = EntityRepository.GetById(filtro.CodigoOpcion);

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

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