Ejemplo n.º 1
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (allowLogin)
     {
         try
         {
             if (GlobalTools.LoginAccount(this.txtUserName.Text, this.txtPwd.Text))
             {
                 if (loginSuccessType == 0)
                 {
                     this.QuitReadCard();
                     GlobalTools.ReturnUserAccout();
                 }
                 else if (loginSuccessType == 1)
                 {
                     this.QuitReadCard();
                     GlobalTools.QuickBuyTicket();
                 }
             }
             else
             {
                 GlobalTools.Pop(new UIdOrPwdErrorPanel());
             }
         }
         catch (Exception ex)
         {
             GlobalTools.Log(ex);
             GlobalTools.PopNetError();
         }
     }
 }
Ejemplo n.º 2
0
 private void btnPrint_Click_1(object sender, EventArgs e)
 {
     if (allowPrint)
     {
         GlobalTools.Pop(new WaitValidPanel(this.txtMobile.Text, this.txtValidCode.Text));
     }
 }
Ejemplo n.º 3
0
 public void LoginWithMember(string memberCard)
 {
     try
     {
         if (GlobalTools.LoginAccount(this.txtUserName.Text))
         {
             if (loginSuccessType == 0)
             {
                 this.QuitReadCard();
                 GlobalTools.ReturnUserAccout();
             }
             else if (loginSuccessType == 1)
             {
                 this.QuitReadCard();
                 GlobalTools.QuickBuyTicket();
             }
         }
         else
         {
             GlobalTools.Pop(new UIdOrPwdErrorPanel());
         }
     }
     catch (Exception ex)
     {
         GlobalTools.Log(ex);
         GlobalTools.PopNetError();
     }
 }
