private void btnCT_Click(object sender, RoutedEventArgs e) { var flag = 0; var windows = new ChiTietSanPham(); var db = new STOREEntities(); //windows.Sender(txtTen.Text.ToString()); //windows.Show(); foreach (var index in db.SanPhams) { if (index.TenSP.ToString().ToLower() == txtTen.Text.ToString()) { flag = 1; break; } } if (flag == 0) { MessageBox.Show("Không tìm thấy xin vui lòng thử lại"); } else { //windows.Sender(txtTen.Text.ToString()); windows.Show(); } }
private void lvSP_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (lvSP.SelectedItem == null) { return; } var windows = new ChiTietSanPham(lvSP.SelectedItem as SanPham); windows.Show(); }