Example #1
0
        /// <summary>
        /// 数字输入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnNumber_Click(object sender, RoutedEventArgs e)
        {
            if (m_Input.Length >= 6)
            {
                return;
            }
            string strInput = DictionaryHelper.Dictionary_Input(sender.ToString());

            m_Input = m_Input + strInput;
            switch (m_PwdType)
            {
            case "0":    // 旧密码
                m_Input_Old = m_Input;
                tbInput_Old.AppendText("*");
                tbInput_Old.Select(tbInput_Old.Text.Length, 0);
                break;

            case "1":    // 新密码
                m_Input_New = m_Input;
                tbInput_New.AppendText("*");
                tbInput_New.Select(tbInput_New.Text.Length, 0);
                break;

            case "2":    // 确认密码
                m_Input_Confirm = m_Input;
                tbInput_Confirm.AppendText("*");
                tbInput_Confirm.Select(tbInput_Confirm.Text.Length, 0);
                break;
            }

            ////tbInput.Text = tbInput.Text + "*";
        }
        private void btnNumber_Click(object sender, RoutedEventArgs e)
        {
            string strInput = DictionaryHelper.Dictionary_Input(sender.ToString());

            m_Input      = m_Input + strInput;
            tbInput.Text = m_Input;
        }
Example #3
0
        private void InitForm()
        {
            #region 初始化界面

            tbTitle.Text    = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_IDCard_Title");
            tbCfgTitle.Text = PubHelper.p_LangOper.GetStringBundle("Pub_DeviceCfg");

            tbWebUrl.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_IDCard_WebUrl");

            tbSerPort.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_IDCard_SerPort");
            cmbPort.Items.Add("USB");
            for (int i = 1; i < 11; i++)
            {
                cmbPort.Items.Add("COM" + i.ToString());
            }
            string strPort = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("IDCardPort");
            if (strPort == "0")
            {
                cmbPort.Text = "USB";
            }
            else
            {
                cmbPort.Text = "COM" + strPort;
            }

            btnSave.Content   = PubHelper.p_LangOper.GetStringBundle("Pub_Btn_Save");
            btnCancel.Content = PubHelper.p_LangOper.GetStringBundle("Pub_Btn_Cancel");

            tbDeviceTest.Text   = PubHelper.p_LangOper.GetStringBundle("Pub_DeviceTest");
            tbErrCodeTitle.Text = PubHelper.p_LangOper.GetStringBundle("Pub_ResultCode");

            btnOpen.Content      = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_IDCard_Open");
            btnClose.Content     = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_IDCard_Close");
            btnReadInfo.Content  = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_IDCard_Read");
            btnClearInfo.Content = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_IDCard_Clear");

            tbErrCode.Text = DictionaryHelper.Dictionary_Lang_IDCardErrCode();

            tbIDCardInfo.Text = string.Empty;

            #endregion

            #region 加载参数

            tbWebUrl_Value.Text = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("IDCardWebUrl");

            if (PubHelper.p_BusinOper.UserType != Business.Enum.BusinessEnum.UserType.SystemUser)
            {
                // 不是厂商管理员
                cmbPort.IsEnabled = btnSave.IsEnabled = false;
            }

            btnOpen.IsEnabled  = true;
            btnClose.IsEnabled = btnReadInfo.IsEnabled = false;

            #endregion
        }
Example #4
0
        /// <summary>
        /// 数字输入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnNumber_Click(object sender, RoutedEventArgs e)
        {
            AfreshMonOutTime();
            m_IsMonTime = true;

            if (m_Input.Length >= 11)
            {
                return;
            }
            string strInput = DictionaryHelper.Dictionary_Input(sender.ToString());

            m_Input      = m_Input + strInput;
            tbInput.Text = tbInput.Text + strInput;
        }
        /// <summary>
        /// 创建内容控件
        /// </summary>
        private void CreateProduct()
        {
            panelItem.Children.Clear();

            int index = 0;

            string strStatusText  = string.Empty;
            string strTmpModel    = string.Empty;
            string strTmpNowValue = string.Empty; // 当前温度
            string strTmpTarValue = string.Empty; // 目标温度

            string strTmpNowTitle = PubHelper.p_LangOper.GetStringBundle("Pub_Device_Tmp");
            string strTmpTarTitle = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_RefCfg_TargetTmp");

            for (int i = 0; i < m_MaxRowNum; i++)
            {
                for (int j = 0; j < m_EachRowNum; j++)
                {
                    if (index < m_CurrentItemList.Count)
                    {
                        VendBoxControl productControl = new VendBoxControl()
                        {
                            HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch,
                            VerticalAlignment   = System.Windows.VerticalAlignment.Stretch,
                            Margin = new Thickness(5)
                        };

                        Grid.SetRow(productControl, i);
                        Grid.SetColumn(productControl, j);
                        panelItem.Children.Add(productControl);

                        ////productControl.MouseLeftButtonUp += (ItemWayChecked);

                        productControl.SetCurrentItem(m_CurrentItemList[index]);

                        strTmpModel    = DictionaryHelper.Dictionary_TmpType(index);
                        strTmpNowValue = DictionaryHelper.Dictionary_NowTmp(index, true);
                        productControl.SetOneText(DictionaryHelper.Dictionary_VendBoxName(m_CurrentItemList[index].VendBoxCode) +
                                                  "【" + strTmpModel + "】" +
                                                  "\r\n" +
                                                  strTmpNowTitle + "【" + strTmpNowValue + "】" + "\r\n" +
                                                  strTmpTarTitle + "【" + m_CurrentItemList[index].TargetTmp + PubHelper.TMP_UNIT + "】");

                        ////productControl.SetSecondText(strStatusText);
                    }
                    index++;
                }
            }
        }
Example #6
0
        private void btnNumber_Click(object sender, RoutedEventArgs e)
        {
            string strInput = DictionaryHelper.Dictionary_Input(sender.ToString());

            tbMoney_Value.Text = strInput;
            try
            {
                strInput = strInput.Replace("元", "");
                if (!string.IsNullOrEmpty(strInput))
                {
                    m_TotalMoney = Convert.ToInt32(strInput) * 100;
                }
            }
            catch
            {
                m_TotalMoney = 0;
            }
        }