Ejemplo n.º 4
0
        public static bool PrintTickets(ArrayList lists)
        {
#if DEBUG
            // MessageBox.Show("准备打印的影票个数为:"+lists.Count.ToString());
#endif
            if (lists != null)
            {
                // MyOpaqueLayerTools.ShowOpaqueLayer(this.panelHeader, 60, true);
                if (!GlobalHardwareTools.OpenHotPrinter())
                {
                    GlobalTools.Pop("打印机打开错误,请检查!");
                    return(false);
                }
                else
                {
                    for (int i = 0; i < lists.Count; i++)
                    {
#if DEBUG
                        //   MessageBox.Show("正在打印第"+i+"个影票");
#endif
                        if (lists[i] is TicketPrintObject)
                        {
                            GlobalHardwareTools.PrintTicket(lists[i] as TicketPrintObject);
                        }
                        else
                        {
                            GlobalHardwareTools.PrintSellProduct(lists[i] as SellProductPrinter);
                        }
                    }
                    GlobalHardwareTools.CloseHotPrinter();
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 快速购票
        /// </summary>

        public static void QuickBuyTicket()
        {
            //GlobalTools.GetLoginUser().IsBindMobile = false;
            if (!GlobalTools.GetLoginUser().IsBindMobile)
            {
                if (GlobalTools.Pop(new NotifyBindMobilePanel()) == DialogResult.OK)
                {
                    // GoPanel(new MovieSelectorPanel());
                }
            }
            else
            {
                GoPanel(new MovieSelectorPanel());
            }

            //InitUnOperationControl(parent.Controls[0]);
        }
Ejemplo n.º 6
0
        /*
         * protected override bool ProcessDialogKey(Keys keyData)
         * {
         *  if (keyData == Keys.Enter)
         *  {
         *      //Cursor.Current = Cursors.Default;
         *      // Cursor.Show();
         *      this.btnAgreeAndRegister_Click(null, null);
         *      //this.Close();
         *     // return true;
         *  }
         *  return false;
         * }
         */
        // private

        private void btnAgreeAndRegister_Click(object sender, EventArgs e)
        {
            // this.txtPassword.UnFocus();
            //  this.txtRepeatPwd.UnFocus();
            //  this.txtMobile.UnFocus();
            //  this.txtUserName.UnFocus();
            // GlobalTools.Pop(new UserRegister.UserRegisterSuccessPanel());
            // GlobalTools.PopNetError();
            //  return;
            if (allowRegister)
            {
#if DEBUG
                Console.WriteLine("点击注册按钮开始隐藏小键盘");
#endif
                GlobalTools.HideAllKeyBoard();
                string name      = this.txtUserName.Text.Trim();
                string pwd       = this.txtPassword.Text.Trim();
                string repeatPwd = this.txtRepeatPwd.Text.Trim();
                string mobile    = this.txtMobile.Text.Trim();
                bool   result    = true;
                this.lbMobileHint.Text = this.lbPasswordHint.Text = this.lbRepeatPwdHint.Text = this.lbUserNameHint.Text = string.Empty;

                if (!ValidatorHelper.ValidateMobile(mobile, false))
                {
                    this.lbMobileHint.Text     = "手机号输入错误";
                    this.picMobileHint.Visible = true;
                    this.picMobileHint.Image   = Properties.Resources.Error;

                    this.txtPassword.UnFocus();
                    this.txtRepeatPwd.UnFocus();
                    this.txtUserName.UnFocus();
                    this.txtMobile.Focus();
                    result = false;
                    // return;
                }
                else
                {
                    this.lbMobileHint.Text   = string.Empty;
                    this.picMobileHint.Image = Properties.Resources.Right;
                }

                /*
                 * if (!HiPiaoOperatorFactory.GetHiPiaoOperator().CheckUserName(name))
                 * {
                 *  this.lbUserNameHint.Text = "你输入的用户名已经存在,请重新输入";
                 *  this.picUserNameHint.Visible = true;
                 *  this.picUserNameHint.Image = Properties.Resources.Error;
                 *  this.txtUserName.Text = string.Empty;
                 *  result = false;
                 *
                 * }
                 * else
                 * {
                 *  this.lbUserNameHint.Text = string.Empty;
                 *  this.picUserNameHint.Image = Properties.Resources.Right;
                 * }
                 * */

                if (!ValidatorHelper.ValidatePostCode(pwd, false))
                {
                    this.lbPasswordHint.Text     = "密码只允许6位数字";
                    this.picPasswordHint.Visible = true;
                    this.picPasswordHint.Image   = Properties.Resources.Error;

                    this.txtMobile.UnFocus();
                    this.txtRepeatPwd.UnFocus();
                    this.txtUserName.UnFocus();
                    this.txtPassword.Focus();
                    result = false;
                    return;
                }
                else
                {
                    this.lbPasswordHint.Text   = string.Empty;
                    this.picPasswordHint.Image = Properties.Resources.Right;
                }

                if (pwd != repeatPwd)
                {
                    this.lbRepeatPwdHint.Text     = "两次输入的密码不一致,请重新输入";
                    this.picRepeatPwdHint.Visible = true;
                    this.picRepeatPwdHint.Image   = Properties.Resources.Error;
                    this.txtPassword.Text         = this.txtRepeatPwd.Text = string.Empty;

                    this.txtMobile.UnFocus();
                    this.txtRepeatPwd.UnFocus();
                    this.txtUserName.UnFocus();
                    this.txtPassword.Focus();
                    result = false;
                    return;
                }
                else
                {
                    this.lbRepeatPwdHint.Text   = string.Empty;
                    this.picRepeatPwdHint.Image = Properties.Resources.Right;
                }


                /*
                 * else if (!HiPiaoOperatorFactory.GetHiPiaoOperator().CheckMobile(mobile))
                 * {
                 * this.lbMobileHint.Text = "您输入的手机号已经被注册";
                 * this.picMobileHint.Visible = true;
                 * this.picMobileHint.Image = Properties.Resources.Error;
                 * this.txtMobile.Text = string.Empty;
                 * result = false;
                 * }
                 * else
                 * {
                 * this.lbMobileHint.Text = string.Empty;
                 * this.picMobileHint.Image = Properties.Resources.Right;
                 * }
                 * */
                if (result)
                {
                    string retcode = "0";
                    try
                    {
                        UserObject user = HiPiaoOperatorFactory.GetHiPiaoOperator().Register(name, pwd, mobile, ref retcode);
                        if (user != null)
                        {
                            GlobalTools.loginUser = user;
                            this.txtPassword.UnFocus();
                            this.txtRepeatPwd.UnFocus();
                            this.txtMobile.UnFocus();
                            this.txtUserName.UnFocus();
                            GlobalTools.Pop(new UserRegister.UserRegisterSuccessPanel());
                        }
                        else if (retcode == "2")
                        {
                            this.lbUserNameHint.Text     = "你输入的用户名已经存在或者无效,请重新输入";
                            this.picUserNameHint.Visible = true;
                            this.picUserNameHint.Image   = Properties.Resources.Error;
                            this.txtUserName.Text        = string.Empty;
                            this.txtPassword.UnFocus();
                            this.txtRepeatPwd.UnFocus();
                            this.txtMobile.UnFocus();
                            this.txtUserName.Focus();
                        }
                        else
                        {
                            GlobalTools.PopNetError();
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobalTools.PopNetError();
                    }
                }
            }
        }
Ejemplo n.º 7
0
 private void btnViewProtocol_Click(object sender, EventArgs e)
 {
     GlobalTools.Pop(new UserNeedKnowInfoPanel());
 }
Ejemplo n.º 8
0
        /*
         * public static void PopFirstWpf(System.Windows.Controls.UserControl panel)
         * {
         *  NotifyUserForm form = new NotifyUserForm(panel);
         *
         *  form.ColorType = 2;
         *  form.ShowDialog();
         *
         * }
         * */

        public static void PopNetError()
        {
            GlobalTools.Pop("网络故障,请向影院工作人员垂询!", "或拨打400-601-5566");
        }