Esempio n. 1
0
 public void closingFormHome()
 {
     this.Invoke(new MethodInvoker(delegate
     {
         Logger.LogDebugFile("Set null and logout delegate");
         GlobalSystem.isLogout     = 1;
         GlobalSystem.islogin      = 0;
         GlobalSystem.user         = null;
         GlobalSystem.timeGameUser = null;
         Slide2 frm = new Slide2();
         this.Hide();
         frm.ShowDialog(this);
         this.Close();
     }));
     return;
 }
Esempio n. 2
0
        private void btnchangepass_Click(object sender, EventArgs e)
        {
            try
            {
                string pass        = txtpass.Text;
                string passComfirm = txtComfirmPass.Text;
                if (string.IsNullOrEmpty(pass) || string.IsNullOrEmpty(passComfirm))
                {
                    MessageBox.Show("Phải nhập mật khẩu khóa máy");
                    return;
                }
                if (!passComfirm.Equals(pass))
                {
                    MessageBox.Show("Mật khẩu nhập lại không trùng với mật khẩu trên");
                    return;
                }

                GlobalSystem.user.pass_lock_computer = pass;
                GlobalSystem.islogin = 1;
                // an cac form truoc
                for (int i = Application.OpenForms.Count - 1; i >= 0; i += -1)
                {
                    if (!object.ReferenceEquals(Application.OpenForms[i], this))
                    {
                        Application.OpenForms[i].Hide();
                    }
                }
                this.Hide();
                Slide2 frm = new Slide2();
                frm.ShowDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Lỗi hệ thống!");
                Logger.LogThisLine("Lỗi hệ thống!: " + ex.Message);
                this.Close();
            }
        }