Example #7
0
        /// <summary>
        /// 创建货柜
        /// </summary>
        private void CreateBox()
        {
            int intBoxCount = PubHelper.p_BusinOper.AsileOper.VendBoxList_Lifter.Count;

            for (int i = 1; i <= intBoxCount; i++)
            {
                panelBox.ColumnDefinitions.Add(new ColumnDefinition()
                {
                    Width = new GridLength(1, GridUnitType.Star)
                });

                var palletButton = new RadioButton()
                {
                    Focusable = false,

                    HorizontalAlignment = System.Windows.HorizontalAlignment.Center,

                    VerticalAlignment = System.Windows.VerticalAlignment.Center,

                    Style = App.Current.Resources["VendBoxButtonStyle"] as Style,

                    Foreground = new SolidColorBrush(Colors.White),

                    Padding = new Thickness(20, 4, 20, 8),

                    FontSize = PubHelper.FONTSIZE_BOX,

                    Tag = PubHelper.p_BusinOper.AsileOper.VendBoxList_Lifter[i - 1].VendBoxCode
                };

                Grid.SetColumn(palletButton, i - 1);

                palletButton.Checked += (VendBoxButtonChecked);

                palletButton.Content = DictionaryHelper.Dictionary_VendBoxName(PubHelper.p_BusinOper.AsileOper.VendBoxList_Lifter[i - 1].VendBoxCode);

                panelBox.Children.Add(palletButton);

                if (i == 1)
                {
                    palletButton.IsChecked = true;
                }
            }
        }
