Пример #1
0
 public UI_PhieuNhap(Grid gridMain)
 {
     InitializeComponent();
     this.gridMain = gridMain;
     dgvStockImport.ItemsSource = BUS_PhieuNhap.showData();
     dpFromPC.SelectedDate      = DateTime.Today.AddDays(0);
     dpToPC.SelectedDate        = DateTime.Today.AddDays(0);
 }
Пример #2
0
 private void btnRefresh_Click(object sender, RoutedEventArgs e)
 {
     isRefreshing = true;
     txtSearch.Clear();
     dpFromPC.SelectedDate      = DateTime.Today.AddDays(0);
     dpToPC.SelectedDate        = DateTime.Today.AddDays(0);
     dgvStockImport.ItemsSource = BUS_PhieuNhap.showData();
     isRefreshing = false;
 }
Пример #3
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Bạn có muốn xóa dòng này?", "Confirmation", MessageBoxButton.YesNo);

            if (result == MessageBoxResult.Yes)
            {
                if (dgvStockImport.SelectedItem != null)
                {
                    DTO_PhieuNhap obj = new DTO_PhieuNhap();
                    obj = dgvStockImport.SelectedItem as DTO_PhieuNhap;
                    String id = obj.MaPhieuNhap;

                    BUS_PhieuNhap.Delete(id);
                    dgvStockImport.ItemsSource = BUS_PhieuNhap.showData();
                }
            }
        }
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Bạn có muốn xóa dòng này?", "Confirmation", MessageBoxButton.YesNo);

            if (result == MessageBoxResult.Yes)
            {
                if (dgvPhieuDatHang.SelectedItem != null)
                {
                    DTO_PhieuDatHang obj = new DTO_PhieuDatHang();
                    obj = dgvPhieuDatHang.SelectedItem as DTO_PhieuDatHang;
                    String id = obj.MaPhieuDatHang;

                    if (BUS_PhieuDatHang.Instance.Delete(id))
                    {
                        dgvPhieuDatHang.ItemsSource = BUS_PhieuNhap.showData();
                    }
                    else
                    {
                        MessageBox.Show("Xóa không thành công!!");
                    }
                }
            }
        }