private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            ControlButton(false);
            DispatcherHelper.DoEvents();

            string strPlaySwitch = "0";

            if (rdbAdvertSwitch_Run.IsChecked == true)
            {
                strPlaySwitch = "1";
            }

            string strMin    = PubHelper.p_LangOper.GetStringBundle("Pub_Minute"); // 分钟
            string strSecond = PubHelper.p_LangOper.GetStringBundle("Pub_Second"); // 秒

            PubHelper.p_BusinOper.UpdateSysCfgValue("AdvertPlaySwitch", strPlaySwitch);
            ////PubHelper.p_BusinOper.UpdateSysCfgValue("AdvertImgShowTime", cmbImgShowTime.Text.Replace(strSecond, ""));
            PubHelper.p_BusinOper.UpdateSysCfgValue("AdvertPlayOutTime", cmbPlayOutTime.Text.Replace(strMin, ""));
            PubHelper.p_BusinOper.UpdateSysCfgValue("AdvertVolume", tbSoundNum.Text);

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);

            if (strPlaySwitch == "1")
            {
                ControlButton(true);
            }
            else
            {
                rdbAdvertSwitch_Run.IsEnabled = rdbAdvertSwitch_Stop.IsEnabled = true;
                btnSave.IsEnabled             = btnCancel.IsEnabled = true;
                ControlSwitch(false);
            }
        }
Example #2
0
        /// <summary>
        /// 超时监控主业务流程
        /// </summary>
        private void MonOutTimeTrd()
        {
            // 获取超时时间
            m_MonOutTime = 4 * Convert.ToInt32(PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("InputPwdOutTime"));

            while (!m_CloseForm)
            {
                Thread.Sleep(20);

                if (!m_IsMonTime)
                {
                    // 重新开始超时监控
                    AfreshMonOutTime();
                }
                else
                {
                    m_OutNum++;
                    if (m_OutNum >= 50)
                    {
                        m_OutNum = 0;
                        m_OperNum++;

                        try
                        {
                            this.tbOutTime.Dispatcher.Invoke(new Action(() =>
                            {
                                if (!m_CloseForm)
                                {
                                    if (m_OperNum > m_MonOutTime)
                                    {
                                        // 超时,自动返回
                                        // 重新开始超时监控
                                        AfreshMonOutTime();
                                        m_IsMonTime = true;
                                        //OperStepKind();

                                        this.Close();
                                        //Application.DoEvents();
                                    }
                                    else
                                    {
                                        if (tbOutTime.Visibility == System.Windows.Visibility.Hidden)
                                        {
                                            tbOutTime.Visibility = System.Windows.Visibility.Visible;
                                        }
                                        // 显示剩余时间提示
                                        tbOutTime.Text = (m_MonOutTime - m_OperNum + 1).ToString();

                                        DispatcherHelper.DoEvents();
                                    }
                                }
                            }));
                        }
                        catch
                        {
                        }
                    }
                }
            }
        }
Example #3
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            btnSave.IsEnabled = btnCancel.IsEnabled = false;
            DispatcherHelper.DoEvents();

            string strKmbPort        = cmbKmbPort.Text.Replace("COM", "");
            string strSellFailTryNum = cmbSellFailTryNum.Text;

            string strColumnType = "0";

            if (rdbColumnType_Num.IsChecked == true)
            {
                strColumnType = "1";
            }

            string strIsShowPoint = "0";

            if (rdbIsShowPoint_Yes.IsChecked == true)
            {
                strIsShowPoint = "1";
            }

            PubHelper.p_BusinOper.UpdateSysCfgValue("KmbPort", strKmbPort);
            PubHelper.p_BusinOper.UpdateSysCfgValue("SellFailTryNum", strSellFailTryNum);
            PubHelper.p_BusinOper.UpdateSysCfgValue("ColumnType", strColumnType);
            PubHelper.p_BusinOper.UpdateSysCfgValue("IsShowPoint", strIsShowPoint);

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc_Restart"), PubHelper.MsgType.Ok);
            this.Close();
        }
Example #4
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            btnSave.IsEnabled = btnCancel.IsEnabled = false;
            DispatcherHelper.DoEvents();

            string strSwitch = "0";

            if (rdbSwitch_Run.IsChecked == true)
            {
                strSwitch = "1";
            }

            string strCoinDeviceType = "0";

            if (cmbCoinDeviceType.Text == m_CoinDevice_Hook)
            {
                strCoinDeviceType = "1";
            }

            string strIsReturnBill = "0";

            if (cmbIsReturnBill.Text == m_Run_Title)
            {
                strIsReturnBill = "1";
            }

            // 保存参数
            PubHelper.p_BusinOper.UpdateSysCfgValue("CashControlSwitch", strSwitch);
            PubHelper.p_BusinOper.UpdateSysCfgValue("CoinDeviceType", strCoinDeviceType);
            PubHelper.p_BusinOper.UpdateSysCfgValue("IsReturnBill", strIsReturnBill);

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc_Restart"), PubHelper.MsgType.Ok);
            this.Close();
        }
Example #5
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            btnSave.IsEnabled = btnCancel.IsEnabled = false;
            DispatcherHelper.DoEvents();

            string strSwitch = "0";

            if (rdbSwitch_Run.IsChecked == true)
            {
                strSwitch = "1";
            }

            string strSwitch_Pwd = "0";

            if (rdbSwitch_Pwd_Run.IsChecked == true)
            {
                strSwitch_Pwd = "1";
            }

            string strPort = cmbPort.Text.Replace("COM", "");

            // 保存参数
            PubHelper.p_BusinOper.UpdateSysCfgValue("OnlineEntityCardSwitch", strSwitch);
            if (strSwitch == "1")
            {
                PubHelper.p_BusinOper.UpdateSysCfgValue("OnlineEntityCardDevicePort", strPort);
                PubHelper.p_BusinOper.UpdateSysCfgValue("OnlineEntityCardIsPwd", strSwitch_Pwd);
            }

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);
            this.Close();
        }
Example #6
0
        /// <summary>
        /// 按钮—保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            ControlButton(false);
            DispatcherHelper.DoEvents();

            #region 保存制冷模式

            string strTmpRunModel = string.Empty;
            if (rdbTmpModel_Time.IsChecked == true)
            {
                strTmpRunModel = "0";
            }
            if (rdbTmpModel_Run.IsChecked == true)
            {
                strTmpRunModel = "1";
            }
            if (rdbTmpModel_Stop.IsChecked == true)
            {
                strTmpRunModel = "2";
            }

            string strBeginTime1 = cmbTime1_Begin_Hour.Text + cmbTime1_Begin_Min.Text;
            string strEndTime1   = cmbTime1_End_Hour.Text + cmbTime1_End_Min.Text;
            string strBeginTime2 = cmbTime2_Begin_Hour.Text + cmbTime2_Begin_Min.Text;
            string strEndTime2   = cmbTime2_End_Hour.Text + cmbTime2_End_Min.Text;

            if (strTmpRunModel == "0")
            {
                // 检测时间段是否有效
                bool   result     = false;
                string strErrInfo = string.Empty;

                result = PubHelper.CheckModelTime(strBeginTime1, strEndTime1, strBeginTime2, strEndTime2, out strErrInfo);
                if (!result)
                {
                    PubHelper.ShowMsgInfo(strErrInfo, PubHelper.MsgType.Ok);
                    ControlButton(true);
                    return;
                }
            }

            #endregion

            PubHelper.p_BusinOper.AsileOper.UpdateVendBoxTmpCfg(m_VendBoxCode, m_TargetTmp, m_WarnTmp, strTmpRunModel,
                                                                strBeginTime1, strEndTime1, strBeginTime2, strEndTime2);

            string strOutTmpModel = "0";
            if (rdbOutTmp_Run.IsChecked == true)
            {
                strOutTmpModel = "1";
            }
            PubHelper.p_BusinOper.UpdateSysCfgValue("OutTmpWarnModel", strOutTmpModel);

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);
            ControlButton(true);
        }
