Ejemplo n.º 1
0
        /*private void OnOrderClosed(IOrder order)
         * {
         *  PluginContext.Log.Info($"Order {order.Number} ({order.Id}) is Close.");
         *  var json = OrderHelper.GetOrderClosePackageJson(order);
         *  HttpSender.AddTask(new HttpSenderTask { Url = HttpSender.PostChequeUrl, Json = json, Method = HttpMethod.Delete });
         * }*/

        /*private void OnOrderBill(IOrder order)
         * {
         *  PluginContext.Log.Info($"Order {order.Number} ({order.Id}) is Bill.");
         *  var json = OrderHelper.GetOrderPackageJson(order);
         *  HttpSender.AddTask(new HttpSenderTask { Url = HttpSender.PostChequeUrl, Json = json, Method = HttpMethod.Post });
         * }*/

        private void OnOrderChange(IOrder order)
        {
            PluginContext.Log.Info($"Order {order.Number} ({order.Id}) is Changed.");
            string json = null;

            try
            {
                json = OrderHelper.GetOrderPackageJson(order);
            }
            catch (Exception e)
            {
                PluginContext.Log.Error($"get order error by {order.Id}", e);
            }

            if (json != null)
            {
                try
                {
                    HttpSender.AddTask(new HttpSenderTask {
                        Url = HttpSender.PostChequeUrl, Json = json, Method = HttpMethod.Post
                    });
                }
                catch (Exception e)
                {
                    PluginContext.Log.Error($"add task to HttpSender error", e);
                }
            }
        }
Ejemplo n.º 2
0
        private void OnServiceChequePrinted(IOrder order, IOperationService service, IViewManager manager)
        {
            PluginContext.Log.Info("Printed precheck");
            var json = OrderHelper.GetOrderPackageJson(order);

            HttpSender.AddTask(new HttpSenderTask {
                Url = HttpSender.PostChequeUrl, Json = json
            });
            PluginContext.Log.Info(json);
        }
Ejemplo n.º 3
0
        private BillCheque OnBillChequePrinting(Guid orderId)
        {
            PluginContext.Log.Info("Printing precheck");
            var order = PluginContext.Operations.GetOrderById(orderId);
            var json  = OrderHelper.GetOrderPackageJson(order);

            PluginContext.Log.Info(json);
            HttpSender.AddTask(new HttpSenderTask {
                Url = HttpSender.PostChequeUrl, Json = json, Method = HttpMethod.Post
            });
            return(new BillCheque());
        }