コード例 #1
0
        /// <summary>
        /// 检测是否允许出货
        /// </summary>
        private bool CheckSaleEnvr()
        {
            int intErrCode = 0;

            bool result = false;

            try
            {
                this.tbProgressInfo.Dispatcher.Invoke(new Action(() =>
                {
                    // 正在检测设备状态...
                    tbProgressInfo.Text = PubHelper.p_LangOper.GetStringBundle("Check_Device");
                }));

                #region 检测是否允许出货

                m_CheckSaleEnvirCode = BusinessEnum.ServerReason.Normal;

                m_CheckSaleEnvirCode = PubHelper.p_BusinOper.Device_CheckSaleEnvir_O2O(m_McdCode, m_IDCardNum, "1");

                #endregion

                #region  报准备出货

                string strSellStatus   = string.Empty;
                string strNoSellReason = string.Empty;
                if (m_CheckSaleEnvirCode == BusinessEnum.ServerReason.Normal)
                {
                    strSellStatus = "0";// 可吐货
                }
                else
                {
                    strSellStatus = "1";// 不能吐货
                    switch (m_CheckSaleEnvirCode)
                    {
                    case BusinessEnum.ServerReason.Err_NoStock:    // 库存不足
                        strNoSellReason = "1";
                        m_ErrInfo       = "";
                        break;

                    case BusinessEnum.ServerReason.Err_GoodsExist:    // 商品不存在
                        strNoSellReason = "0";
                        m_ErrInfo       = "";
                        break;

                    case BusinessEnum.ServerReason.Err_AsileStatus:    // 货到故障
                        strNoSellReason = "2";
                        m_ErrInfo       = "";
                        break;

                    default:
                        strNoSellReason = "3";
                        m_ErrInfo       = "";
                        break;
                    }
                }

                intErrCode = PubHelper.p_BusinOper.O2OServerOper.ConfirmSellInfo(m_OrderID, strSellStatus, strNoSellReason);

                bool blnIsSell = false;
                if (m_CheckSaleEnvirCode == BusinessEnum.ServerReason.Normal)
                {
                    // 如果检测可以购买,但是提交吐货请求时出现故障,仍然暂停服务
                    if (intErrCode != 0)
                    {
                        m_ErrInfo = DictionaryHelper.Dictionary_IDCardCode(intErrCode);
                    }
                    else
                    {
                        blnIsSell = true;
                    }
                }

                result = blnIsSell;

                #endregion
            }
            catch
            {
                result = false;
            }
            return(result);
        }
コード例 #2
0
        /// <summary>
        /// 执行二代身份证业务(2015-06-10)
        /// </summary>
        private bool PostIDCard(out bool isFindIDCard)
        {
            bool result = false;

            isFindIDCard = false;

            try
            {
                int intErrCode = PubHelper.p_BusinOper.IDCardOper.SelectIDCard();

                if (intErrCode == 0)
                {
                    isFindIDCard = true;

                    #region 寻到身份证卡

                    // 停止超时监控
                    StopMonOutTime();

                    // 寻到身份证卡,界面更改
                    this.tbProgressInfo.Dispatcher.Invoke(new Action(() =>
                    {
                        // 正在读取身份证 FreeSell_IDCard_Pay_Reading
                        tbOutTime.Visibility = System.Windows.Visibility.Hidden;
                        tbProgressInfo.Text  = PubHelper.p_LangOper.GetStringBundle("FreeSell_IDCard_Pay_Reading");
                        btnCancel.Visibility = System.Windows.Visibility.Hidden;
                    }));

                    // 读取身份证信息
                    string strIDCardNum = string.Empty;
                    intErrCode = PubHelper.p_BusinOper.IDCardOper.ReadIDCardDetailInfo();
                    if (intErrCode == 0)
                    {
                        #region 读取身份证信息成功

                        this.tbProgressInfo.Dispatcher.Invoke(new Action(() =>
                        {
                            // 正在验证身份证信息...
                            tbProgressInfo.Text = PubHelper.p_LangOper.GetStringBundle("FreeSell_IDCard_Pay_Checking");
                        }));

                        #region 解析身份证信息

                        string strIDCard          = PubHelper.p_BusinOper.IDCardOper.IDCard_UserInfo.IDC;                      // 身份证号码
                        string strName            = PubHelper.p_BusinOper.IDCardOper.IDCard_UserInfo.Name;                     // 姓名
                        string strSex             = PubHelper.p_BusinOper.IDCardOper.IDCard_UserInfo.Sex_Code;                 // 性别
                        string strEthNic          = PubHelper.p_BusinOper.IDCardOper.IDCard_UserInfo.NATION_CName;             // 民族
                        string strbirthday        = PubHelper.p_BusinOper.IDCardOper.IDCard_UserInfo.BIRTH;                    // 生日
                        string strAddress         = PubHelper.p_BusinOper.IDCardOper.IDCard_UserInfo.ADDRESS;                  // 地址
                        string strissuance_organ  = PubHelper.p_BusinOper.IDCardOper.IDCard_UserInfo.REGORG;                   // 签发机关
                        string strvalidity_period = PubHelper.p_BusinOper.IDCardOper.IDCard_UserInfo.Period_Of_Validity_CName; // 有效期

                        m_IDCardNum = strIDCard;

                        #endregion

                        #region 读取二代身份证,提交请求

                        string _orderInfo = string.Empty;// 订单编号|商品编号|商品数量
                        intErrCode = PubHelper.p_BusinOper.O2OServerOper.QueryIDOrderInfo(strIDCard, strName, strSex, strEthNic,
                                                                                          strbirthday, strAddress, strissuance_organ, strvalidity_period, out _orderInfo);

                        switch (intErrCode)
                        {
                        case 0:    // 提交成功
                            #region 解析相关数据

                            string[] hexOrderData = _orderInfo.Split('|');
                            if (hexOrderData.Length > 1)
                            {
                                m_OrderID = hexOrderData[0];
                                m_McdCode = hexOrderData[1];

                                result = true;
                            }
                            else
                            {
                                intErrCode = 99;
                            }

                            #endregion
                            break;
                        }

                        #endregion

                        #endregion
                    }
                    else
                    {
                        // 读取身份证信息失败
                        intErrCode = 999;// 用999来作为身份证读取失败的错误代码
                    }

                    if (intErrCode != 0)
                    {
                        m_ErrInfo = DictionaryHelper.Dictionary_IDCardCode(intErrCode);
                    }

                    #endregion
                }
            }
            catch
            {
                isFindIDCard = false;
                result       = false;
            }

            return(result);
        }