Example #7
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            btnSave.IsEnabled = btnCancel.IsEnabled = false;
            DispatcherHelper.DoEvents();

            string strControlSwitch = "0";

            if (rdbControlSwitch_Run.IsChecked == true)
            {
                strControlSwitch = "1";
            }

            string strIcQuerySwitch = "0";

            if (rdbIcQuerySwitch_Run.IsChecked == true)
            {
                strIcQuerySwitch = "1";
            }

            string strPayShow = "0";

            if (rdbPayShow_Run.IsChecked == true)
            {
                strPayShow = "1";
            }

            string strHideCardNum = "0";

            if (rdbHideCardNum_Run.IsChecked == true)
            {
                strHideCardNum = "1";
            }

            string strIcPort           = cmbIcPort.Text.Replace("COM", "");
            string strShowCardInfoTime = cmbShowCardInfoTime.Text.Replace(PubHelper.p_LangOper.GetStringBundle("Pub_Second"), "");

            ////string strIcBusiModel_Text = cmbIcBusiModel.Text;
            ////string strIcBusiModel_Value = "1";
            ////if (strIcBusiModel_Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Card_IcBusiModel_QueryPay"))
            ////{
            ////    strIcBusiModel_Value = "0";
            ////}

            // 保存参数
            PubHelper.p_BusinOper.UpdateSysCfgValue("IcControlSwitch", strControlSwitch);
            PubHelper.p_BusinOper.UpdateSysCfgValue("IcQuerySwitch", strIcQuerySwitch);
            PubHelper.p_BusinOper.UpdateSysCfgValue("ShowCardInfoTime", strShowCardInfoTime);
            PubHelper.p_BusinOper.UpdateSysCfgValue("IcPort", strIcPort);
            PubHelper.p_BusinOper.UpdateSysCfgValue("IcPayShowSwitch", strPayShow);
            ////PubHelper.p_BusinOper.UpdateSysCfgValue("IcBusiModel", strIcBusiModel_Value);
            PubHelper.p_BusinOper.UpdateSysCfgValue("IcCardNumHide", strHideCardNum);

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);
            this.Close();
        }
Example #8
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            string strVmId = tbVmId_Value.Text;

            string strLgsId = tbLgsId_Value.Text;

            string strSoftType = "0";

            if (rdbIsTestVer_Demo.IsChecked == true)
            {
                strSoftType = "1";
            }

            // 检测数据有效性
            if (!(PubHelper.p_BusinOper.CheckDataOper.CheckIsPosInt(strVmId)) ||
                (strVmId.Length != 10))
            {
                // 机器出厂号无效
                PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Err_Input_InvalidVmId"), PubHelper.MsgType.Ok);
                return;
            }

            bool blnLgsIdIsNormal = true;

            if (strLgsId.Length != 3)
            {
                blnLgsIdIsNormal = false;
            }
            else
            {
                if ((strLgsId != "000") && (!(PubHelper.p_BusinOper.CheckDataOper.CheckIsPosInt(strLgsId))))
                {
                    blnLgsIdIsNormal = false;
                }
            }

            if (!blnLgsIdIsNormal)
            {
                // 客户编码无效
                PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Err_Input_InvalidLgsId"), PubHelper.MsgType.Ok);
                return;
            }

            btnSave.IsEnabled = btnCancel.IsEnabled = false;
            DispatcherHelper.DoEvents();

            // 保存数据
            PubHelper.p_BusinOper.UpdateSysCfgValue("VmId", strVmId);
            PubHelper.p_BusinOper.UpdateSysCfgValue("LgsId", strLgsId);
            PubHelper.p_BusinOper.UpdateSysCfgValue("IsTestVer", strSoftType);

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc_Restart"), PubHelper.MsgType.Ok);
            this.Close();
        }
        private void btnImport_Click(object sender, RoutedEventArgs e)
        {
            ControlButton(false);
            DispatcherHelper.DoEvents();

            FrmAdvertImport frmAdvertImport = new AutoSellGoodsMachine.FrmAdvertImport();

            frmAdvertImport.ShowDialog();

            ControlButton(true);
            DispatcherHelper.DoEvents();
        }
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ControlButton(false);
            DispatcherHelper.DoEvents();

            FrmPlayAdvert26 frmPlayAdvert26 = new FrmPlayAdvert26();

            frmPlayAdvert26.ShowDialog();

            ControlButton(true);
            DispatcherHelper.DoEvents();
        }
Example #11
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            btnSave.IsEnabled = btnCancel.IsEnabled = false;
            DispatcherHelper.DoEvents();

            string strSwitch = "0";

            if (rdbSwitch_Run.IsChecked == true)
            {
                strSwitch = "1";
            }

            string strPayShow = "0";

            if (rdbPayShow_Run.IsChecked == true)
            {
                strPayShow = "1";
            }

            string strHideCardNum = "0";

            if (rdbHideCardNum_Run.IsChecked == true)
            {
                strHideCardNum = "1";
            }

            string strIsRebate = "0";

            if (rdbIsRebate_Run.IsChecked == true)
            {
                strIsRebate = "1";
            }

            string strPort = cmbPort.Text.Replace("COM", "");

            // 保存参数
            PubHelper.p_BusinOper.UpdateSysCfgValue("NoFeeCardSwitch", strSwitch);
            PubHelper.p_BusinOper.UpdateSysCfgValue("NoFeeCardPort", strPort);
            PubHelper.p_BusinOper.UpdateSysCfgValue("NoFeeCardPayShow", strPayShow);
            PubHelper.p_BusinOper.UpdateSysCfgValue("NoFeeCardNumHide", strHideCardNum);
            PubHelper.p_BusinOper.UpdateSysCfgValue("NoFeeCardIsRebate", strIsRebate);

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);
            this.Close();
        }