Example #8
0
        private void LoadData()
        {
            int    intAsileCount  = PubHelper.p_BusinOper.AsileOper.AsileList.Count;
            string strAsileCode   = string.Empty;
            string strAsileStatus = string.Empty;
            string strAsileInfo   = string.Empty;

            for (int i = 0; i < intAsileCount; i++)
            {
                if (PubHelper.p_BusinOper.AsileOper.AsileList[i].PaStatus != "02")
                {
                    // 货道状态异常
                    strAsileCode  += PubHelper.p_BusinOper.AsileOper.AsileList[i].PaCode + "\r\n";
                    strAsileStatus = PubHelper.p_BusinOper.AsileOper.AsileList[i].PaStatus;
                    strAsileInfo  += strAsileStatus + "  " + DictionaryHelper.Dictionary_AsileStatus(strAsileStatus) + "\r\n";
                }
            }

            tbAsileCode.Text   = strAsileCode;
            tbAsileStatus.Text = strAsileInfo;
        }
        private void InitForm()
        {
            #region 加载标签

            tbTitle.Text      = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_Advert");
            btnCancel.Content = PubHelper.p_LangOper.GetStringBundle("Pub_Btn_Cancel");
            btnSave.Content   = PubHelper.p_LangOper.GetStringBundle("Pub_Btn_Save");
            btnImport.Content = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_Advert_Import");
            btnPriew.Content  = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_Advert_Priview");

            tbAdvUploadType.Text   = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_Advert_UploadType");
            tbNowAdvListID.Text    = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_Advert_NowAdvListID");
            tbUploadAdvListID.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_Advert_UploadAdvListID");

            tbAdvertSwitch.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_Advert_Switch");
            ////tbImgShowTime.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_Advert_ImgShowTime");
            tbPlayOutTime.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_Advert_PlayOutTime");

            string strRun  = PubHelper.p_LangOper.GetStringBundle("Pub_Run");
            string strStop = PubHelper.p_LangOper.GetStringBundle("Pub_Stop");
            rdbAdvertSwitch_Run.Content  = strRun;
            rdbAdvertSwitch_Stop.Content = strStop;

            tbTipInfo_ImgType.Text   = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_Advert_FormatInfo_Img");
            tbTipInfo_VideoType.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_Advert_FormatInfo_Video");

            tbVideoSound.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_Advert_Volume");

            string strMin    = PubHelper.p_LangOper.GetStringBundle("Pub_Minute"); // 分钟
            string strSecond = PubHelper.p_LangOper.GetStringBundle("Pub_Second"); // 秒
            ////for (int i = 5; i < 121; i++)
            ////{
            ////    cmbImgShowTime.Items.Add(i.ToString() + strSecond);
            ////}
            for (int i = 1; i < 31; i++)
            {
                cmbPlayOutTime.Items.Add(i.ToString() + strMin);
            }

            ControlPriew();

            #endregion

            #region 加载数据

            if (PubHelper.p_BusinOper.ConfigInfo.AdvertPlaySwitch == Business.Enum.BusinessEnum.ControlSwitch.Run)
            {
                // 开启
                rdbAdvertSwitch_Run.IsChecked = true;
                ControlSwitch(true);
            }
            else
            {
                rdbAdvertSwitch_Stop.IsChecked = true;
                ControlSwitch(false);
            }

            ////rdbAdvertSwitch_Run.IsEnabled = rdbAdvertSwitch_Stop.IsEnabled = false;

            tbNowAdvListID_Value.Text = PubHelper.p_BusinOper.ConfigInfo.NowAdvertPlayID;
            if (PubHelper.p_BusinOper.ConfigInfo.UpdateAdvertListID == PubHelper.p_BusinOper.ConfigInfo.NowAdvertPlayID)
            {
                tbUploadAdvListID_Value.Text = string.Empty;
            }
            else
            {
                tbUploadAdvListID_Value.Text = PubHelper.p_BusinOper.ConfigInfo.UpdateAdvertListID;
            }

            tbAdvUploadType_Value.Text = DictionaryHelper.Dictionary_AdvUploadType(PubHelper.p_BusinOper.ConfigInfo.AdvertUploadType);

            ////cmbImgShowTime.Text = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("AdvertImgShowTime") + strSecond;
            cmbPlayOutTime.Text = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("AdvertPlayOutTime") + strMin;

            string strAdvertVolume = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("AdvertVolume");
            sidSound.Value = Convert.ToDouble(strAdvertVolume);
            ////tbSoundNum.Text = strAdvertVolume;

            #endregion

            if (PubHelper.p_BusinOper.ConfigInfo.AdvertUploadType != "1")
            {
                // 允许本地导入
                btnImport.IsEnabled = true;
            }
            else
            {
                // 不允许本地导入
                btnImport.IsEnabled = false;
            }

            m_IsInit = false;
        }
        /// <summary>
        /// 执行条形码扫描业务(2015-08-10)
        /// </summary>
        private bool PostBarCode(out bool isFindBarCode)
        {
            bool result = false;

            isFindBarCode = false;
            string strBarCodeData = string.Empty;
            string strErrCode     = string.Empty;

            try
            {
                int intErrCode = PubHelper.p_BusinOper.BarCodeOper.QueryBarCodeNum(out strBarCodeData, out strErrCode);

                if ((intErrCode == 0) && (!string.IsNullOrEmpty(strBarCodeData)))
                {
                    if ((m_CodeLen == 0) || ((m_CodeLen > 0) && (strBarCodeData.Length == m_CodeLen)))
                    {
                        isFindBarCode = true;

                        #region 寻到条形码

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

                        m_BarCode = strBarCodeData;
                        this.tbProgressInfo.Dispatcher.Invoke(new Action(() =>
                        {
                            // 正在验证信息...
                            tbProgressInfo.Text = PubHelper.p_LangOper.GetStringBundle("TakeSell_BarCode_Pay_Checking").Replace("{N}", m_CodeNum_Name);
                        }));

                        #region 提交请求

                        string _orderInfo = string.Empty;// 条形码内容|商品编号|商品数量|业务订单编号
                        intErrCode = PubHelper.p_BusinOper.O2OServerOper.QueryOrderInfo(strBarCodeData, out _orderInfo);

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

                            string[] hexOrderData = _orderInfo.Split('|');
                            if (hexOrderData.Length > 1)
                            {
                                if (hexOrderData[0] != m_BarCode)
                                {
                                    intErrCode = 999;    // 认为扫描出来的条形码信息和返回的条形码信息不一致
                                }
                                else
                                {
                                    m_McdCode = hexOrderData[1];
                                    if (hexOrderData.Length >= 4)
                                    {
                                        m_PostKimmaCardNo = hexOrderData[3];
                                    }
                                    else
                                    {
                                        m_PostKimmaCardNo = m_BarCode;
                                    }
                                    result = true;
                                }
                            }
                            else
                            {
                                intErrCode = 99;
                            }

                            #endregion
                            break;
                        }

                        #endregion

                        if (intErrCode != 0)
                        {
                            m_ErrInfo = DictionaryHelper.Dictionary_TakeBarCode(intErrCode, m_CodeNum_Name);
                        }

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

            return(result);
        }
Example #11
0
        private void InitForm()
        {
            m_Init = true;

            #region 初始化界面

            tbTitle.Text                  = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_Print_Title");
            tbCfgTitle.Text               = PubHelper.p_LangOper.GetStringBundle("Pub_DeviceCfg");
            tbControlSwitch.Text          = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_Print_ControlSwitch");
            rdbControlSwitch_Run.Content  = PubHelper.p_LangOper.GetStringBundle("Pub_Run");
            rdbControlSwitch_Stop.Content = PubHelper.p_LangOper.GetStringBundle("Pub_Stop");
            tbPrintTitle.Text             = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_Print_Temp_Title");
            tbPrintContent.Text           = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_Print_Temp_Content");

            tbSerPort.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_Print_SerPort");
            for (int i = 1; i < 11; i++)
            {
                cmbPort.Items.Add("COM" + i.ToString());
            }
            cmbPort.Text = "COM" + PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("PrintPort");

            btnSave.Content   = btnSavePrintContent.Content = PubHelper.p_LangOper.GetStringBundle("Pub_Btn_Save");
            btnCancel.Content = PubHelper.p_LangOper.GetStringBundle("Pub_Btn_Cancel");

            tbPrintTempTitle.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_Print_Temp");
            btnUpDateTemp.Content = PubHelper.p_LangOper.GetStringBundle("Pub_Btn_Upload");

            tbDeviceTest.Text = PubHelper.p_LangOper.GetStringBundle("Pub_DeviceTest");

            btnQuery.Content = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_Print_Query");
            btnPrint.Content = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_Print_Test");
            btnCut.Content   = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_DeviceCfg_Print_Cut");

            tbErrCodeTitle.Text   = PubHelper.p_LangOper.GetStringBundle("Pub_ResultCode");
            tbErrCodeContent.Text = DictionaryHelper.Dictionary_Lang_PrinterErrCode();


            #endregion

            #region 加载参数值

            if (PubHelper.p_BusinOper.ConfigInfo.IsPrintConsumeBill == BusinessEnum.ControlSwitch.Stop)
            {
                // 打印功能关闭
                rdbControlSwitch_Stop.IsChecked = true;
                ControlForm(false);
            }
            else
            {
                // 打印功能开启
                rdbControlSwitch_Run.IsChecked = true;
                ControlForm(true);
            }

            tbPrintTemp_Value.Text = PubHelper.p_BusinOper.ConfigInfo.PrintTmepContent;
            tbPrint_Title.Text     = PubHelper.p_BusinOper.ConfigInfo.PrintTmepTitle;

            #endregion

            if (PubHelper.p_BusinOper.UserType != Business.Enum.BusinessEnum.UserType.SystemUser)
            {
                // 不是厂商管理员
                rdbControlSwitch_Run.IsEnabled  = rdbControlSwitch_Stop.IsEnabled = btnSave.IsEnabled =
                    cmbPort.IsEnabled           =
                        btnUpDateTemp.IsEnabled = btnSavePrintContent.IsEnabled = false;
                tbPrintTemp_Value.IsReadOnly    = true;
                tbPrint_Title.IsReadOnly        = true;
                btnQuery.IsEnabled = btnPrint.IsEnabled = btnCut.IsEnabled = true;
            }

            m_Init = false;
        }
Example #12
0
        private void LoadData()
        {
            AfreshMonOutTime();

            string strRunTitle    = PubHelper.p_LangOper.GetStringBundle("Pub_Run");
            string strStopTitle   = PubHelper.p_LangOper.GetStringBundle("Pub_Stop");
            string strSwitchTitle = PubHelper.p_LangOper.GetStringBundle("Pub_Payment_Control");
            string strNoPayment   = PubHelper.p_LangOper.GetStringBundle("Pub_NoExist");

            #region 现金支付
            if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.Cash))
            {
                tbCashSwitch_Text.Text = strSwitchTitle;
                tbBill_Text.Text       = PubHelper.p_LangOper.GetStringBundle("Pub_Device_Bill");
                tbCoin_Text.Text       = PubHelper.p_LangOper.GetStringBundle("Pub_Device_Coin");

                switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.Cash.ControlSwitch)
                {
                case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                    tbCashSwitch_Value.Text = strStopTitle;
                    break;

                case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                    tbCashSwitch_Value.Text = strRunTitle;
                    break;
                }
                tbBill_Value.Text = DictionaryHelper.Dictionary_CashStatus();
                tbCoin_Value.Text = DictionaryHelper.Dictionary_CoinStatus();
            }
            else
            {
                tbCashSwitch_Text.Text        = strNoPayment;
                tbCashSwitch_Value.Visibility = tbBill_Text.Visibility = tbBill_Value.Visibility =
                    tbCoin_Text.Visibility    = tbCoin_Value.Visibility = System.Windows.Visibility.Hidden;
            }
            #endregion
            #region 储值卡支付
            if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.IcCard))
            {
                tbPosSwitch_Text.Text = strSwitchTitle;

                tbPosVer_Text.Text    = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Card_Soft"); // 组件版本
                tbPosStatus_Text.Text = PubHelper.p_LangOper.GetStringBundle("Pub_Device_Ic");                  // 设备状态

                switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.IC.ControlSwitch)
                {
                case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                    tbPosSwitch_Value.Text = strStopTitle;
                    break;

                case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                    tbPosSwitch_Value.Text = strRunTitle;
                    break;
                }
                tbPosVer_Value.Text    = PubHelper.p_BusinOper.DeviceInfo.ICSoftVer; // 组件版本值
                tbPosStatus_Value.Text = DictionaryHelper.Dictionary_ICStatus();     // 设备状态值
            }
            else
            {
                tbPosSwitch_Text.Text         = strNoPayment;
                tbPosSwitch_Value.Visibility  = tbPosVer_Text.Visibility = tbPosStatus_Text.Visibility =
                    tbPosVer_Value.Visibility = tbPosStatus_Value.Visibility = System.Windows.Visibility.Hidden;
            }
            #endregion
            #region 在线会员实体卡
            if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.Online_EntityCard))
            {
                tbOnlineEntityCardSwitch_Text.Text = strSwitchTitle;

                tbOnlineEntityCardVer_Text.Text    = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_OnlineEntityCard_Soft"); // 组件版本
                tbOnlineEntityCardStatus_Text.Text = PubHelper.p_LangOper.GetStringBundle("Pub_Device_OnlineEntityCard");                // 设备状态

                switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.Online_EntityCard.ControlSwitch)
                {
                case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                    tbOnlineEntityCardSwitch_Value.Text = strStopTitle;
                    break;

                case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                    tbOnlineEntityCardSwitch_Value.Text = strRunTitle;
                    break;
                }
                tbOnlineEntityCardVer_Value.Text    = PubHelper.p_BusinOper.DeviceInfo.OnlineEntityCardSoftVer; // 组件版本值
                tbOnlineEntityCardStatus_Value.Text = DictionaryHelper.Dictionary_OnlineEntityCardStatus();     // 设备状态值
            }
            else
            {
                tbOnlineEntityCardSwitch_Text.Text         = strNoPayment;
                tbOnlineEntityCardSwitch_Value.Visibility  = tbOnlineEntityCardVer_Text.Visibility = tbOnlineEntityCardStatus_Text.Visibility =
                    tbOnlineEntityCardVer_Value.Visibility = tbOnlineEntityCardStatus_Value.Visibility = System.Windows.Visibility.Hidden;
            }
            #endregion
            #region 银联支付
            if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.QuickPass))
            {
                tbUnipnPaySwitch_Text.Text = strSwitchTitle;

                tbUnionPayVer_Text.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UnionPay_Soft");// 组件版本

                switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.UnionPay.ControlSwitch)
                {
                case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                    tbUnipnPaySwitch_Value.Text = strStopTitle;
                    break;

                case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                    tbUnipnPaySwitch_Value.Text = strRunTitle;
                    break;
                }
                tbUnionPayVer_Value.Text = PubHelper.p_BusinOper.DeviceInfo.UnionPaySoftVer;// 组件版本值
            }
            else
            {
                tbUnipnPaySwitch_Text.Text         = strNoPayment;
                tbUnipnPaySwitch_Value.Visibility  = tbUnionPayVer_Text.Visibility =
                    tbUnionPayVer_Value.Visibility = System.Windows.Visibility.Hidden;
            }
            #endregion
            #region 二维码支付
            if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.KimmaOnLineCard))
            {
                tbQRSwitch_Text.Text = strSwitchTitle;

                tbQRVer_Text.Text    = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_QrCode_Soft"); // 组件版本
                tbQRStatus_Text.Text = PubHelper.p_LangOper.GetStringBundle("Pub_Device_QRCode");                // 设备状态

                switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.KimmaOnLineCard.ControlSwitch)
                {
                case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                    tbQRSwitch_Value.Text = strStopTitle;
                    break;

                case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                    tbQRSwitch_Value.Text = strRunTitle;
                    break;
                }
                tbQRVer_Value.Text    = PubHelper.p_BusinOper.DeviceInfo.QrSoftVer; // 组件版本值
                tbQRStatus_Value.Text = DictionaryHelper.Dictionary_QRCodeStatus(); // 设备状态值
            }
            else
            {
                tbQRSwitch_Text.Text         = strNoPayment;
                tbQRSwitch_Value.Visibility  = tbQRVer_Text.Visibility = tbQRStatus_Text.Visibility =
                    tbQRVer_Value.Visibility = tbQRStatus_Value.Visibility = System.Windows.Visibility.Hidden;
            }
            #endregion
            #region 微信扫码支付
            if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.WeChatCode))
            {
                tbWeChatCodeSwitch_Text.Text = strSwitchTitle;

                ////tbWeChatCodeVer_Text.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_WeChatCode_Soft");// 组件版本

                switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.WeChatCode.ControlSwitch)
                {
                case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                    tbWeChatCodeSwitch_Value.Text = strStopTitle;
                    break;

                case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                    tbWeChatCodeSwitch_Value.Text = strRunTitle;
                    break;
                }
                ////tbWeChatCodeVer_Value.Text = PubHelper.p_BusinOper.DeviceInfo.AliPayWaveSoftVer;// 组件版本值
            }
            else
            {
                tbWeChatCodeSwitch_Text.Text        = strNoPayment;
                tbWeChatCodeSwitch_Value.Visibility = System.Windows.Visibility.Hidden;
            }
            #endregion
            #region 支付宝扫码支付
            if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.AliPay_Code))
            {
                tbAliPayCodeSwitch_Text.Text = strSwitchTitle;

                ////tbAliPayCodeVer_Text.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_AliPayCode_Soft");// 组件版本

                switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.AliPay_Code.ControlSwitch)
                {
                case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                    tbAliPayCodeSwitch_Value.Text = strStopTitle;
                    break;

                case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                    tbAliPayCodeSwitch_Value.Text = strRunTitle;
                    break;
                }
                ////tbAliPayCodeVer_Value.Text = PubHelper.p_BusinOper.DeviceInfo.AliPayCodeSoftVer;// 组件版本值
            }
            else
            {
                tbAliPayCodeSwitch_Text.Text        = strNoPayment;
                tbAliPayCodeSwitch_Value.Visibility = System.Windows.Visibility.Hidden;
            }
            #endregion
            #region 翼支付付款码支付
            if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.BestPay_Code))
            {
                tbBestPayCodeSwitch_Text.Text = strSwitchTitle;

                ////tbAliPayCodeVer_Text.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_AliPayCode_Soft");// 组件版本

                switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.BestPay_Code.ControlSwitch)
                {
                case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                    tbBestPayCodeSwitch_Value.Text = strStopTitle;
                    break;

                case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                    tbBestPayCodeSwitch_Value.Text = strRunTitle;
                    break;
                }
                ////tbAliPayCodeVer_Value.Text = PubHelper.p_BusinOper.DeviceInfo.AliPayCodeSoftVer;// 组件版本值
            }
            else
            {
                tbBestPayCodeSwitch_Text.Text        = strNoPayment;
                tbBestPayCodeSwitch_Value.Visibility = System.Windows.Visibility.Hidden;
            }
            #endregion
        }
