public function grabarcambiocargaagenciaAction()
 {
     try {
         $SesionUsuarioPlugin = $this->SesionUsuarioPlugin();
         $EntityManagerPlugin = $this->EntityManagerPlugin();
         $PedidoBO = new PedidoBO();
         $PedidoDetData = new PedidoDetData();
         $PedidoCabData = new PedidoCabData();
         $PedidoBO->setEntityManager($EntityManagerPlugin->getEntityManager());
         $SesionUsuarioPlugin->isLoginClienteVendedor();
         $usuario_id = $SesionUsuarioPlugin->getUsuarioId();
         $pedido_cab_id = intval($this->params()->fromPost('pedido_cab_id', ''));
         $pedido_det_sec = intval($this->params()->fromPost('pedido_det_sec', ''));
         $agencia_carga_id = $this->params()->fromPost('agencia_carga_id', '');
         /*$PedidoDetData->setPedidoCabId($pedido_cab_id);
         		$PedidoDetData->setPedidoDetSec($pedido_det_sec);
         		$PedidoDetData->setAgenciaCargaId($agencia_carga_id);
         		$PedidoDetData->setUsuarioModId	($usuario_id);
         		*/
         $PedidoCabData->setId($pedido_cab_id);
         $PedidoCabData->setAgenciaCargaId($agencia_carga_id);
         $PedidoCabData->setUsuarioModId($usuario_id);
         //Realiza el cambio de la marcacion
         //$result		= $PedidoBO->cambiarAgenciaCarga($PedidoDetData);
         //$result		= $PedidoBO->consultarDetallePedido($pedido_cab_id, $pedido_det_sec, \Application\Constants\ResultType::MATRIZ);
         $result = $PedidoBO->cambiarAgenciaCarga($PedidoCabData);
         $result = $PedidoBO->consultarPedidoCabecera($pedido_cab_id);
         //En caso de ser CERO los detalles de los registros, la variable de session de PedidoCabIdActual debe de encerarse
         $response = new \stdClass();
         $response->respuesta_code = 'OK';
         $response->respuesta_mensaje = '';
         $response->agencia_carga_id = $result['agencia_carga_id'];
         //Se retorna el id, para confirmar en el frontend el cambio
         $response->agencia_carga_nombre = $result['agencia_carga_nombre'];
         //Se retorna el nombre, para confirmar en el frontend el cambio
         $json = new JsonModel(get_object_vars($response));
         return $json;
         //false
     } catch (\Exception $e) {
         $excepcion_msg = utf8_encode($this->ExcepcionPlugin()->getMessageFormat($e));
         $response = $this->getResponse();
         $response->setStatusCode(500);
         $response->setContent($excepcion_msg);
         return $response;
     }
 }