Example #12
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            btnSave.IsEnabled = btnCancel.IsEnabled = false;
            DispatcherHelper.DoEvents();

            string strSwitch = "0";

            if (rdbSwitch_Run.IsChecked == true)
            {
                strSwitch = "1";
            }

            // 保存参数
            PubHelper.p_BusinOper.UpdateSysCfgValue("BestPayCodeSwitch", strSwitch);

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);
            this.Close();
        }
        /// <summary>
        /// 按钮—保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            string strSaleModel   = "0";
            string strChangeModel = "0";
            string strDropModel   = "0";
            string strFreeSale    = "0";

            ControlButton(false);
            DispatcherHelper.DoEvents();

            if (rdbSaleModel_Run.IsChecked == false)
            {
                strSaleModel = "1";
            }
            if (rdbChangeModel_Run.IsChecked == true)
            {
                strChangeModel = "1";
            }
            if (rdbDropModel_Run.IsChecked == true)
            {
                strDropModel = "1";
            }
            if (rdbFreeSale_Run.IsChecked == true)
            {
                strFreeSale = "1";
            }

            // 保存数据
            if (PubHelper.p_BusinOper.PaymentOper.PaymentList.Cash.ControlSwitch == Business.Enum.BusinessEnum.ControlSwitch.Run)
            {
                PubHelper.p_BusinOper.UpdateSysCfgValue("SaleModel", strSaleModel);
                PubHelper.p_BusinOper.UpdateSysCfgValue("ChangeModel", strChangeModel);
            }
            ////if (PubHelper.p_BusinOper.DeviceInfo.SellGoodsType == Business.Enum.BusinessEnum.SellGoodsType.Spring)
            ////{
            ////    PubHelper.p_BusinOper.UpdateSysCfgValue("DropModel", strDropModel);
            ////}
            PubHelper.p_BusinOper.UpdateSysCfgValue("DropModel", strDropModel);

            PubHelper.p_BusinOper.UpdateSysCfgValue("FreeSale", strFreeSale);

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);
            this.Close();
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            btnSave.IsEnabled = btnCancel.IsEnabled = false;
            DispatcherHelper.DoEvents();

            ConvertStrToCode(cmbBusiLog.Text, "IsWriteLog_Busi");
            ConvertStrToCode(cmbGateWayLog.Text, "IsWriteLog_GateWay");
            ConvertStrToCode(cmbKmbLog.Text, "IsWriteLog_Kmb");
            ConvertStrToCode(cmbPosLog.Text, "IsWriteLog_Card");
            ConvertStrToCode(cmbNoFeeIdLog.Text, "IsWriteLog_ID");

            string strDay     = PubHelper.p_LangOper.GetStringBundle("Pub_Day");
            string strKeepDay = cmbKeepDays.Text.Replace(strDay, "");

            PubHelper.p_BusinOper.UpdateSysCfgValue("ClearLogIntervalDay", strKeepDay);

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc_Restart"), PubHelper.MsgType.Ok);
            this.Close();
        }
Example #15
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            btnSave.IsEnabled = btnCancel.IsEnabled = false;
            DispatcherHelper.DoEvents();

            string strMin    = PubHelper.p_LangOper.GetStringBundle("Pub_Minute"); // 分钟
            string strSecond = PubHelper.p_LangOper.GetStringBundle("Pub_Second"); // 秒

            PubHelper.p_BusinOper.UpdateSysCfgValue("TunOutTime", cmbTunOutTime.Text.Replace(strMin, ""));
            PubHelper.p_BusinOper.UpdateSysCfgValue("SellOperOutTime", cmbSellOperOutTime.Text.Replace(strSecond, ""));
            PubHelper.p_BusinOper.UpdateSysCfgValue("TermStatusShowTime", cmbTermStatusShowTime.Text.Replace(strSecond, ""));
            PubHelper.p_BusinOper.UpdateSysCfgValue("InputPwdOutTime", cmbInputPwdOutTime.Text.Replace(strSecond, ""));
            PubHelper.p_BusinOper.UpdateSysCfgValue("RefOpenMaxTime", cmbRefOpenMaxTime.Text.Replace(strMin, ""));
            PubHelper.p_BusinOper.UpdateSysCfgValue("TmpRunDelay", cmbRefCloseDelayTime.Text.Replace(strMin, ""));

            PubHelper.p_BusinOper.UpdateSysCfgValue("WebUrlOutTime", cmbWebUrlOutTime.Text.Replace(strMin, ""));
            PubHelper.p_BusinOper.UpdateSysCfgValue("OtherBrowseOutTime", cmbOtherBrowseOutTime.Text.Replace(strMin, ""));

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);
            this.Close();
        }
