Example #1
0
        private void CreateString(DataTable dt)
        {
            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    string orderid       = dr["orderid"].ToString();
                    string ShipToID      = dr["IdentityCard"].ToString();
                    string ShipToName    = dr["ShipTo"].ToString();
                    string ShipToaddress = dr["address"].ToString();
                    string ShipToPhone   = dr["CellPhone"].ToString();
                    //orderNo  订单号
                    //userName 姓名
                    //idCareNum 身份证号码
                    //phoneNum 收货人手机
                    //address 收货地址
                    string postData = "orderNo=" + orderid + "&userName="******"&idCareNum=" + ShipToID + "&phoneNum=" + ShipToPhone + "&address=" + ShipToaddress;
                    ErrorLog.Write("efindUrl send data : " + postData);

                    string str = SendData(efindUrl, postData);

                    ErrorLog.Write("efindUrl return data : " + str);

                    HSCodeHelper.SetPayerIDStatus(orderid, ShipToName, ShipToID, ShipToaddress, ShipToPhone, str, runType);
                }
            }
        }
Example #2
0
        private void btnMondifyAddress_Click(object sender, System.EventArgs e)
        {
            OrderInfo orderInfo  = OrderHelper.GetOrderInfo(this.orderId);
            string    tempToName = orderInfo.ShipTo;
            string    tempToId   = orderInfo.IdentityCard;

            orderInfo.ShipTo         = this.txtShipTo.Text.Trim();
            orderInfo.RegionId       = this.dropRegions.GetSelectedRegionId().Value;
            orderInfo.Address        = this.txtAddress.Text.Trim();
            orderInfo.TelPhone       = this.txtTelPhone.Text.Trim();
            orderInfo.CellPhone      = this.txtCellPhone.Text.Trim();
            orderInfo.ZipCode        = this.txtZipcode.Text.Trim();
            orderInfo.ShippingRegion = this.dropRegions.SelectedRegions;
            if (!string.IsNullOrEmpty(this.txtIdentityCard.Text))
            {
                if (this.txtIdentityCard.Text.IndexOf("********") < 0)
                {
                    orderInfo.IdentityCard = this.txtIdentityCard.Text.Trim();
                }
            }
            if (string.IsNullOrEmpty(this.txtTelPhone.Text.Trim()) && string.IsNullOrEmpty(this.txtCellPhone.Text.Trim()))
            {
                this.ShowMsg("电话号码和手机号码必填其一", false);
                return;
            }
            if (this.action == "update")
            {
                string errorMsg = "";
                //if ((tempToName != this.txtShipTo.Text.Trim() || tempToId != this.txtIdentityCard.Text.Trim()) && this.txtIdentityCard.Text.IndexOf("********") < 0)
                if (tempToName != this.txtShipTo.Text.Trim() || tempToId.ToLower() != this.txtIdentityCard.Text.Trim().ToLower())
                {
                    string orderid       = this.orderId;
                    string ShipToID      = this.txtIdentityCard.Text.Trim();
                    string ShipToName    = this.txtShipTo.Text.Trim();
                    string ShipToaddress = this.txtAddress.Text.Trim();
                    string ShipToPhone   = this.txtCellPhone.Text.Trim() != "" ? this.txtCellPhone.Text.Trim() : this.txtTelPhone.Text.Trim();
                    //orderNo  订单号
                    //userName 姓名
                    //idCareNum 身份证号码
                    //phoneNum 收货人手机
                    //address 收货地址
                    string postData = "orderNo=" + orderid + "&userName="******"&idCareNum=" + ShipToID + "&phoneNum=" + ShipToPhone + "&address=" + ShipToaddress;
                    ErrorLog.Write("后台订单身份验证:efindUrl send data : " + postData);

                    string str = SendData(efindUrl, postData);

                    try
                    {
                        XmlDocument xmlDocument = new XmlDocument();
                        xmlDocument.LoadXml(str);

                        XmlNode node = xmlDocument.SelectSingleNode("result/code");

                        if (node.InnerText == "200")
                        {
                            XmlNode nodeName         = xmlDocument.SelectSingleNode("result/retvalue/emResult/name");
                            XmlNode nodeOrderId      = xmlDocument.SelectSingleNode("result/retvalue/emResult/orderId");
                            XmlNode nodeStatus       = xmlDocument.SelectSingleNode("result/retvalue/emResult/status");
                            XmlNode nodeErrorcode    = xmlDocument.SelectSingleNode("result/retvalue/emResult/errorcode");
                            XmlNode nodeErrormessage = xmlDocument.SelectSingleNode("result/retvalue/emResult/errormessage");
                            XmlNode nodeIDCardNum    = xmlDocument.SelectSingleNode("result/retvalue/emResult/idCardNum");

                            if (nodeStatus != null)
                            {
                                if (nodeStatus.InnerText.ToUpper() == "PASS")
                                {
                                    errorMsg = "实名认证成功!";
                                }
                                if (nodeStatus.InnerText.ToUpper() == "NOPASS")
                                {
                                    errorMsg = "实名认证失败!";
                                }
                            }
                            else
                            {
                                errorMsg = "实名认证失败!";
                            }
                        }
                        else
                        {
                            ErrorLog.Write("efindUrl interface fail");
                        }
                        HSCodeHelper.SetPayerIDStatus(orderid, ShipToName, ShipToID, ShipToaddress, ShipToPhone, str, runType);
                    }
                    catch (Exception)
                    {
                        errorMsg = "实名认证失败!";
                    }
                }
                else
                {
                    if (orderInfo.payerIdStatus == 2)
                    {
                        errorMsg = "实名认证成功!";
                    }
                    else
                    {
                        errorMsg = "实名认证失败!";
                    }
                }

                orderInfo.OrderId = this.orderId;
                if (errorMsg.Contains("实名认证成功"))
                {
                    if (OrderHelper.MondifyAddress(orderInfo))
                    {
                        OrderHelper.GetOrderInfo(this.orderId);
                        this.ShowMsg("修改成功," + errorMsg, true);
                        return;
                    }
                }

                this.ShowMsg("修改失败," + errorMsg, false);
            }
        }