示例#1
0
        private void InitForm()
        {
            #region 计算各区域尺寸

            ////double scrHeight = SystemParameters.PrimaryScreenHeight;
            ////panel_Content.Height = scrHeight - 100;

            #endregion

            string strPicPath = string.Empty;
            bool   result     = PubHelper.GetFormPubPic("ShZyZ_Query_Bg.png", out strPicPath);
            if (result)
            {
                img_Bg.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
            }

            result = PubHelper.GetFormPubPic("ShZyZ_Query_ZhiYuanZhe.png", out strPicPath);
            if (result)
            {
                imgShZy_Query_ZhiYuanZhe.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
            }

            result = PubHelper.GetFormPubPic("ShZyZ_Query_JiJinHui.png", out strPicPath);
            if (result)
            {
                imgShZy_Query_JiJinHui.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
            }
        }
示例#2
0
        private void InitForm()
        {
            string strPicPath = string.Empty;
            bool   result     = PubHelper.GetFormPubPic("ShZyZ_Gift_Bg.png", out strPicPath);

            if (result)
            {
                img_Bg.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
            }
        }
示例#3
0
        private void InitForm()
        {
            #region 计算各区域尺寸

            ////double scrHeight = SystemParameters.PrimaryScreenHeight;
            ////panel_Content.Height = scrHeight - 100;

            #endregion

            string strPicPath = string.Empty;
            bool   result     = PubHelper.GetFormPubPic("ShZyZ_Donate_Choice_Bg.png", out strPicPath);
            if (result)
            {
                img_Bg.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
            }

            result = PubHelper.GetFormPubPic("ShZyZ_Donate_PayCash.png", out strPicPath);
            if (result)
            {
                imgShZy_Donate_Cash.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
            }

            result = PubHelper.GetFormPubPic("ShZyZ_Donate_PayAliPay.png", out strPicPath);
            if (result)
            {
                imgShZy_Donate_AliPay.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
            }

            switch (PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue_Third("JuanZeng_Switch"))
            {
            case "0":    // 停止
                imgShZy_Donate_Cash.Visibility = imgShZy_Donate_AliPay.Visibility = System.Windows.Visibility.Hidden;
                break;

            case "1":    // 只开启现金捐赠
                imgShZy_Donate_Cash.Visibility   = System.Windows.Visibility.Visible;
                imgShZy_Donate_AliPay.Visibility = System.Windows.Visibility.Hidden;
                break;

            case "2":    // 只开启支付宝捐赠
                imgShZy_Donate_Cash.Visibility   = System.Windows.Visibility.Hidden;
                imgShZy_Donate_AliPay.Visibility = System.Windows.Visibility.Visible;
                break;

            case "3":    // 现金和支付宝捐赠全开
                imgShZy_Donate_Cash.Visibility = imgShZy_Donate_AliPay.Visibility = System.Windows.Visibility.Visible;
                break;

            default:
                imgShZy_Donate_Cash.Visibility = imgShZy_Donate_AliPay.Visibility = System.Windows.Visibility.Hidden;
                break;
            }
        }
