Example #1
0
        private void clearCTPN()
        {
            generateChiTietPhieuNhapID();
            cbbTenHangHoa.Text = "";
            txtSoLuong.Clear();
            txtGiaNhap.Clear();

            dgvChiTietPhieuNhap.ItemsSource = BUS_ChiTietPhieuNhap.showDataByPhieuNhap(item.MaPhieuNhap);
        }
Example #2
0
 private void checkGroupCTPN(bool isNew, DTO_PhieuNhap phieunhap)
 {
     if (isNew)
     {
         groupCTPN.IsEnabled = false;
     }
     else
     {
         groupCTPN.IsEnabled = true;
         generateChiTietPhieuNhapID();
         loadCombobox();
         dgvChiTietPhieuNhap.ItemsSource = BUS_ChiTietPhieuNhap.showDataByPhieuNhap(phieunhap.MaPhieuNhap);
     }
 }
Example #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 (dgvChiTietPhieuNhap.SelectedItem != null)
                {
                    DTO_ChiTietPhieuNhap obj = dgvChiTietPhieuNhap.SelectedItem as DTO_ChiTietPhieuNhap;
                    String id = obj.MaChiTietPhieuNhap;

                    BUS_ChiTietPhieuNhap.Delete(id);
                    dgvChiTietPhieuNhap.ItemsSource = BUS_ChiTietPhieuNhap.showDataByPhieuNhap(item.MaPhieuNhap);
                    calTongTien(true, obj.ThanhTien);
                    calSoLuongNhap(true);
                }
            }
        }