private void BtnRefresh_Click(object sender, RoutedEventArgs e) { isRefreshing = true; dgvHangHoa.ItemsSource = BUS_HangHoa.showData(); cbTrangThai.SelectedIndex = 0; isRefreshing = false; }
private void clearData() { generatePhieuBaoHanhID(); dpNgayLap.SelectedDate = DateTime.Today.AddDays(0); dpNgayGiao.SelectedDate = null; cbbTenHangHoa.ItemsSource = BUS_HangHoa.showData(); txtTenNhanVien.Text = Properties.Settings.Default.TenNhanVien; txtTenKhachHang.Clear(); txtSoDienThoai.Clear(); cbDaGiao.IsChecked = false; txtGhiChu.Clear(); txtTongTien.Clear(); }
private void btnDelete_Click(object sender, RoutedEventArgs e) { if (dgvHangHoa.SelectedItem != null) { DTO_HangHoa obj = new DTO_HangHoa(); obj = dgvHangHoa.SelectedItem as DTO_HangHoa; if (obj.TrangThai == true) { MessageBoxResult result = MessageBox.Show("Bạn muốn ngừng kinh doanh mặt hàng này?", "Confirmation", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { BUS_HangHoa.Delete(obj); dgvHangHoa.ItemsSource = BUS_HangHoa.showData(); } } else { BUS_HangHoa.Delete(obj); dgvHangHoa.ItemsSource = BUS_HangHoa.showData(); } } }
public UI_HangHoa() { InitializeComponent(); dgvHangHoa.ItemsSource = BUS_HangHoa.showData(); loadCombobox(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { cbbTenHangHoa.ItemsSource = BUS_HangHoa.showData(); DataContext = new TextFieldsViewModel(); }