示例#4
0
        private void LoadBgImage()
        {
            string strPicPath = string.Empty;
            string strPicName = string.Empty;

            switch (m_PageIndex)
            {
            case 1:    // 第一页
                strPicName = "ShZyZ_Content_Bg.png";
                break;

            case 2:    // 第二页
                strPicName = "ShZyZ_Content_Bg_2.png";
                break;

            case 3:    // 第三页
                strPicName = "ShZyZ_Content_Bg_3.png";
                break;

            default:
                strPicName = "ShZyZ_Content_Bg.png";
                break;
            }

            try
            {
                bool result = PubHelper.GetFormPubPic(strPicName, out strPicPath);
                if (result)
                {
                    img_Bg.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
                }
            }
            catch
            {
            }
        }
        private void InitForm()
        {
            #region 计算各区域尺寸

            double scrHeight = SystemParameters.PrimaryScreenHeight;
            panelTop.Height      = scrHeight * 0.23;
            panelBottom.Height   = scrHeight * 0.36;
            panelMiddele.Height  = scrHeight * 0.41;
            panelMiddele.Margin  = new Thickness(0, panelTop.Height + 1, 0, 0);
            tbProgressInfo.Width = panelMiddele.Width;

            videoScreenMediaElement.Height = panelTop.Height;
            videoScreenMediaElement.Width  = panelTop.Width;

            #endregion

            #region 加载各区域图片

            bool   result     = false;
            string strPicPath = string.Empty;

            string strTopFile = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("O2OTake_TopMv");
            m_TopFileType = PubHelper.p_BusinOper.VmFileOper.GetFileAdvertType(strTopFile);

            if (m_TopFileType == BusinessEnum.AdvertType.Image)
            {
                // 图片文件
                result = PubHelper.GetFormPubPic(strTopFile, out strPicPath);
                if (result)
                {
                    imgTop.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
                }
                videoScreenMediaElement.Visibility = System.Windows.Visibility.Hidden;
                imgTop.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                // 视频文件
                imgTop.Visibility = System.Windows.Visibility.Hidden;
                videoScreenMediaElement.Source = new Uri(AppDomain.CurrentDomain.BaseDirectory.ToString() + "Images\\FormPic\\pub\\" + strTopFile);
                // 临时测试
                videoScreenMediaElement.Position = TimeSpan.FromSeconds(5);
                videoScreenMediaElement.Play();
                videoScreenMediaElement.Visibility = System.Windows.Visibility.Visible;
            }

            result = PubHelper.GetFormPubPic("BarCode_TipBg.png", out strPicPath);
            if (result)
            {
                imgMiddele.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
            }
            result = PubHelper.GetFormPubPic("BarCode_Swip.png", out strPicPath);
            if (result)
            {
                imgSwipTip.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
            }
            result = PubHelper.GetFormPubPic(PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("O2OTake_BottomMv"), out strPicPath);
            if (result)
            {
                imgBottom.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
            }

            #endregion

            #region 加载字符资源

            btnCancel.Content    = PubHelper.p_LangOper.GetStringBundle("SellGoods_Button_Cancel");
            btnCancel.Visibility = System.Windows.Visibility.Hidden;

            m_CodeNum_Name = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("O2OTake_Name_CodeNum");

            #endregion

            #region 设置相关参数

            PubHelper.p_BusinOper.O2OServerOper.VmID      = PubHelper.p_BusinOper.ConfigInfo.VmId;
            PubHelper.p_BusinOper.O2OServerOper.ServerURL = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("O2OServerUrl");
            PubHelper.p_BusinOper.O2OServerOper.UserKey   = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("O2OServer_UserKey");

            GetCodeLen();

            #endregion

            #region 启动工作线程

            Thread TrdMainWork = new Thread(new ThreadStart(MainWorkTrd));
            TrdMainWork.IsBackground = true;
            TrdMainWork.Start();

            Thread TrdMonOutTime = new Thread(new ThreadStart(MonOutTimeTrd));
            TrdMonOutTime.IsBackground = true;
            TrdMonOutTime.Start();

            #endregion
        }
        private void InitForm()
        {
            #region 初始化界面

            tbTitle.Text           = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AddService_Title_WxTake");
            tbCfgTitle.Text        = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AddService_Cfg");
            tbSerName.Text         = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AddService_SerName");
            tbTipInfo_SerName.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AddService_SerName_Tip");
            tbWebUrl.Text          = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AddService_WebUrl");
            tbUserKey.Text         = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AddService_UserKey");

            btnSave.Content       = btnSaveTop.Content = btnSaveBottom.Content = PubHelper.p_LangOper.GetStringBundle("Pub_Btn_Save");
            btnCancel.Content     = PubHelper.p_LangOper.GetStringBundle("Pub_Btn_Cancel");
            btnBrowseTop.Content  = btnBrowseBottom.Content = PubHelper.p_LangOper.GetStringBundle("Pub_Btn_Browse");
            btnCodeConfig.Content = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AddService_CodeConfig");

            tbTopCfg.Text  = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AddService_Skin_Top");
            tbTop_Tip.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AddService_Tip_File_Top");

            tbBottomCfg.Text  = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AddService_Skin_Bottom");
            tbBottom_Tip.Text = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AddService_Tip_File_Bottom");

            rdbSwitch_Run.Content  = PubHelper.p_LangOper.GetStringBundle("Pub_Run");
            rdbSwitch_Stop.Content = PubHelper.p_LangOper.GetStringBundle("Pub_Stop");
            tbServerSwitch.Text    = PubHelper.p_LangOper.GetStringBundle("SysCfg_Menu_AddService_Switch");

            #endregion

            #region 加载参数

            tbSerName_Value.Text = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("WxTake_Name");
            tbWebUrl_Value.Text  = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("WxTake_ServerUrl");
            tbUserKey_Value.Text = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("WxTake_UserKey");

            if (PubHelper.p_BusinOper.ConfigInfo.WxTake_Switch == Business.Enum.BusinessEnum.ControlSwitch.Stop)
            {
                rdbSwitch_Stop.IsChecked = true;
                ControlSwitch(false);
            }
            else
            {
                rdbSwitch_Run.IsChecked = true;
                ControlSwitch(true);
            }

            // 头部文件
            string strTopFile = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("WxTake_TopMv");
            BusinessEnum.AdvertType strTopFileType = PubHelper.p_BusinOper.VmFileOper.GetFileAdvertType(strTopFile);
            bool   result     = false;
            string strPicPath = string.Empty;
            if (strTopFileType == BusinessEnum.AdvertType.Image)
            {
                // 图片文件
                result = PubHelper.GetFormPubPic(strTopFile, out strPicPath);
                if (result)
                {
                    imgTop.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
                }
                mediaElement1.Visibility = System.Windows.Visibility.Hidden;
                imgTop.Visibility        = System.Windows.Visibility.Visible;
            }
            else
            {
                // 视频文件
                imgTop.Visibility    = System.Windows.Visibility.Hidden;
                mediaElement1.Source = new Uri(AppDomain.CurrentDomain.BaseDirectory.ToString() + "Images\\FormPic\\pub\\" + strTopFile);
                // 临时测试
                mediaElement1.Position = TimeSpan.FromSeconds(5);
                mediaElement1.Play();
                mediaElement1.Visibility = System.Windows.Visibility.Visible;
            }

            result = PubHelper.GetFormPubPic(PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("WxTake_BottomMv"), out strPicPath);
            if (result)
            {
                imgBottom.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
            }

            #endregion

            m_IsInit = false;
        }
