Ejemplo n.º 1
0
        private void FrmQLLanDuong_FormClosed(object sender, FormClosedEventArgs e)
        {
            var frmMain = new FrmQlHeThong();

            frmMain.Show();
            Hide();
        }
Ejemplo n.º 2
0
        private void btnHuy_Click(object sender, EventArgs e)
        {
            var frmMain = new FrmQlHeThong();

            frmMain.Show();
            Hide();
        }
Ejemplo n.º 3
0
        private void btnLogin_Click(object sender, System.EventArgs e)
        {
            string user    = tbUser.Text;
            string pass    = tbPassword.Text;
            var    isLogin = Login(user, pass);

            if (isLogin)
            {
                var mainForm = new FrmQlHeThong();
                Hide();
                mainForm.Show();
            }
        }
Ejemplo n.º 4
0
 private void Check()
 {
     try
     {
         string oldPass   = tbOldPass.Text;
         string newPass   = tbNewPass.Text;
         string reNewPass = tbRePass.Text;
         var    us        = (from u in _db.Users where u.ID.Equals(LoginInfo.UserId) select u).FirstOrDefault();
         if (us != null && us.Password.Equals(oldPass))
         {
             if (newPass.Equals(reNewPass))
             {
                 var id   = LoginInfo.UserId;
                 var user = _db.Users.Find(id);
                 if (user == null)
                 {
                     return;
                 }
                 user.Password = newPass;
                 _db.SaveChanges();
                 MessageBox.Show(@"Change success", @"Infomation", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 var frmMain = new FrmQlHeThong();
                 frmMain.Show();
                 Hide();
             }
             else
             {
                 MessageBox.Show(@"Don't match", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
             MessageBox.Show(@"Don't match", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
     }
 }
Ejemplo n.º 5
0
        private void FrmDoiMatKhau_FormClosed(object sender, FormClosedEventArgs e)
        {
            var frmMain = new FrmQlHeThong();

            frmMain.Show();
        }