private void button1_Click(object sender, EventArgs e) { NguoiDung s = QLNV_BLL.Instance.GetUserByUsername(txtUser.Text); if (s != null) { FormForgotPW2 f = new FormForgotPW2(s); this.Visible = false; f.ShowDialog(); this.Visible = true; } else { MessageBox.Show("Unknown user"); } }
private void button1_Click(object sender, EventArgs e) { DHP_07Entities db = new DHP_07Entities(); var l1 = db.NguoiDungs .Where(p => p.Username == txtUser.Text) .Select(p => p).ToList(); if (l1.Count != 0) { FormForgotPW2 f = new FormForgotPW2(l1[0]); f.ShowDialog(); } else { MessageBox.Show("Unknown user"); } }