Example #1
0
        private void bunifuButton1_Click(object sender, EventArgs e)
        {
            PrevHome prevHome = new PrevHome();

            this.Hide();
            prevHome.ShowDialog();
            this.Close();
        }
        private void bunifuButton11_Click(object sender, EventArgs e)
        {
            //MessageBox.Show(j.ActionName);
            PrevHome home = new PrevHome();

            this.Hide();
            home.ShowDialog();
            this.Close();
        }
Example #3
0
        private void btnRegister_Click_1(object sender, EventArgs e)
        {
            String hash = Encryption.Crypt(txPass.Text);

            if (hash.Length > 100)
            {
                hash = hash.Substring(0, 99);
            }

            tea01Entities2 db   = new tea01Entities2();
            var            user = db.Staffs.Find(txUserName.Text);


            if (tickRemember.Checked)
            {
                Properties.Settings.Default.UserName   = this.txUserName.Text;
                Properties.Settings.Default.PassWord   = this.txPass.Text;
                Properties.Settings.Default.RememberMe = "true";
                Properties.Settings.Default.Save();
            }
            else
            {
                Properties.Settings.Default.UserName   = this.txUserName.Text;
                Properties.Settings.Default.PassWord   = "";
                Properties.Settings.Default.RememberMe = "false";
                Properties.Settings.Default.Save();
            }

            if (user == null || !user.Password.Equals(hash))
            {
                MessageBox.Show("Tên tài khoản hoặc mật khẩu không đúng");
            }
            else
            {
                username = txUserName.Text;
                PrevHome prevHome = new PrevHome();
                this.Hide();
                prevHome.ShowDialog();
                this.Close();
            }
        }