public void setNameSV(InfoSV sv) { lb_hoten.Text = sv.hoten; lb_sothe.Text = sv.sothe.ToString(); lb_ngaysinh.Text = sv.ngaysinh.ToString(); lb_lopsh.Text = sv.lopsh; }
public InfoSV getInfo(string mssv) { InfoSV sv = new InfoSV(); var c = db.SinhViens.Where(p => p.SoThe.ToString() == mssv).Select(p => new { p.HoTen, p.SoThe, p.NgaySinh, p.LopSH }); foreach (var i in c) { sv.sothe = i.SoThe; sv.hoten = i.HoTen; sv.ngaysinh = i.NgaySinh; sv.lopsh = i.LopSH; } return(sv); }
private void bt_dangnhap_Click(object sender, EventArgs e) { string mssv = tb_mssv.Text; string pass = bll.getPass(mssv); InfoSV sv = bll.getInfoSV(mssv); if ((tb_matkhau.Text.Trim()) == pass) { Form1 f1 = new Form1(); Mydelegate del = new Mydelegate(f1.setNameSV); del(sv); f1.Show(); this.Hide(); } else { MessageBox.Show("Tên đăng nhập hoặc mật khẩu sai"); } }