Exemplo n.º 1
0
        private void InitForm()
        {
            #region 初始化界面资源

            tbTitle.Text       = PubHelper.ConvertNoFeeCardPayName();// PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_NoFeeCard_Title");
            tbSwitch.Text      = PubHelper.p_LangOper.GetStringBundle("Pub_Payment_Control");
            tbPort.Text        = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_NoFeeCard_Port");
            tbPayShow.Text     = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_NoFeeCard_PayShow");
            tbHideCardNum.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_NoFeeCard_HideCardNum");
            tbIsRebate.Text    = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AdvanCfg_NoFeeCard_IsRebate");

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

            string strRun  = PubHelper.p_LangOper.GetStringBundle("Pub_Run");
            string strStop = PubHelper.p_LangOper.GetStringBundle("Pub_Stop");
            rdbSwitch_Run.Content        = rdbPayShow_Run.Content = rdbHideCardNum_Run.Content =
                rdbIsRebate_Run.Content  = strRun;
            rdbSwitch_Stop.Content       = rdbPayShow_Stop.Content = rdbHideCardNum_Stop.Content =
                rdbIsRebate_Stop.Content = strStop;

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

            #endregion

            #region 加载数据

            string strSwitch = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("NoFeeCardSwitch");
            if (strSwitch == "0")
            {
                rdbSwitch_Stop.IsChecked         = true;
                cmbPort.IsEnabled                = rdbPayShow_Run.IsEnabled = rdbPayShow_Stop.IsEnabled =
                    rdbHideCardNum_Run.IsEnabled = rdbHideCardNum_Stop.IsEnabled = false;
            }
            else
            {
                rdbSwitch_Run.IsChecked          = true;
                cmbPort.IsEnabled                = rdbPayShow_Run.IsEnabled = rdbPayShow_Stop.IsEnabled =
                    rdbHideCardNum_Run.IsEnabled = rdbHideCardNum_Stop.IsEnabled = true;
            }

            if (PubHelper.p_BusinOper.ConfigInfo.NoFeeCardPayShow == Business.Enum.BusinessEnum.ControlSwitch.Stop)
            {
                rdbPayShow_Stop.IsChecked = true;
            }
            else
            {
                rdbPayShow_Run.IsChecked = true;
            }

            if (PubHelper.p_BusinOper.ConfigInfo.NoFeeCardNumHide == Business.Enum.BusinessEnum.ControlSwitch.Stop)
            {
                rdbHideCardNum_Stop.IsChecked = true;
            }
            else
            {
                rdbHideCardNum_Run.IsChecked = true;
            }

            if (PubHelper.p_BusinOper.ConfigInfo.NoFeeCardIsRebate == "0")
            {
                rdbIsRebate_Stop.IsChecked = true;
            }
            else
            {
                rdbIsRebate_Run.IsChecked = true;
            }

            cmbPort.Text = "COM" + PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("NoFeeCardPort");

            #endregion

            m_IsInit = false;
        }