コード例 #1
0
 private void loadCTHDNH()
 {
     balChiTietNhap = new BALChiTietNhap();
     try
     {
         if (balChiTietNhap.LayChiTietNhapTheoMaDon(gridView1.GetRowCellValue(a, "MaDonNhap").ToString()).Tables[0].Rows.Count != 0)
         {
             this.gridCTHDNH.DataSource = balChiTietNhap.LayChiTietNhapTheoMaDon(gridView1.GetRowCellValue(a, "MaDonNhap").ToString()).Tables[0];
             //int rowSelected2 = gridView2.FocusedRowHandle;
             //txtSP.Text = gridView2.GetRowCellValue(rowSelected2, "MaSP").ToString();
             //txtSL.Text = gridView2.GetRowCellValue(rowSelected2, "DonGia").ToString();
             //txtSL.Text = gridView2.GetRowCellValue(rowSelected2, "SoLuong").ToString();
             //txtTT.Text = gridView2.GetRowCellValue(rowSelected2, "ThanhTien").ToString();
         }
     }
     catch (SqlException error)
     {
         MessageBox.Show("Không truy cập dữ liệu chi tiết hóa đơn nhập hàng được!\rLỗi: " + error.Message, "Lỗi SQL", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception er)
     {
         MessageBox.Show("Không truy cập dữ liệu chi tiết hóa đơn nhập hàng được!\rLỗi: " + er.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     //HienThiChucNangCTHD(true);
     //HienThiHanhDongCTHD(false);
 }
コード例 #2
0
 private void loadHoaDonNhap()
 {
     balChiTietNhap    = new BALChiTietNhap();
     balHoaDonNhapHang = new BAHoaDonNhapHang();
     try
     {
         if (balHoaDonNhapHang.LayListHoaDonNhapHang().Tables[0].Rows.Count != 0)
         {
             this.gridHDNhapHang.DataSource = balHoaDonNhapHang.LayListHoaDonNhapHang().Tables[0];
             int rowSelected2 = gridView3.FocusedRowHandle;
             txtMaHDNhap.Text                 = gridView3.GetRowCellValue(rowSelected2, "MaDonNhap").ToString();
             dtTGNhapHang.EditValue           = (DateTime)gridView3.GetRowCellValue(gridView3.FocusedRowHandle, "ThoiGianNhapHang");
             txtNCC.Text                      = gridView3.GetRowCellValue(rowSelected2, "NhaNCC").ToString();
             txtNguoiGiao.Text                = gridView3.GetRowCellValue(rowSelected2, "NguoiGiao").ToString();
             txtNVGS.Text                     = gridView3.GetRowCellValue(rowSelected2, "NhanVienGiamSat").ToString();
             txtThanhTien.Text                = gridView3.GetRowCellValue(rowSelected2, "TongTien").ToString();
             this.gridcTHDNhapHang.DataSource = balChiTietNhap.LayChiTietNhapTheoMaDon(txtMaHDNhap.Text).Tables[0];
         }
     }
     catch (SqlException error)
     {
         MessageBox.Show("Không truy cập dữ liệu chi tiết hóa đơn bán hàng được!\rLỗi: " + error.Message, "Lỗi SQL", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception er)
     {
         MessageBox.Show("Không truy cập dữ liệu chi tiết hóa đơn bán hàng được!\rLỗi: " + er.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     //HienThiChucNangCTHD(true);
     //HienThiHanhDongCTHD(false);
 }
コード例 #3
0
 public FromNhapHang()
 {
     InitializeComponent();
     //balHDNhapHang = new BAHoaDonNhapHang();
     balChiTietNhap = new BALChiTietNhap();
 }