Example #16
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (cmbDtuPort.IsEnabled == true)
            {
                // 只检查DTU串口
                string strDtuPort = cmbDtuPort.Text.Replace("COM", "");
                PubHelper.p_BusinOper.UpdateSysCfgValue("DtuPort", strDtuPort);
            }
            else
            {
                // 只检查通信网关IP、端口
                string strNetIp   = tbNetIp_Value.Text;
                string strNetPort = tbNetPort_Value.Text;

                // 检查数据有效性
                if (string.IsNullOrEmpty(strNetIp))
                {
                    // 通信网关IP无效
                    PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Err_Input_InvalidNetIP"), PubHelper.MsgType.Ok);
                    return;
                }

                if (!(PubHelper.p_BusinOper.CheckDataOper.CheckIsPosInt(strNetPort)) ||
                    (strNetPort.Length != 4))
                {
                    // 通信网关端口无效
                    PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Err_Input_InvalidNetPort"), PubHelper.MsgType.Ok);
                    return;
                }

                btnSave.IsEnabled = btnCancel.IsEnabled = false;
                DispatcherHelper.DoEvents();

                PubHelper.p_BusinOper.UpdateSysCfgValue("NetIp", strNetIp);
                PubHelper.p_BusinOper.UpdateSysCfgValue("NetPort", strNetPort);
            }

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc_Restart"), PubHelper.MsgType.Ok);
            this.Close();
        }
        /// <summary>
        /// 超时监控主业务流程
        /// </summary>
        private void MonOutTimeTrd()
        {
            // 获取超时时间
            m_MonOutTime = 10;
            string strOutTime = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("TermStatusShowTime");

            if (!string.IsNullOrEmpty(strOutTime))
            {
                m_MonOutTime = Convert.ToInt32(strOutTime);
            }

            while (!m_CloseForm)
            {
                Thread.Sleep(20);

                if (!m_IsMonTime)
                {
                    // 重新开始超时监控
                    AfreshMonOutTime();
                }
                else
                {
                    m_OutNum++;
                    if (m_OutNum >= 50)
                    {
                        m_OutNum = 0;
                        m_OperNum++;

                        try
                        {
                            this.tbTitle.Dispatcher.Invoke(new Action(() =>
                            {
                                if (!m_CloseForm)
                                {
                                    if (m_OperNum > m_MonOutTime)
                                    {
                                        // 超时,自动返回
                                        // 重新开始超时监控
                                        AfreshMonOutTime();
                                        m_IsMonTime = true;
                                        //OperStepKind();

                                        this.Close();
                                        //Application.DoEvents();
                                    }
                                    else
                                    {
                                        ////if (tbOutTime.Visibility == System.Windows.Visibility.Hidden)
                                        ////{
                                        ////    tbOutTime.Visibility = System.Windows.Visibility.Visible;
                                        ////}
                                        ////// 显示剩余时间提示
                                        ////tbOutTime.Text = (m_MonOutTime - m_OperNum + 1).ToString();

                                        DispatcherHelper.DoEvents();
                                    }
                                }
                            }));
                        }
                        catch
                        {
                        }
                    }
                }
            }
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            string strModel      = string.Empty;
            bool   result        = false;
            string strErrInfo    = string.Empty;
            string strBeginTime1 = string.Empty;
            string strEndTime1   = string.Empty;
            string strBeginTime2 = string.Empty;
            string strEndTime2   = string.Empty;

            ControlButton(false);
            DispatcherHelper.DoEvents();

            #region 保存照明灯模式

            if (rdbLightModel_Time.IsChecked == true)
            {
                strModel = "0";
            }
            if (rdbLightModel_Run.IsChecked == true)
            {
                strModel = "1";
            }
            if (rdbLightModel_Stop.IsChecked == true)
            {
                strModel = "2";
            }

            if (strModel == "0")
            {
                // 检测时间段是否有效
                result        = false;
                strBeginTime1 = cmbLight_BeginTime1_Hour.Text + cmbLight_BeginTime1_Min.Text;
                strEndTime1   = cmbLight_EndTime1_Hour.Text + cmbLight_EndTime1_Min.Text;
                strBeginTime2 = cmbLight_BeginTime2_Hour.Text + cmbLight_BeginTime2_Min.Text;
                strEndTime2   = cmbLight_EndTime2_Hour.Text + cmbLight_EndTime2_Min.Text;
                result        = PubHelper.CheckModelTime(strBeginTime1, strEndTime1, strBeginTime2, strEndTime2, out strErrInfo);
                if (!result)
                {
                    PubHelper.ShowMsgInfo(strErrInfo, PubHelper.MsgType.Ok);
                    ControlButton(true);
                    return;
                }
                PubHelper.p_BusinOper.UpdateSysCfgValue("LightBeginTime1", strBeginTime1);
                PubHelper.p_BusinOper.UpdateSysCfgValue("LightEndTime1", strEndTime1);
                PubHelper.p_BusinOper.UpdateSysCfgValue("LightBeginTime2", strBeginTime2);
                PubHelper.p_BusinOper.UpdateSysCfgValue("LightEndTime2", strEndTime2);
            }

            PubHelper.p_BusinOper.UpdateSysCfgValue("LightModel", strModel);

            #endregion

            #region 保存广告灯灯模式

            if (rdbAdvertModel_Time.IsChecked == true)
            {
                strModel = "0";
            }
            if (rdbAdvertModel_Run.IsChecked == true)
            {
                strModel = "1";
            }
            if (rdbAdvertModel_Stop.IsChecked == true)
            {
                strModel = "2";
            }

            if (strModel == "0")
            {
                // 检测时间段是否有效
                result        = false;
                strBeginTime1 = cmbAdvert_BeginTime1_Hour.Text + cmbAdvert_BeginTime1_Min.Text;
                strEndTime1   = cmbAdvert_EndTime1_Hour.Text + cmbAdvert_EndTime1_Min.Text;
                strBeginTime2 = cmbAdvert_BeginTime2_Hour.Text + cmbAdvert_BeginTime2_Min.Text;
                strEndTime2   = cmbAdvert_EndTime2_Hour.Text + cmbAdvert_EndTime2_Min.Text;
                result        = PubHelper.CheckModelTime(strBeginTime1, strEndTime1, strBeginTime2, strEndTime2, out strErrInfo);
                if (!result)
                {
                    PubHelper.ShowMsgInfo(strErrInfo, PubHelper.MsgType.Ok);
                    ControlButton(true);
                    return;
                }
                PubHelper.p_BusinOper.UpdateSysCfgValue("AdLampBeginTime1", strBeginTime1);
                PubHelper.p_BusinOper.UpdateSysCfgValue("AdLampEndTime1", strEndTime1);
                PubHelper.p_BusinOper.UpdateSysCfgValue("AdLampBeginTime2", strBeginTime2);
                PubHelper.p_BusinOper.UpdateSysCfgValue("AdLampEndTime2", strEndTime2);
            }

            PubHelper.p_BusinOper.UpdateSysCfgValue("AdLampModel", strModel);

            #endregion

            #region 保存除雾设备模式

            if (rdbChuWuModel_Time.IsChecked == true)
            {
                strModel = "0";
            }
            if (rdbChuWuModel_Run.IsChecked == true)
            {
                strModel = "1";
            }
            if (rdbChuWuModel_Stop.IsChecked == true)
            {
                strModel = "2";
            }

            if (strModel == "0")
            {
                // 检测时间段是否有效
                result        = false;
                strBeginTime1 = cmbChuWu_BeginTime1_Hour.Text + cmbChuWu_BeginTime1_Min.Text;
                strEndTime1   = cmbChuWu_EndTime1_Hour.Text + cmbChuWu_EndTime1_Min.Text;
                strBeginTime2 = cmbChuWu_BeginTime2_Hour.Text + cmbChuWu_BeginTime2_Min.Text;
                strEndTime2   = cmbChuWu_EndTime2_Hour.Text + cmbChuWu_EndTime2_Min.Text;
                result        = PubHelper.CheckModelTime(strBeginTime1, strEndTime1, strBeginTime2, strEndTime2, out strErrInfo);
                if (!result)
                {
                    PubHelper.ShowMsgInfo(strErrInfo, PubHelper.MsgType.Ok);
                    ControlButton(true);
                    return;
                }
                PubHelper.p_BusinOper.UpdateSysCfgValue("FogBeginTime1", strBeginTime1);
                PubHelper.p_BusinOper.UpdateSysCfgValue("FogEndTime1", strEndTime1);
                PubHelper.p_BusinOper.UpdateSysCfgValue("FogBeginTime2", strBeginTime2);
                PubHelper.p_BusinOper.UpdateSysCfgValue("FogEndTime2", strEndTime2);
            }

            PubHelper.p_BusinOper.UpdateSysCfgValue("FogModel", strModel);

            #endregion

            #region 保存显示屏模式

            if (rdbScreenModel_Time.IsChecked == true)
            {
                strModel = "0";
            }
            if (rdbScreenModel_Run.IsChecked == true)
            {
                strModel = "1";
            }
            if (rdbScreenModel_Stop.IsChecked == true)
            {
                strModel = "2";
            }

            if (strModel == "0")
            {
                // 检测时间段是否有效
                result        = false;
                strBeginTime1 = cmbScreen_BeginTime1_Hour.Text + cmbScreen_BeginTime1_Min.Text;
                strEndTime1   = cmbScreen_EndTime1_Hour.Text + cmbScreen_EndTime1_Min.Text;
                strBeginTime2 = cmbScreen_BeginTime2_Hour.Text + cmbScreen_BeginTime2_Min.Text;
                strEndTime2   = cmbScreen_EndTime2_Hour.Text + cmbScreen_EndTime2_Min.Text;
                result        = PubHelper.CheckModelTime(strBeginTime1, strEndTime1, strBeginTime2, strEndTime2, out strErrInfo);
                if (!result)
                {
                    PubHelper.ShowMsgInfo(strErrInfo, PubHelper.MsgType.Ok);
                    ControlButton(true);
                    return;
                }
                PubHelper.p_BusinOper.UpdateSysCfgValue("PowerBeginTime1", strBeginTime1);
                PubHelper.p_BusinOper.UpdateSysCfgValue("PowerEndTime1", strEndTime1);
                PubHelper.p_BusinOper.UpdateSysCfgValue("PowerBeginTime2", strBeginTime2);
                PubHelper.p_BusinOper.UpdateSysCfgValue("PowerEndTime2", strEndTime2);
            }

            PubHelper.p_BusinOper.UpdateSysCfgValue("PowerModel", strModel);

            #endregion

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);
            this.Close();
        }
