Ejemplo n.º 1
0
 private void BtnRefresh_Click(object sender, RoutedEventArgs e)
 {
     isRefreshing              = true;
     dgvHangHoa.ItemsSource    = BUS_HangHoa.showData();
     cbTrangThai.SelectedIndex = 0;
     isRefreshing              = false;
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
 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();
         }
     }
 }
Ejemplo n.º 4
0
 public UI_HangHoa()
 {
     InitializeComponent();
     dgvHangHoa.ItemsSource = BUS_HangHoa.showData();
     loadCombobox();
 }
Ejemplo n.º 5
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     cbbTenHangHoa.ItemsSource = BUS_HangHoa.showData();
     DataContext = new TextFieldsViewModel();
 }