/// <summary>
        /// Response of reorder
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SendOrderwebservicecall_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
        {
            SendOrderResponse objSendOrderResponse = new SendOrderResponse();

            try
            {
                if (e.Result != null)
                {
                    var response = e.Result.ToString();
                    objSendOrderResponse = Utils.JsonHelper.Deserialize <SendOrderResponse>(response);

                    if (objSendOrderResponse.status == 0)
                    {
                        orderDetailsViewModel.IsPopupCancelledOpen = true;
                        orderDetailsViewModel.PopupCancelText      = "Re-Ordered";
                        App.prescriptionCollection.Clear();
                        orderDetailsViewModel.HitVisibility = false;
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("No Internet Connectivity.");
            }
        }
Beispiel #2
0
        /// <summary>
        /// Response of webservice
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SendOrderwebservicecall_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
        {
            SendOrderResponse objSendOrderResponse = new SendOrderResponse();

            try
            {
                if (e.Result != null)
                {
                    var response = e.Result.ToString();
                    objSendOrderResponse = Utils.JsonHelper.Deserialize <SendOrderResponse>(response);

                    if (objSendOrderResponse.status == 0)
                    {
                        App.TombStonedPageURL = "RequestSent";
                        confirmRepeatViewModel.IsPopupSentOpen = true;
                        confirmRepeatViewModel.HitVisibility   = false;
                        App.prescriptionCollection.Clear();
                    }
                }
            }
            catch (Exception)
            {
                confirmRepeatViewModel.HitVisibility = true;
                MessageBox.Show("Sorry, Unable to process your request.");
            }
        }
Beispiel #3
0
        public async Task <SendOrderResponse> SendExpress(SendOrderInfo info)
        {
            Logger.InfoFormat("正在向顺丰发起寄件,订单号:{0},收件人:{1},收货人联系手机:{2},收货地址:{3},寄件人:{4},寄件地址:{5}"
                              , info.OrderId, info.DContact, info.DMobile, info.DAddress, info.JContact, info.JAddress);

            SendOrderRequest request = new SendOrderRequest();

            request.OrderBody.Order = info;
            request.Head            = await _settingManager.GetSettingValueAsync(Settings.ShunFeng.ClientCode);

            request.OrderBody.Order.CustId = await _settingManager.GetSettingValueAsync(Settings.ShunFeng.CustId);

            request.ServiceName = "OrderService";
            request.Lang        = "zh-CN";
            var url = await _settingManager.GetSettingValueAsync(Settings.ShunFeng.Url);

            var checkword = await _settingManager.GetSettingValueAsync(Settings.ShunFeng.CheckWord);

            var result = await DoPostAsync(
                url,
                request.ToXml(), GetVerifyCode(request.ToXml(), checkword));

            var response = SendOrderResponse.Parse(result);

            if (response.Head == "OK")
            {
                Logger.InfoFormat("订单号:{0}发起寄件成功!运单号:{1}。", response.Body.OrderResponse.OrderId, response.Body.OrderResponse.MailNo);
            }
            else
            {
                Logger.ErrorFormat("订单号:{0}发起寄件失败,失败原因:{1}", info.OrderId, response.Error);
            }

            return(response);
        }
        public override async Task Run(OrderRequest message)
        {
            this.logger.LogInformation("Recevied OrderRequest from Retailer.");

            var command = new SendOrderResponse(message);

            await this.mediator.Send(command);
        }