public MainPanel() { InitializeComponent(); this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true); //timerShowMovie.Start(); Console.WriteLine("MainPanel_Load开始隐藏小键盘"); GlobalTools.HideAllKeyBoard(); GlobalTools.RegistUpdateUnOperationTime(null); GlobalTools.StopUnOperationCounter(); if (GlobalTools.loginUser == null) { this.lbWelcome1.Visible = false; this.lbWelcomeName.Visible = false; this.lbWelcome3.Visible = false; this.btnQuit.Visible = false; this.panelFlashCardHint.Visible = true; this.panelFlashCardHint.BringToFront(); this.timerReadCard.Start(); } else { this.panelFlashCardHint.Visible = false; this.timerReadCard.Stop(); // this.panelFlashCardHint.BringToFront(); this.lbWelcome1.Visible = true; this.lbWelcomeName.Visible = true; this.lbWelcomeName.Text = GlobalTools.loginUser.Name; this.lbWelcome3.Visible = true; this.btnQuit.Visible = true; this.lbWelcomeName.Location = new Point(this.lbWelcome3.Location.X - this.lbWelcomeName.Width, this.lbWelcome3.Location.Y); this.lbWelcome1.Location = new Point(this.lbWelcomeName.Location.X - this.lbWelcome1.Width, this.lbWelcome3.Location.Y); //FT.Commons.Tools.WinFormHelper.LocationAfter(this.lbWelcomeName, this.lbWelcome3); } GlobalTools.CloseAllPopForms(); try { if (this.DesignMode) { Cursor = Cursors.Default; } else { GlobalTools.SetCursor(); } } catch (Exception ex) { } }
private void adShowPanel1_MouseClick(object sender, MouseEventArgs e) { #if DEBUG Console.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "全屏广告进行了鼠标单击!"); #endif this.Hide(); GlobalTools.HideAllKeyBoard(); GlobalTools.MainForm.Activate(); MainPanel main = GlobalTools.MainForm.Controls[0] as MainPanel; if (main != null) { main.StartAdTimer(); } else { GlobalTools.ReturnMain(); } GlobalTools.MainForm.BringToFront(); }
public static DialogResult Pop(Control panel, int type) { GlobalTools.StopFullTimer(); ConfigModel.SystemConfig config = FT.Commons.Cache.StaticCacheManager.GetConfig <ConfigModel.SystemConfig>(); if (config.UseVirtualKeyboard) { #if DEBUG Console.WriteLine("Pop方法开始隐藏小键盘"); #endif GlobalTools.HideAllKeyBoard(); } if (config.UseMaskPanel) { return(PopMask(panel, type)); } else { return(PopUnMask(panel, type)); } }
/* * 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(); } } } }