Example #19
0
        /// <summary>
        /// 广告导入工作线程
        /// </summary>
        private void ImportTrd()
        {
            /* 广告导入处理流程
             * 1、搜索移动盘根目录下的广告配置文件,并读取广告配置文件
             * 2、根据广告配置文件,检查相关广告文件是否存在及格式是否正确;
             * 3、拷贝复制配置文件以及广告播放文件到指定目录
             * 3、如果成功,则清空原有广告播放文件
             * 4、拷贝新的文件到广告正式播放目录下
             *
             */

            int intErrCode = 0;

            try
            {
                this.tbTitle.Dispatcher.Invoke(new Action(() =>
                {
                    tbInfo.Text = PubHelper.p_LangOper.GetStringBundle("Pub_Import_Checking");// 正在读取导入文件
                    DispatcherHelper.SleepControl();
                    DispatcherHelper.DoEvents();
                }));

                #region 遍历各盘符,查询是否有广告信息导入文件

                string   strDiskPath      = "d;e;f;g;h;i;j;k";
                string[] hexDiskPath      = strDiskPath.Split(';');
                int      hexDiskLen       = hexDiskPath.Length;
                string   strUDiskFilePath = string.Empty;
                string   strFilaPath      = string.Empty;

                string strImportFileName = "advertlist.txt";

                bool blnFileExist = false;
                for (int i = 0; i < hexDiskLen; i++)
                {
                    strUDiskFilePath = hexDiskPath[i] + ":\\";
                    strFilaPath      = strUDiskFilePath + strImportFileName;
                    // 检测广告导入文件是否存在
                    if (File.Exists(strFilaPath))
                    {
                        // 导入文件存在
                        blnFileExist = true;
                        break;
                    }
                }

                #endregion

                // 0:成功 1:没有找到商品信息导入文件 2:读取商品信息导入文件失败 3:导入失败
                if (blnFileExist)
                {
                    #region 读取导入信息文件内容

                    string strListInfo = File.ReadAllText(strFilaPath, Encoding.Default);

                    // 0:成功 1:获取导入信息失败 2:没有要导入的信息 3:导入失败
                    string updateMcdList = string.Empty;
                    string _advListId    = string.Empty;
                    intErrCode = PubHelper.p_BusinOper.VmFileOper.ImportAdvertList(strListInfo, "0",
                                                                                   strUDiskFilePath, out _advListId, out updateMcdList);
                    if (intErrCode != 0)
                    {
                        intErrCode = intErrCode + 2;
                    }
                    else
                    {
                        #region 读取信息成功,检查相关广告文件

                        int intCount = PubHelper.p_BusinOper.VmFileOper.AdvertList_Import.Count;
                        if (intCount == 0)
                        {
                            intErrCode = 4;// 没有广告信息
                        }
                        else
                        {
                            // 广告文件存储临时文件夹
                            string strAdvertDicPath_Temp = AppDomain.CurrentDomain.BaseDirectory.ToString() + "Advert_Temp\\";
                            // 广告文件存储正式文件夹
                            string strAdvertDicPath_Formal = AppDomain.CurrentDomain.BaseDirectory.ToString() + "Advert\\";

                            #region 如果广告临时文件夹不存在,则创建

                            bool result = PubHelper.CreatDire(strAdvertDicPath_Temp);

                            #endregion

                            #region 计算空间大小

                            this.tbTitle.Dispatcher.Invoke(new Action(() =>
                            {
                                tbInfo.Text = PubHelper.p_LangOper.GetStringBundle("Pub_Import_Disking");// 正在计算空间大小
                                DispatcherHelper.SleepControl();
                                DispatcherHelper.DoEvents();
                            }));

                            string   strAdvertFileName     = string.Empty;
                            string   strAdvertFileType     = string.Empty;
                            string   strAdvertFileNameType = string.Empty;
                            string   strImportFilePath     = string.Empty;
                            FileInfo fileInfo;
                            long     fileCountSize = 0;

                            for (int i = 0; i < intCount; i++)
                            {
                                strAdvertFileName     = PubHelper.p_BusinOper.VmFileOper.AdvertList_Import[i].FileName;
                                strAdvertFileType     = PubHelper.p_BusinOper.VmFileOper.AdvertList_Import[i].FileType;
                                strAdvertFileNameType = strAdvertFileName + "." + strAdvertFileType;
                                strImportFilePath     = strUDiskFilePath + strAdvertFileNameType;
                                // 检测该广告文件是否存在
                                if (File.Exists(strImportFilePath))
                                {
                                    // 广告文件存在
                                    fileInfo       = new FileInfo(strImportFilePath);// 获取该广告文件大小
                                    fileCountSize += fileInfo.Length;
                                }
                            }

                            #endregion

                            if (fileCountSize * 10 > PubHelper.p_BusinOper.CheckDataOper.GetCurrentDiskSpaceSize())
                            {
                                // 硬盘空间不足
                                intErrCode = 5;
                            }
                            else
                            {
                                PubHelper.p_BusinOper.SysCfgOper.UpdateSysCfg("UpdateAdvertListID", PubHelper.p_BusinOper.VmFileOper.UpdateAdvertListID);

                                #region 拷贝广告文件到临时文件夹

                                string strOperInfo = PubHelper.p_LangOper.GetStringBundle("Pub_Import_Opering");// 正在处理导入文件
                                for (int i = 0; i < intCount; i++)
                                {
                                    strAdvertFileName     = PubHelper.p_BusinOper.VmFileOper.AdvertList_Import[i].FileName;
                                    strAdvertFileType     = PubHelper.p_BusinOper.VmFileOper.AdvertList_Import[i].FileType;
                                    strAdvertFileNameType = strAdvertFileName + "." + strAdvertFileType;
                                    strImportFilePath     = strUDiskFilePath + strAdvertFileNameType;
                                    // 检测该广告文件是否存在
                                    if (File.Exists(strImportFilePath))
                                    {
                                        this.tbTitle.Dispatcher.Invoke(new Action(() =>
                                        {
                                            tbInfo.Text = strOperInfo.Replace("{N}", strAdvertFileNameType);// 正在处理导入文件

                                            DispatcherHelper.SleepControl();
                                            DispatcherHelper.DoEvents();
                                        }));

                                        // 广告文件存在 拷贝广告文件到临时文件夹
                                        File.Copy(strImportFilePath,
                                                  strAdvertDicPath_Temp + strAdvertFileNameType, true);
                                    }
                                }

                                File.Copy(strFilaPath, strAdvertDicPath_Temp + strImportFileName, true);

                                #endregion

                                #region 清除历史广告文件

                                this.tbTitle.Dispatcher.Invoke(new Action(() =>
                                {
                                    tbInfo.Text = PubHelper.p_LangOper.GetStringBundle("Pub_Import_Clearing");// 正在清除历史文件
                                    DispatcherHelper.SleepControl();
                                    DispatcherHelper.DoEvents();
                                }));

                                DirectoryInfo di = new DirectoryInfo(strAdvertDicPath_Formal);
                                // 判断目录是否存在
                                FileInfo[] fi = di.GetFiles();//获得目录下文件
                                foreach (FileInfo f in fi)
                                {
                                    //判断指定文件是否存在
                                    File.Delete(f.FullName);
                                }

                                #endregion

                                #region 从临时文件夹把新的广告文件移动到正式广告文件夹里

                                DirectoryInfo di_Temp = new DirectoryInfo(strAdvertDicPath_Temp);
                                // 判断目录是否存在
                                FileInfo[] fi_Temp = di_Temp.GetFiles();//获得目录下文件
                                foreach (FileInfo f in fi_Temp)
                                {
                                    //判断指定文件是否存在
                                    f.MoveTo(strAdvertDicPath_Formal + f.Name);
                                }

                                #endregion

                                PubHelper.p_BusinOper.VmFileOper.AdvertList = PubHelper.p_BusinOper.VmFileOper.AdvertList_Import;
                            }
                        }
                        #endregion
                    }

                    #endregion
                }
                else
                {
                    intErrCode = 1;// 没有找到信息导入文件
                }
            }
            catch
            {
                intErrCode = 2;// 认为读取导入文件失败
            }

            string strMsgInfo = string.Empty;
            switch (intErrCode)
            {
            case 0:    // 导入成功
                strMsgInfo = PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc");
                break;

            case 1:    // 没有找到信息导入文件
                strMsgInfo = PubHelper.p_LangOper.GetStringBundle("Err_Import_NoFile");
                break;

            case 2:    // 读取信息导入文件失败
                strMsgInfo = PubHelper.p_LangOper.GetStringBundle("Err_Import_ReadFileFail");
                break;

            case 3:    // 获取导入信息失败
                strMsgInfo = PubHelper.p_LangOper.GetStringBundle("Err_Import_GetInfoFail");
                break;

            case 4:    // 没有要导入的信息
                strMsgInfo = PubHelper.p_LangOper.GetStringBundle("Err_Import_NoInfo");
                break;

            case 5:    // 硬盘空间不足
                strMsgInfo = PubHelper.p_LangOper.GetStringBundle("Err_Import_NoSpace").Replace("{N}", PubHelper.p_BusinOper.CheckDataOper.GetAppDisk());
                break;

            default:    // 导入失败
                strMsgInfo = PubHelper.p_LangOper.GetStringBundle("Pub_OperFail");
                break;
            }

            this.tbTitle.Dispatcher.Invoke(new Action(() =>
            {
                PubHelper.ShowMsgInfo(strMsgInfo, PubHelper.MsgType.Ok);
                this.Close();
            }));
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            btnSave.IsEnabled = btnCancel.IsEnabled = false;
            DispatcherHelper.DoEvents();

            string strLanguage = "0";

            if (rdbLanguage_Chinese.IsChecked == true)
            {
                strLanguage = "1";
            }
            if (rdbLanguage_French.IsChecked == true)
            {
                strLanguage = "3";
            }
            string strVmCode = tbVmCode_Value.Text;

            string strNetSwitch = "0";

            if (rdbNetSwitch_Stop.IsChecked == false)
            {
                strNetSwitch = "1";
            }
            string strNetPhoneNum = tbPhoneNum_Value.Text;
            string strNetPwd      = tbNetPwd_Value.Text;

            string strStockSwitch = "0";

            if (rdbStock_Stop.IsChecked == false)
            {
                strStockSwitch = "1";
            }

            string strKeyboard = "0";

            if (rdbKeyBoard_Small.IsChecked == false)
            {
                strKeyboard = "1";
            }

            // 保存数据
            PubHelper.p_BusinOper.UpdateSysCfgValue("VmCode", strVmCode);
            string strOldLanguage = "0";

            if (PubHelper.p_BusinOper.ConfigInfo.Language == Business.Enum.BusinessEnum.Language.Zh_CN)
            {
                strOldLanguage = "1";
            }

            if (strLanguage != strOldLanguage)
            {
                PubHelper.p_BusinOper.UpdateSysCfgValue("Language", strLanguage);
                bool blnResult = PubHelper.RefreshLanguage();
                PubHelper.p_IsRefreshLanguage = true;
            }

            PubHelper.p_BusinOper.UpdateSysCfgValue("NetSwitch", strNetSwitch);
            PubHelper.p_BusinOper.UpdateSysCfgValue("NetPhone", strNetPhoneNum);
            PubHelper.p_BusinOper.UpdateSysCfgValue("NetPwd", strNetPwd);

            PubHelper.p_BusinOper.UpdateSysCfgValue("IsRunStock", strStockSwitch);

            if (strKeyboard != PubHelper.p_BusinOper.ConfigInfo.KeyBoardType)
            {
                PubHelper.p_BusinOper.UpdateSysCfgValue("KeyBoardType", strKeyboard);
            }

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);
            this.Close();
        }