示例#7
0
        private void InitForm()
        {
            #region 计算各区域尺寸

            double scrHeight = SystemParameters.PrimaryScreenHeight;
            panelTop.Height      = scrHeight * 0.33;
            panelBottom.Height   = scrHeight * 0.1;
            panelMiddele.Height  = scrHeight * 0.57;
            panelMiddele.Margin  = new Thickness(0, panelTop.Height + 1, 0, 0);
            tbProgressInfo.Width = panelMiddele.Width;

            #endregion

            #region 加载各区域图片

            bool   result     = false;
            string strPicPath = string.Empty;

            string strTopFile = "ShZyZ_Top_Donate.png";
            m_TopFileType = PubHelper.p_BusinOper.VmFileOper.GetFileAdvertType(strTopFile);

            if (m_TopFileType == BusinessEnum.AdvertType.Image)
            {
                // 图片文件
                result = PubHelper.GetFormPubPic(strTopFile, out strPicPath);
                if (result)
                {
                    imgTop.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
                }

                imgTop.Visibility = System.Windows.Visibility.Visible;
            }

            string strTipBg = "ShZyZ_Donate_TipBg.png";
            if (PubHelper.p_ShZyZ_Donate_PayType == BusinessEnum.PayMent.AliPay_Code)
            {
                strTipBg = "ShZyZ_Donate_TipBg_AliPay.png";
            }
            result = PubHelper.GetFormPubPic(strTipBg, out strPicPath);
            if (result)
            {
                imgMiddele.Source = new BitmapImage(new Uri(strPicPath, UriKind.RelativeOrAbsolute));
            }

            #endregion

            #region 加载字符资源

            btnCancel.Content    = PubHelper.p_LangOper.GetStringBundle("SellGoods_Button_Cancel");
            btnCancel.Visibility = System.Windows.Visibility.Hidden;

            #endregion

            btnOK.IsEnabled = false;

            #region 设置相关参数

            PubHelper.p_BusinOper.O2OServerOper.VmID      = PubHelper.p_BusinOper.ConfigInfo.VmId;
            PubHelper.p_BusinOper.O2OServerOper.ServerURL = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("O2OServerUrl");
            PubHelper.p_BusinOper.O2OServerOper.UserKey   = PubHelper.p_BusinOper.SysCfgOper.GetSysCfgValue("O2OServer_UserKey");
            m_NowStep = "0";

            #endregion

            #region 启动工作线程

            switch (PubHelper.p_ShZyZ_Donate_PayType)
            {
            case BusinessEnum.PayMent.Cash:    // 现金支付方式
                m_DonType                        = "1";
                btnOK.Visibility                 = System.Windows.Visibility.Visible;
                sPanelMoneyNum.Visibility        = System.Windows.Visibility.Hidden;
                imgShZy_AliPay_QrCode.Visibility = System.Windows.Visibility.Hidden;
                Thread TrdMainWork_Cash = new Thread(new ThreadStart(MainWorkDonTrd_Cash));
                TrdMainWork_Cash.IsBackground = true;
                TrdMainWork_Cash.Start();
                break;

            case BusinessEnum.PayMent.AliPay_Code:    // 支付宝支付方式
                m_DonType                        = "2";
                btnOK.Visibility                 = System.Windows.Visibility.Hidden;
                btnCancel.Visibility             = System.Windows.Visibility.Visible;
                imgShZy_AliPay_QrCode.Visibility = System.Windows.Visibility.Visible;
                sPanelMoneyNum.Visibility        = System.Windows.Visibility.Hidden;
                tbPhone_Value.Visibility         = System.Windows.Visibility.Hidden;
                tbPhone_Title.Visibility         = System.Windows.Visibility.Hidden;
                tbTipInfo_SerName.Visibility     = System.Windows.Visibility.Hidden;
                tbMoney_Value.Visibility         = System.Windows.Visibility.Hidden;
                tbMoney_Title.Visibility         = System.Windows.Visibility.Hidden;
                tbProgressInfo.Foreground        = Brushes.Orange;
                tbProgressInfo.Text              = "请用支付宝“扫一扫”扫描二维码进行捐赠";
                ////Thread TrdMainWork_AliPay = new Thread(new ThreadStart(MainWorkDonTrd_AliPay));
                ////TrdMainWork_AliPay.IsBackground = true;
                ////TrdMainWork_AliPay.Start();
                // 开始超时监控
                BeginMonOutTime();
                break;
            }

            Thread TrdMonOutTime = new Thread(new ThreadStart(MonOutTimeTrd));
            TrdMonOutTime.IsBackground = true;
            TrdMonOutTime.Start();

            #endregion
        }