Exemplo n.º 1
0
        /// <summary>
        /// 切换账户登录
        /// </summary>
        public void SwitchLogin()
        {
            MessageConfirm confirm = new MessageConfirm();

            confirm.Title   = "提示";
            confirm.Message = "是否切换客服账户?";
            bool result = false;

            confirm.CallBack += () =>
            {
                result = true;
            };
            confirm.ShowDialog(this);
            if (result)
            {
                if (wxlogin != null)
                {
                    if (wxlogin.isLoginCheck)
                    {
                        wxlogin.loginClose = true;
                    }
                    else
                    {
                        wxlogin.loginClose = false;
                    }
                    wxlogin.isLoginCheck   = false;
                    wxlogin.isCloseWinForm = true;
                    wxlogin.Close();
                    wxlogin = null;
                }

                loginForm.Show();
                this.Close();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 检查是否安装自动导购功能
 /// </summary>
 /// <returns>true if XXXX, false otherwise.</returns>
 private bool CheckAutoShopingGuideInstalled()
 {
     if (!isGuideInstall)
     {
         MessageConfirm confirm = new MessageConfirm("导购功能需要单独安装,马上安装?");
         confirm.CallBack += () =>
         {
             isGuideInstall = true;
         };
         confirm.ShowDialog(this);
     }
     if (isGuideInstall)
     {
         openControl(UserControlsOpts.autoShopingGuide);
     }
     return(isGuideInstall);
 }
Exemplo n.º 3
0
        /// <summary>
        /// 退出应用
        /// </summary>
        public void ApplicationClose()
        {
            MessageConfirm confirm = new MessageConfirm();

            confirm.Title   = "退出提示";
            confirm.Message = "确定要退出客服系统?";
            bool result = false;

            confirm.CallBack += () =>
            {
                result = true;
            };
            confirm.ShowDialog(this);
            if (result)
            {
                loginForm.Close();
            }
        }
Exemplo n.º 4
0
 public void AlertConfirm(string text, string title, Action <bool> callback)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action <string, string, Action <bool> >(AlertConfirm), new object[] { text, title, callback });
     }
     else
     {
         bool           isOk  = false;
         MessageConfirm alert = new MessageConfirm(text, title);
         alert.StartPosition = FormStartPosition.CenterScreen;
         alert.CallBack     += () =>
         {
             isOk = true;
         };
         alert.ShowDialog();
         callback?.Invoke(isOk);
     }
 }
Exemplo n.º 5
0
 private void ShowConfirm(VersionModel version)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action <VersionModel>(ShowConfirm), new object[] { version });
     }
     else
     {
         bool           isUpdate = false;
         MessageConfirm cfr      = new MessageConfirm("发现新版本,是否马上下载更新?");
         cfr.CallBack += () =>
         {
             isUpdate = true;
         };
         cfr.StartPosition = FormStartPosition.CenterScreen;
         cfr.ShowDialog();
         if (isUpdate)
         {
             Process.Start("CheckUpdate.exe");
             CloseMain();
         }
     }
 }
Exemplo n.º 6
0
        public void SwitchWeChatLogin()
        {
            MessageConfirm confirm = new MessageConfirm();

            confirm.Title   = "提示";
            confirm.Message = "是否切换微信账户?";
            bool result = false;

            confirm.CallBack += () =>
            {
                result = true;
            };
            confirm.ShowDialog(this);
            if (result)
            {
                if (wxlogin != null)
                {
                    if (wxlogin.isLoginCheck)
                    {
                        wxlogin.loginClose = true;
                    }
                    else
                    {
                        wxlogin.loginClose = false;
                    }
                    wxlogin.isLoginCheck   = false;
                    wxlogin.isCloseWinForm = true;
                    wxlogin.Close();
                    wxlogin = null;
                    //清除所有数据
                    listenForm.ClearAllData();
                    openControl(UserControlsOpts.filter);
                }
                OpenWx();
            }
        }