Example #21
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            btnSave.IsEnabled = btnCancel.IsEnabled = false;
            DispatcherHelper.DoEvents();

            string strHideCursor = "0";

            if (rdbHideCuror_Hide.IsChecked == true)
            {
                strHideCursor = "1";
            }

            string strSkin = "0";

            if (cmbSoftSkin.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_Star"))
            {
                strSkin = "1";
            }

            // 商品显示模式
            string strGoodsShowModel    = "0";
            string strEachPageMaxRowNum = string.Empty;
            string strEachRowMaxColuNum = string.Empty;

            if (cmbGoodsShowModel.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsModel_Goods"))
            {
                strGoodsShowModel    = "1";
                strEachPageMaxRowNum = cmbEachPageMaxRowNum.Text;
                strEachRowMaxColuNum = cmbEachRowMaxColuNum.Text;
            }
            if (cmbGoodsShowModel.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsModel_Type"))
            {
                strGoodsShowModel    = "3";
                strEachPageMaxRowNum = cmbEachPageMaxRowNum.Text;
                strEachRowMaxColuNum = cmbEachRowMaxColuNum.Text;
            }

            // 商品列表显示内容
            string strGoodsShowType = "1";

            if (cmbGoodsShowType.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsShow_Asile"))
            {
                strGoodsShowType = "2";
            }
            if (cmbGoodsShowType.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsShow_AsilePrice"))
            {
                strGoodsShowType = "3";
            }
            if (cmbGoodsShowType.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsShow_McdName"))
            {
                strGoodsShowType = "4";
            }
            if (cmbGoodsShowType.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsShow_McdNamePrice"))
            {
                strGoodsShowType = "5";
            }

            // 商品名称显示内容
            string strGoodsNameType = "1";

            if (cmbGoodsNameType.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsName_Asile"))
            {
                strGoodsNameType = "2";
            }
            if (cmbGoodsNameType.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsName_AsileName"))
            {
                strGoodsNameType = "3";
            }

            // 商品属性显示内容
            string strGoodsPropType = "0";

            if (cmbGoodsPropShowType.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsProp_Content"))
            {
                strGoodsPropType = "1";
            }
            if (cmbGoodsPropShowType.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsProp_Spec"))
            {
                strGoodsPropType = "2";
            }
            if (cmbGoodsPropShowType.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsProp_Manuf"))
            {
                strGoodsPropType = "3";
            }
            if (cmbGoodsPropShowType.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsProp_SpecManuf"))
            {
                strGoodsPropType = "4";
            }
            if (cmbGoodsPropShowType.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsProp_PiCiDate"))
            {
                strGoodsPropType = "5";
            }
            if (cmbGoodsPropShowType.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsProp_Drug"))
            {
                strGoodsPropType = "6";
            }

            string strIsGoodsContentDetail = "0";

            if (cmbIsShowGoodsDetailContent.Text == PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_Skin_GoodsContent_Detail"))
            {
                strIsGoodsContentDetail = "1";
            }

            // 售完商品透明度
            string strGoodsOpacity = cmbGoodsOpacity.Text;

            string strRun = PubHelper.p_LangOper.GetStringBundle("Pub_Run");
            // 售完商品点击
            string strGoodsClick = "0";

            if (cmbGoodsClick.Text == strRun)
            {
                strGoodsClick = "1";
            }

            string strIsShowMoneySymbol = "0";

            if (cmbIsShowMoneySymbol.Text == strRun)
            {
                strIsShowMoneySymbol = "1";
            }

            string strIsShowChoiceKeyboard = "0";

            if (cmbIsShowChoiceKeyBoard.Text == strRun)
            {
                strIsShowChoiceKeyboard = "1";
            }

            // 保存参数
            PubHelper.p_BusinOper.UpdateSysCfgValue("HideCuror", strHideCursor);
            PubHelper.p_BusinOper.UpdateSysCfgValue("SkinStyle", strSkin);

            PubHelper.p_BusinOper.UpdateSysCfgValue("GoodsShowModel", strGoodsShowModel);
            if ((strGoodsShowModel == "1") || (strGoodsShowModel == "3"))
            {
                PubHelper.p_BusinOper.UpdateSysCfgValue("EachPageMaxRowNum", strEachPageMaxRowNum);
                PubHelper.p_BusinOper.UpdateSysCfgValue("EachRowMaxColuNum", strEachRowMaxColuNum);
            }

            PubHelper.p_BusinOper.UpdateSysCfgValue("GoodsShowContent", strGoodsShowType);
            PubHelper.p_BusinOper.UpdateSysCfgValue("GoodsNameShowType", strGoodsNameType);
            PubHelper.p_BusinOper.UpdateSysCfgValue("GoodsPropShowType", strGoodsPropType);
            PubHelper.p_BusinOper.UpdateSysCfgValue("IsShowGoodsDetailContent", strIsGoodsContentDetail);

            PubHelper.p_BusinOper.UpdateSysCfgValue("GoodsOpacity", strGoodsOpacity);
            PubHelper.p_BusinOper.UpdateSysCfgValue("NoStockClickGoods", strGoodsClick);

            PubHelper.p_BusinOper.UpdateSysCfgValue("IsShowMoneySymbol", strIsShowMoneySymbol);

            if (PubHelper.p_BusinOper.ConfigInfo.GoodsDetailFontSize.ToString() != cmbFontSize.Text)
            {
                PubHelper.p_BusinOper.UpdateSysCfgValue("GoodsDetailFontSize", cmbFontSize.Text);
            }

            PubHelper.p_BusinOper.UpdateSysCfgValue("IsShowChoiceKeyBoard", strIsShowChoiceKeyboard);

            PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc_Restart"), PubHelper.MsgType.Ok);
            this.Close();
        }
        /// <summary>
        /// 按钮—托盘设置价格
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSetTray_Click(object sender, RoutedEventArgs e)
        {
            if (!PubHelper.CheckIsManager1Purview("10"))
            {
                return;
            }

            string strAsilePrice = tbAsilePrice_Value.Text;

            #region 检查数据有效性

            string _errInfo = string.Empty;
            if (!PubHelper.CheckInputPrice(strAsilePrice, out _errInfo))
            {
                // 金额格式错误
                PubHelper.ShowMsgInfo(_errInfo, PubHelper.MsgType.Ok);
                return;
            }

            double dblAsilePrice = Convert.ToDouble(strAsilePrice) * PubHelper.p_BusinOper.ConfigInfo.DecimalNum;

            #endregion

            #region 保存托盘价格

            string strAskInfo = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AsileCfg_TrayAsk");
            strAskInfo = strAskInfo.Replace("{N}", PubHelper.p_BusinOper.ChangeTray((currentTrayIndex + 1).ToString()));
            strAskInfo = strAskInfo.Replace("{K}", strAsilePrice);

            PubHelper.ShowMsgInfo(strAskInfo, PubHelper.MsgType.YesNo);
            if (PubHelper.p_MsgResult)
            {
                ControlAsile(false);
                btnCancel.IsEnabled = false;
                DispatcherHelper.DoEvents();

                PubHelper.p_BusinOper.AsileOper.Asile_Temp.TrayIndex = currentTrayIndex;
                PubHelper.p_BusinOper.AsileOper.Asile_Temp.SellPrice = dblAsilePrice.ToString();

                InitOper();
                m_OperType = "1";
                // 启动保存操作线程
                Thread TrdOper = new Thread(new ThreadStart(OperTrd));
                TrdOper.IsBackground = true;
                TrdOper.Start();

                int delayTime = 0;
                while (!m_IsOper)
                {
                    Thread.Sleep(50);
                    delayTime++;
                    if (delayTime > 200)
                    {
                        break;
                    }
                }

                ////bool result = PubHelper.p_BusinOper.UpdateTrayPrice(currentTrayIndex.ToString(),
                ////    dblAsilePrice.ToString(), m_VendBoxCode);
                if (m_OperResult)
                {
                    PubHelper.p_IsRefreshAsile = true;

                    currentGoodsWay.CurrentGoodsWayProduct.SellPrice = dblAsilePrice.ToString();

                    #region 更新该托盘内的所有货道价格

                    int intAsileCount = panelAsile.Children.Count;
                    for (int asileIndex = 0; asileIndex < intAsileCount; asileIndex++)
                    {
                        GoodsWayProduct productControl = (GoodsWayProduct)panelAsile.Children[asileIndex];
                        if (productControl.CurrentGoodsWayProduct != null)
                        {
                            productControl.SetSecondText(PubHelper.p_BusinOper.MoneyIntToString(dblAsilePrice.ToString()) +
                                                         "【" + productControl.CurrentGoodsWayProduct.SpringNum + "】");
                        }
                    }

                    #endregion

                    PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);
                }
                else
                {
                    PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperFail"), PubHelper.MsgType.Ok);
                }

                ControlAsile(true);
                btnCancel.IsEnabled = true;
            }

            #endregion
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            string strAsilePrice = tbAsilePrice_Value.Text;
            string strSpringNum  = tbSpringNum_Value.Text;
            string strAsileKind  = "0";
            string strSellModel  = "0";

            BusinessEnum.AsileSellModel asileSellModel = BusinessEnum.AsileSellModel.Normal;
            if (rbStop.IsChecked == true)
            {
                strAsileKind = "1";
            }

            if (rdbSellModel_Gift.IsChecked == true)
            {
                strSellModel   = "1";
                asileSellModel = BusinessEnum.AsileSellModel.Gift;
            }

            #region 检查数据有效性

            string _errInfo = string.Empty;
            if (!PubHelper.CheckInputPrice(strAsilePrice, out _errInfo))
            {
                // 金额格式错误
                PubHelper.ShowMsgInfo(_errInfo, PubHelper.MsgType.Ok);
                return;
            }

            double dblAsilePrice = Convert.ToDouble(strAsilePrice) * PubHelper.p_BusinOper.ConfigInfo.DecimalNum;

            #endregion

            #region 检查是否需要修改

            bool blnIsSave = false;

            if ((currentGoodsWay.CurrentGoodsWayProduct.SellPrice != dblAsilePrice.ToString()) ||
                (currentGoodsWay.CurrentGoodsWayProduct.SpringNum.ToString() != strSpringNum) ||
                (currentGoodsWay.CurrentGoodsWayProduct.PaKind != strAsileKind) ||
                (currentGoodsWay.CurrentGoodsWayProduct.SellModel != asileSellModel))
            {
                blnIsSave = true;
            }

            #endregion

            if (blnIsSave)
            {
                ControlAsile(false);
                btnCancel.IsEnabled = false;
                DispatcherHelper.DoEvents();

                PubHelper.p_BusinOper.AsileOper.Asile_Temp.PaCode    = currentGoodsWay.CurrentGoodsWayProduct.PaCode;
                PubHelper.p_BusinOper.AsileOper.Asile_Temp.SellPrice = dblAsilePrice.ToString();
                PubHelper.p_BusinOper.AsileOper.Asile_Temp.SpringNum = Convert.ToInt32(strSpringNum);
                PubHelper.p_BusinOper.AsileOper.Asile_Temp.PaKind    = strAsileKind;
                PubHelper.p_BusinOper.AsileOper.Asile_Temp.PaStatus  = strSellModel;

                InitOper();
                m_OperType = "0";
                // 启动保存操作线程
                Thread TrdOper = new Thread(new ThreadStart(OperTrd));
                TrdOper.IsBackground = true;
                TrdOper.Start();

                int delayTime = 0;
                while (!m_IsOper)
                {
                    Thread.Sleep(50);
                    delayTime++;
                    if (delayTime > 200)
                    {
                        break;
                    }
                }
                ////bool result = PubHelper.p_BusinOper.UpdateAsileInfo(currentGoodsWay.CurrentGoodsWayProduct.PaCode,
                ////    dblAsilePrice.ToString(), strSpringNum, strAsileKind, strSellModel);
                if (m_OperResult)
                {
                    currentGoodsWay.CurrentGoodsWayProduct.SellPrice = dblAsilePrice.ToString();
                    currentGoodsWay.CurrentGoodsWayProduct.SpringNum = Convert.ToInt32(strSpringNum);
                    SetAsileInfo(currentGoodsWay);

                    PubHelper.p_IsRefreshAsile = true;

                    PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);
                }
                else
                {
                    PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperFail"), PubHelper.MsgType.Ok);
                }

                ControlAsile(true);
                btnCancel.IsEnabled = true;
            }
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            btnSave.IsEnabled = btnCancel.IsEnabled = false;
            DispatcherHelper.DoEvents();

            string strShipPort = cmbShippPort.Text.Replace("COM", "");

            string strUpDownSellModel = "0";

            if (rdbUpDownSellModel_Pra.IsChecked == true)
            {
                strUpDownSellModel = "1";
            }

            string strUpDownIsQueryElectStatus = "0";

            if (rdbUpDownIsQueryElectStatus_Yes.IsChecked == true)
            {
                strUpDownIsQueryElectStatus = "1";
            }

            string strFailMsgInfo = PubHelper.p_LangOper.GetStringBundle("Pub_OperFail");
            // 保存小车左、中、右移动位置格数
            bool result = true;

            if (!PubHelper.p_BusinOper.CheckDataOper.CheckIsNum(tbLeftSpace_Value.Text))
            {
                result = false;
            }
            else if (!PubHelper.p_BusinOper.CheckDataOper.CheckIsNum(tbMiddleSpace_Value.Text))
            {
                result = false;
            }
            else if (!PubHelper.p_BusinOper.CheckDataOper.CheckIsNum(tbRightSpace_Value.Text))
            {
                result = false;
            }
            else
            {
                result = true;
            }
            if (!result)
            {
                PubHelper.ShowMsgInfo(strFailMsgInfo, PubHelper.MsgType.Ok);
                btnSave.IsEnabled = btnCancel.IsEnabled = true;
                return;
            }

            PubHelper.p_BusinOper.UpdateSysCfgValue("UpDownLeftRightNum_Left", tbLeftSpace_Value.Text);
            PubHelper.p_BusinOper.UpdateSysCfgValue("UpDownLeftRightNum_Center", tbMiddleSpace_Value.Text);
            PubHelper.p_BusinOper.UpdateSysCfgValue("UpDownLeftRightNum_Right", tbRightSpace_Value.Text);

            result = PubHelper.p_BusinOper.AsileOper.UpDown_Update_Port(PubHelper.p_VendBoxCode, strShipPort, strUpDownSellModel, strUpDownIsQueryElectStatus);
            if (result)
            {
                PubHelper.ShowMsgInfo(PubHelper.p_LangOper.GetStringBundle("Pub_OperSuc"), PubHelper.MsgType.Ok);
                this.Close();
            }
            else
            {
                PubHelper.ShowMsgInfo(strFailMsgInfo, PubHelper.MsgType.Ok);
                btnSave.IsEnabled = btnCancel.IsEnabled = true;
            }
        }