private void btnBanHang_Click(object sender, EventArgs e) { UC_BanHang bh = new UC_BanHang(MaNhanvien); AddControl(bh); UC_LapHoaDon lapHoaDon = new UC_LapHoaDon(MaNhanvien); }
private void lbLapHoaDon_Click(object sender, EventArgs e) { UC_LapHoaDon lhd = new UC_LapHoaDon(manhanvien); pnCenter.Controls.Clear(); pnCenter.Controls.Add(lhd); }
private void btnlogin_Click(object sender, EventArgs e) { bool check = false; CuaHangDienTuEntities entities = new CuaHangDienTuEntities(); List <User> lst = entities.Users.ToList(); foreach (var u in lst) { if (Convert.ToString(u.TaiKhoan) == txtUsername.Text && u.MatKhau == txtPassword.Text) { Form1 frm = new Form1(Convert.ToInt64(txtUsername.Text), u.NhanVien.TenNV, u.NhanVien.ChucVu); frm.Show(); check = true; UC_LapHoaDon lhd = new UC_LapHoaDon(Convert.ToInt64(txtUsername.Text)); } } if (check == false) { MessageBox.Show("Tên đăng nhập hoặc mật khẩu không đúng!"); } }