Example #13
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);
        }
Example #14
0
        /// <summary>
        /// 执行条形码扫描业务(2015-08-10)
        /// </summary>
        private bool PostBarCode(out bool isFindBarCode)
        {
            bool result = false;

            isFindBarCode = false;
            string strBarCodeData = string.Empty;
            string strErrCode     = string.Empty;

            try
            {
                int intErrCode = PubHelper.p_BusinOper.BarCodeOper.QueryBarCodeNum(out strBarCodeData, out strErrCode);

                if ((intErrCode == 0) && (!string.IsNullOrEmpty(strBarCodeData)))
                {
                    if ((m_CodeLen == 0) || ((m_CodeLen > 0) && (strBarCodeData.Length == m_CodeLen)))
                    {
                        isFindBarCode = true;

                        #region 寻到取货码

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

                        m_TakeCodeNum = strBarCodeData;
                        this.tbProgressInfo.Dispatcher.Invoke(new Action(() =>
                        {
                            // 正在验证信息...
                            tbProgressInfo.Text = PubHelper.p_LangOper.GetStringBundle("WxTakeCode_Pay_Checking").Replace("{N}", m_CodeNum_Name);
                        }));

                        #region 提交请求

                        string _orderInfo = string.Empty;// 取货码|取货码类型|条码来源|价值金额|取货方式|取货货道号
                        intErrCode = PubHelper.p_BusinOper.WxTakeCodeOper.CheckTakeCodeInfo(strBarCodeData, out _orderInfo);

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

                            string[] hexOrderData = _orderInfo.Split('|');
                            if (hexOrderData.Length > 4)
                            {
                                result       = true;
                                m_TakeType   = hexOrderData[4];  // 取货方式 0:用户自主选货 1:指定货道出货 2:随机出货
                                m_TakePaCode = hexOrderData[5];  // 取货货道号
                                if ((m_TakeType == "1") || (m_TakeType == "3"))
                                {
                                    // 如果是指定货道出货或者指定商品出货
                                    if (string.IsNullOrEmpty(m_TakePaCode))
                                    {
                                        intErrCode = 99;
                                    }
                                }
                            }
                            else
                            {
                                intErrCode = 99;
                            }

                            #endregion
                            break;
                        }

                        #endregion

                        if (intErrCode != 0)
                        {
                            m_ErrInfo = DictionaryHelper.Dictionary_WxTakeCode(intErrCode, m_CodeNum_Name);
                        }

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

            return(result);
        }
Example #15
0
        private void LoadVendBoxTmpData()
        {
            // 获取当前货柜的索引
            m_VendBoxIndex = PubHelper.p_BusinOper.AsileOper.GetVendBoxIndex(m_VendBoxCode);

            #region 加载货柜温控相关数据

            tbTmpControlModel_Value.Text = DictionaryHelper.Dictionary_TmpType(m_VendBoxIndex);

            m_TargetTmp = PubHelper.p_BusinOper.AsileOper.VendBoxList[m_VendBoxIndex].TargetTmp;
            if (string.IsNullOrEmpty(m_TargetTmp))
            {
                m_TargetTmp = "3";
            }
            tbTargetTmp_Value.Text = m_TargetTmp + PubHelper.TMP_UNIT;

            m_WarnTmp = PubHelper.p_BusinOper.AsileOper.VendBoxList[m_VendBoxIndex].OutTmpWarnValue;
            if (string.IsNullOrEmpty(m_WarnTmp))
            {
                m_WarnTmp = "30";
            }
            tbWarnTmp_Value.Text = m_WarnTmp + PubHelper.TMP_UNIT;

            if (PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("OutTmpWarnModel") == "1")
            {
                rdbOutTmp_Run.IsChecked = true;
            }
            else
            {
                rdbOutTmp_Run.IsChecked = false;
            }

            string strTmpRunModel = PubHelper.p_BusinOper.AsileOper.VendBoxList[m_VendBoxIndex].RefControl.ControlModel;
            bool   enable         = false;
            switch (strTmpRunModel)
            {
            case "0":    // 定时开启
                enable = true;
                rdbTmpModel_Time.IsChecked = true;
                string strBeginTime1 = PubHelper.p_BusinOper.AsileOper.VendBoxList[m_VendBoxIndex].RefControl.BeginTime1;
                string strEndTime1   = PubHelper.p_BusinOper.AsileOper.VendBoxList[m_VendBoxIndex].RefControl.EndTime1;
                string strBeginTime2 = PubHelper.p_BusinOper.AsileOper.VendBoxList[m_VendBoxIndex].RefControl.BeginTime2;
                string strEndTime2   = PubHelper.p_BusinOper.AsileOper.VendBoxList[m_VendBoxIndex].RefControl.EndTime2;

                if (strBeginTime1.Length == 4)
                {
                    cmbTime1_Begin_Hour.Text = strBeginTime1.Substring(0, 2);
                    cmbTime1_Begin_Min.Text  = strBeginTime1.Substring(2);
                }
                if (strEndTime1.Length == 4)
                {
                    cmbTime1_End_Hour.Text = strEndTime1.Substring(0, 2);
                    cmbTime1_End_Min.Text  = strEndTime1.Substring(2);
                }
                if (strBeginTime2.Length == 4)
                {
                    cmbTime2_Begin_Hour.Text = strBeginTime2.Substring(0, 2);
                    cmbTime2_Begin_Min.Text  = strBeginTime2.Substring(2);
                }
                if (strEndTime2.Length == 4)
                {
                    cmbTime2_End_Hour.Text = strEndTime2.Substring(0, 2);
                    cmbTime2_End_Min.Text  = strEndTime2.Substring(2);
                }
                break;

            case "1":    // 全时段开启
                rdbTmpModel_Run.IsChecked = true;
                break;

            case "2":    // 全时段关闭
                rdbTmpModel_Stop.IsChecked = true;
                break;
            }
            ControlCmb(enable);

            bool blnIsEnableCon = true;
            if (PubHelper.p_BusinOper.AsileOper.VendBoxList[m_VendBoxIndex].TmpControlModel == BusinessEnum.TmpControlModel.Normal)
            {
                blnIsEnableCon = false;
            }
            COntrolForm(blnIsEnableCon);
            m_IsInit = false;

            #endregion
        }
        private void LoadData()
        {
            try
            {
                AfreshMonOutTime();

                string strRunTitle  = PubHelper.p_LangOper.GetStringBundle("Pub_Run");
                string strStopTitle = PubHelper.p_LangOper.GetStringBundle("Pub_Stop");

                #region 正常及故障的颜色定义

                SolidColorBrush brush_Ok = new SolidColorBrush();
                brush_Ok.Color = Colors.White;
                SolidColorBrush brush_Err = new SolidColorBrush();
                brush_Err.Color = Colors.Red;

                #endregion

                #region 门及温度数据


                // 谷霖 2016-11-09 此处需要修改完善
                string strDoorStatus = PubHelper.p_BusinOper.GetDoorStatus();// PubHelper.p_BusinOper.AsileOper.VendBoxList[0].DoorStatus;
                tbDoor_Value.Text = DictionaryHelper.Dictionary_Door(0, strDoorStatus, true);
                if ((strDoorStatus != "00") && (strDoorStatus != "01"))
                {
                    tbDoor_Value.Foreground = brush_Err;// Brushes.Red;
                }
                else
                {
                    tbDoor_Value.Foreground = brush_Ok;
                }

                tbTmpType_Value.Text = DictionaryHelper.Dictionary_TmpType(0);
                tbNowTmp_Value.Text  = DictionaryHelper.Dictionary_NowTmp(0, true);
                if (PubHelper.p_BusinOper.AsileOper.VendBoxList[0].TmpStatus == "00")
                {
                    tbNowTmp_Value.Foreground = brush_Ok;
                }
                else
                {
                    tbNowTmp_Value.Foreground = brush_Err;
                }

                tbTarTmp_Value.Text = PubHelper.p_BusinOper.AsileOper.VendBoxList[0].TargetTmp + PubHelper.TMP_UNIT;//
                if (PubHelper.p_BusinOper.AsileOper.VendBoxList.Count > 1)
                {
                    btnTmp_More.Visibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    btnTmp_More.Visibility = System.Windows.Visibility.Hidden;
                }
                //PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("TargetTmp1") + PubHelper.TMP_UNIT;

                #endregion

                #region 网络

                PubHelper.p_BusinOper.GetNetStatus();
                tbNetKind_Value.Text = DictionaryHelper.Dictionary_NetStatus();
                if (PubHelper.p_BusinOper.DeviceInfo.NetStatus == Business.Enum.BusinessEnum.NetStatus.OnLine)
                {
                    // 联机
                    tbNetKind_Value.Foreground = brush_Ok;
                }
                else
                {
                    // 离线
                    tbNetKind_Value.Foreground = brush_Err;
                }
                tbNetNum_Value.Text = PubHelper.p_BusinOper.GetWaitNetDataNum().ToString();
                switch (PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("NetSwitch"))
                {
                case "0":    // 关闭
                    tbNetSwitch_Value.Text = strStopTitle;
                    break;

                case "1":    // 开启
                    tbNetSwitch_Value.Text = strRunTitle;
                    break;
                }
                string strNetType = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("NetType");// 网络通信类型
                switch (strNetType)
                {
                case "0":    // DTU方式
                    tbNetType_Value.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Net_NetType_DTU");
                    break;

                default:
                    tbNetType_Value.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Net_NetType_Other");
                    break;
                }
                tbNetSoftName_Value.Text = PubHelper.p_BusinOper.DeviceInfo.NetSoftVer;

                #endregion

                #region 其它设备状态

                tbRef_Value.Text        = DictionaryHelper.Dictionary_DeviceStatus(PubHelper.p_BusinOper.AsileOper.VendBoxList[0].RefControl.ControlStatus.ToString());
                tbLight_Value.Text      = DictionaryHelper.Dictionary_DeviceStatus(PubHelper.p_BusinOper.AsileOper.VendBoxList[0].LightControl.ControlStatus.ToString());
                tbAdvertLamp_Value.Text = DictionaryHelper.Dictionary_DeviceStatus(PubHelper.p_BusinOper.AsileOper.VendBoxList[0].AdvertLightControl.ControlStatus.ToString());

                #endregion

                #region 货道状态

                int    intAsileCount  = PubHelper.p_BusinOper.AsileOper.AsileList.Count;
                int    intErrAsile    = 0;
                string strAsileCode   = string.Empty;
                string strAsileStatus = string.Empty;
                string strAsileInfo   = string.Empty;
                for (int i = 0; i < intAsileCount; i++)
                {
                    if (PubHelper.p_BusinOper.AsileOper.AsileList[i].PaStatus != "02")
                    {
                        // 货道状态异常
                        intErrAsile++;
                        strAsileCode   = PubHelper.p_BusinOper.AsileOper.AsileList[i].PaCode;
                        strAsileStatus = PubHelper.p_BusinOper.AsileOper.AsileList[i].PaStatus;
                        strAsileInfo   = DictionaryHelper.Dictionary_AsileStatus(strAsileStatus);
                        if (intErrAsile == 1)
                        {
                            tbAsileCode_Text_1.Visibility = tbAsileCode_Value_1.Visibility = System.Windows.Visibility.Visible;
                            tbAsileCode_Text_1.Text       = strAsileCode;
                            tbAsileCode_Value_1.Text      = strAsileStatus + "  " + strAsileInfo;
                            tbAsileCode_Text_1.Foreground = tbAsileCode_Value_1.Foreground = brush_Err;
                        }
                        if (intErrAsile == 2)
                        {
                            tbAsileCode_Text_2.Visibility = tbAsileCode_Value_2.Visibility = System.Windows.Visibility.Visible;
                            tbAsileCode_Text_2.Text       = strAsileCode;
                            tbAsileCode_Value_2.Text      = strAsileStatus + "  " + strAsileInfo;
                            tbAsileCode_Text_2.Foreground = tbAsileCode_Value_2.Foreground = brush_Err;
                        }
                        if (intErrAsile == 3)
                        {
                            tbAsileCode_Text_3.Visibility = tbAsileCode_Value_3.Visibility = System.Windows.Visibility.Visible;
                            tbAsileCode_Text_3.Text       = strAsileCode;
                            tbAsileCode_Value_3.Text      = strAsileStatus + "  " + strAsileInfo;
                            tbAsileCode_Text_3.Foreground = tbAsileCode_Value_3.Foreground = brush_Err;
                        }
                        if (intErrAsile == 3)
                        {
                            // 超过4个,显示更多
                            btnAsile_More.Visibility = System.Windows.Visibility.Visible;
                            break;
                        }
                    }
                }
                if (intErrAsile == 0)
                {
                    // 货道正常
                    tbAsileCode_Text_1.Visibility = System.Windows.Visibility.Visible;
                    tbAsileCode_Text_1.Text       = PubHelper.p_LangOper.GetStringBundle("Pub_Normal");
                    tbAsileCode_Text_1.Foreground = brush_Ok;
                }

                #endregion

                #region 支付方式

                tbCashControl_Text.Text      = tbCash_Text.Text = tbCoin_Text.Text =
                    tbCashControl_Value.Text = tbCash_Value.Text = tbCoin_Value.Text = string.Empty;

                // 获取当前支付方式数量
                int intEnablePayNum = PubHelper.p_BusinOper.PaymentOper.GetOpenPayNum();
                switch (intEnablePayNum)
                {
                case 0:    // 没有支付方式
                    btnPayment_More.Visibility         = System.Windows.Visibility.Hidden;
                    tbCashControl_Text.Visibility      = tbCash_Text.Visibility = tbCoin_Text.Visibility =
                        tbCashControl_Value.Visibility = tbCash_Value.Visibility = tbCoin_Value.Visibility =
                            System.Windows.Visibility.Hidden;
                    break;

                case 1:                                                            // 只有一种支付方式
                    btnPayment_More.Visibility = System.Windows.Visibility.Hidden; // 隐藏更多按钮
                    break;

                default:                                                            // 多种支付方式
                    btnPayment_More.Visibility = System.Windows.Visibility.Visible; // 显示更多按钮
                    break;
                }
                if (intEnablePayNum == 0)
                {
                    return;
                }

                #region 现金支付
                if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.Cash))
                {
                    // 如果现金支付方式开启,则界面上默认显示现金支付方式的相关信息
                    tbCashControl_Text.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Cash_Title");
                    tbCash_Text.Text        = PubHelper.p_LangOper.GetStringBundle("Pub_Device_Bill");
                    tbCoin_Text.Text        = PubHelper.p_LangOper.GetStringBundle("Pub_Device_Coin");

                    switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.Cash.ControlSwitch)
                    {
                    case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                        tbCashControl_Value.Text = strStopTitle;
                        break;

                    case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                        tbCashControl_Value.Text = strRunTitle;
                        break;
                    }
                    tbCash_Value.Text = DictionaryHelper.Dictionary_CashStatus();
                    tbCoin_Value.Text = DictionaryHelper.Dictionary_CoinStatus();

                    return;
                }
                #endregion
                #region 储值卡支付
                if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.IcCard))
                {
                    // 如果储值卡支付方式开启,则界面上默认显示储值卡支付方式的相关信息
                    tbCashControl_Text.Text = PubHelper.ConvertIcCardPayName();                                       // PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Card_Title");
                    tbCash_Text.Text        = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Card_Soft"); // 组件版本
                    tbCoin_Text.Text        = PubHelper.p_LangOper.GetStringBundle("Pub_Device_Ic");                  // 设备状态

                    switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.IC.ControlSwitch)
                    {
                    case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                        tbCashControl_Value.Text = strStopTitle;
                        break;

                    case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                        tbCashControl_Value.Text = strRunTitle;
                        break;
                    }
                    tbCash_Value.Text = PubHelper.p_BusinOper.DeviceInfo.ICSoftVer; // 组件版本值
                    tbCoin_Value.Text = DictionaryHelper.Dictionary_ICStatus();     // 设备状态值

                    return;
                }
                #endregion
                #region 在线会员实体卡
                if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.Online_EntityCard))
                {
                    // 如果支付方式开启,则界面上默认显示支付方式的相关信息
                    tbCashControl_Text.Text = PubHelper.p_LangOper.GetStringBundle("Pub_Payment_OnlineCard");
                    tbCash_Text.Text        = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_NoFeeCard_Soft"); // 组件版本
                    tbCoin_Text.Text        = PubHelper.p_LangOper.GetStringBundle("Pub_Device_NoFeeCard");                // 设备状态

                    switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.Online_EntityCard.ControlSwitch)
                    {
                    case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                        tbCashControl_Value.Text = strStopTitle;
                        break;

                    case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                        tbCashControl_Value.Text = strRunTitle;
                        break;
                    }
                    tbCash_Value.Text = PubHelper.p_BusinOper.DeviceInfo.OnlineEntityCardSoftVer; // 组件版本值
                    tbCoin_Value.Text = DictionaryHelper.Dictionary_OnlineEntityCardStatus();     // 设备状态值

                    return;
                }
                #endregion
                #region 银联支付
                if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.QuickPass))
                {
                    // 如果支付方式开启,则界面上默认显示支付方式的相关信息
                    tbCashControl_Text.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UnionPay_Title");
                    tbCash_Text.Text        = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UnionPay_Soft"); // 组件版本
                    tbCoin_Text.Text        = PubHelper.p_LangOper.GetStringBundle("Pub_Device_UnionPay");                // 设备状态

                    switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.UnionPay.ControlSwitch)
                    {
                    case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                        tbCashControl_Value.Text = strStopTitle;
                        break;

                    case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                        tbCashControl_Value.Text = strRunTitle;
                        break;
                    }
                    tbCash_Value.Text = PubHelper.p_BusinOper.DeviceInfo.UnionPaySoftVer; // 组件版本值
                    tbCoin_Value.Text = DictionaryHelper.Dictionary_UnionPayStatus();     // 设备状态值

                    return;
                }
                #endregion
                #region 二维码支付
                if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.KimmaOnLineCard))
                {
                    // 如果支付方式开启,则界面上默认显示支付方式的相关信息
                    tbCashControl_Text.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_QrCode_Title");
                    tbCash_Text.Text        = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_QrCode_Soft"); // 组件版本
                    tbCoin_Text.Text        = PubHelper.p_LangOper.GetStringBundle("Pub_Device_QRCode");                // 设备状态

                    switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.KimmaOnLineCard.ControlSwitch)
                    {
                    case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                        tbCashControl_Value.Text = strStopTitle;
                        break;

                    case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                        tbCashControl_Value.Text = strRunTitle;
                        break;
                    }
                    tbCash_Value.Text = PubHelper.p_BusinOper.DeviceInfo.QrSoftVer; // 组件版本值
                    tbCoin_Value.Text = DictionaryHelper.Dictionary_QRCodeStatus(); // 设备状态值

                    return;
                }
                #endregion
                #region 微信扫码支付
                if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.WeChatCode))
                {
                    // 如果支付方式开启,则界面上默认显示支付方式的相关信息
                    tbCashControl_Text.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_WeChatCode_Title");
                    tbCash_Text.Text        = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_WeChatCode_Soft"); // 组件版本
                    tbCoin_Text.Text        = PubHelper.p_LangOper.GetStringBundle("Pub_Device_QRCode");                    // 设备状态

                    switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.WeChatCode.ControlSwitch)
                    {
                    case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                        tbCashControl_Value.Text = strStopTitle;
                        break;

                    case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                        tbCashControl_Value.Text = strRunTitle;
                        break;
                    }
                    tbCash_Value.Text      = PubHelper.p_BusinOper.DeviceInfo.AliPayWaveSoftVer;// 组件版本值
                    tbCoin_Text.Visibility = tbCoin_Value.Visibility = System.Windows.Visibility.Hidden;
                    ////tbCoin_Value.Text = DictionaryHelper.Dictionary_AliPayWaveStatus();// 设备状态值

                    return;
                }
                #endregion

                #region 支付宝扫码支付
                if (PubHelper.p_BusinOper.PaymentOper.CheckPaymentIsExist(Business.Enum.BusinessEnum.PayMent.AliPay_Code))
                {
                    // 如果支付方式开启,则界面上默认显示支付方式的相关信息
                    tbCashControl_Text.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_AliPayCode_Title");
                    tbCash_Text.Text        = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_AliPayCode_Soft"); // 组件版本
                    tbCoin_Text.Text        = PubHelper.p_LangOper.GetStringBundle("Pub_Device_QRCode");                    // 设备状态

                    switch (PubHelper.p_BusinOper.PaymentOper.PaymentList.AliPay_Code.ControlSwitch)
                    {
                    case Business.Enum.BusinessEnum.ControlSwitch.Stop:    // 关闭
                        tbCashControl_Value.Text = strStopTitle;
                        break;

                    case Business.Enum.BusinessEnum.ControlSwitch.Run:    // 开启
                        tbCashControl_Value.Text = strRunTitle;
                        break;
                    }
                    tbCash_Value.Text = PubHelper.p_BusinOper.DeviceInfo.AliPayWaveSoftVer;// 组件版本值
                    ////tbCoin_Value.Text = DictionaryHelper.Dictionary_AliPayWaveStatus();// 设备状态值
                    tbCoin_Text.Visibility = tbCoin_Value.Visibility = System.Windows.Visibility.Hidden;

                    return;
                }
                #endregion

                #endregion
            }
            catch (Exception ex)
            {
                PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Err_OtherErr").Replace("{N}", ex.Message), PubHelper.MsgType.Ok);
            }
        }
        /// <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_PostKimmaCardNo, "2");

                #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_BarCode, strSellStatus, strNoSellReason);

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

                result = blnIsSell;

                #endregion
            }
            catch
            {
                result = false;
            }
            return(result);
        }
        /// <summary>
        /// 创建货柜
        /// </summary>
        private void CreateBox()
        {
            var map = new Dictionary <int, string>();

            for (int i = 1; i < 10; i++)
            {
                map.Add(i, DictionaryHelper.Dictionary_VendBoxName(i.ToString()));
            }

            int  intBoxCount = PubHelper.p_BusinOper.AsileOper.VendBoxList.Count;
            bool blnIsOneBox = PubHelper.p_BusinOper.AsileOper.QueryIsOneBox();

            if (intBoxCount > 1)
            {
                if (!blnIsOneBox)
                {
                    intBoxCount++;
                }
                #region  多个柜子
                for (int i = 1; i <= intBoxCount; i++)
                {
                    panelBox.ColumnDefinitions.Add(new ColumnDefinition()
                    {
                        Width = new GridLength(1, GridUnitType.Star)
                    });

                    var palletButton = new RadioButton()
                    {
                        Focusable = false,

                        HorizontalAlignment = System.Windows.HorizontalAlignment.Center,

                        VerticalAlignment = System.Windows.VerticalAlignment.Center,

                        Style = App.Current.Resources["VendBoxButtonStyle"] as Style,

                        Foreground = new SolidColorBrush(Colors.White),

                        Padding = new Thickness(20, 4, 20, 8),

                        FontSize = PubHelper.FONTSIZE_BOX,

                        Tag = i
                    };

                    Grid.SetColumn(palletButton, i - 1);

                    palletButton.Checked += (VendBoxButtonChecked);

                    palletButton.Content = map[i];

                    panelBox.Children.Add(palletButton);

                    if (i == 1)
                    {
                        palletButton.IsChecked = true;
                    }
                }
                #endregion
            }
            else
            {
                // 只有一个柜子
                CreateTray();
            }
        }
        private void InitForm()
        {
            #region 初始化界面资源

            tbTitle.Text      = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UpDown_Title");
            btnSave.Content   = PubHelper.p_LangOper.GetStringBundle("Pub_Btn_Save");
            btnCancel.Content = PubHelper.p_LangOper.GetStringBundle("Pub_Btn_Cancel");

            tbSellGoodsType.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UpDown_Cfg_SellType");
            tbVendBoxCode.Text   = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UpDown_Cfg_VendBox");
            tbShippPort.Text     = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UpDown_Cfg_ShippPort");

            tbUpDownSellModel.Text            = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UpDown_Cfg_SellModel");// 出货指令
            rdbUpDownSellModel_ZhiJie.Content = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UpDown_Cfg_SellModel_ZJ");
            rdbUpDownSellModel_Pra.Content    = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UpDown_Cfg_SellModel_Pra");

            tbUpDownIsQueryElectStatus.Text         = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UpDown_Cfg_GuangDian");
            rdbUpDownIsQueryElectStatus_Yes.Content = PubHelper.p_LangOper.GetStringBundle("Pub_Device_Run");
            rdbUpDownIsQueryElectStatus_No.Content  = PubHelper.p_LangOper.GetStringBundle("Pub_Device_Close");

            tbLeftSpace_Title.Text   = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UpDown_Cfg_LeftSpace");
            tbMiddleSpace_Title.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UpDown_Cfg_MiddleSpace");
            tbRightSpace_Title.Text  = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_UpDown_Cfg_RightSpace");

            for (int i = 1; i < 11; i++)
            {
                cmbShippPort.Items.Add("COM" + i.ToString());
            }

            #endregion

            #region 加载数据

            int intVendBoxIndex = PubHelper.p_BusinOper.AsileOper.GetVendBoxIndex(PubHelper.p_VendBoxCode);

            // 柜号
            tbVendCode_Value.Text = DictionaryHelper.Dictionary_VendBoxName(PubHelper.p_VendBoxCode);

            // 出货方式
            tbSellGoodsType_Value.Text = DictionaryHelper.Dictionary_SellGoodsType(PubHelper.p_VendBoxCode);

            // 驱动板串口
            cmbShippPort.Text = "COM" + PubHelper.p_BusinOper.AsileOper.VendBoxList[intVendBoxIndex].ShippPort;

            // 出货指令
            if (PubHelper.p_BusinOper.AsileOper.VendBoxList[intVendBoxIndex].UpDownSellModel == "0")
            {
                // 直接升降
                rdbUpDownSellModel_ZhiJie.IsChecked = true;
            }
            else
            {
                rdbUpDownSellModel_Pra.IsChecked = true;
            }

            // 光电检测
            if (PubHelper.p_BusinOper.AsileOper.VendBoxList[intVendBoxIndex].UpDownIsQueryElectStatus == Business.Enum.BusinessEnum.ControlSwitch.Run)
            {
                // 开启光电检测
                rdbUpDownIsQueryElectStatus_Yes.IsChecked = true;
            }
            else
            {
                rdbUpDownIsQueryElectStatus_No.IsChecked = true;
            }

            tbLeftSpace_Value.Text   = PubHelper.p_BusinOper.ConfigInfo.UpDownLeftRightNum_Left.ToString();
            tbMiddleSpace_Value.Text = PubHelper.p_BusinOper.ConfigInfo.UpDownLeftRightNum_Center.ToString();
            tbRightSpace_Value.Text  = PubHelper.p_BusinOper.ConfigInfo.UpDownLeftRightNum_Right.ToString();

            #endregion
        }