コード例 #1
0
 private void buttonThanhToanNhapHang_Click(object sender, EventArgs e)
 {
     if (maskedTextBoxMaPhieuNhap.Text.Length == 0)
     {
         MessageBox.Show("Chưa tạo phiếu nhập");
     }
     else
     {
         for (int i = 0; i < dataGridViewThongTinHoaDonNhapHang.Rows.Count - 1; i++)
         {
             ChiTietNhapHang a = new ChiTietNhapHang(int.Parse(maskedTextBoxMaPhieuNhap.Text), int.Parse(dataGridViewThongTinHoaDonNhapHang.Rows[i].Cells[0].Value.ToString()), int.Parse(dataGridViewThongTinHoaDonNhapHang.Rows[i].Cells[1].Value.ToString()), int.Parse(dataGridViewThongTinHoaDonNhapHang.Rows[i].Cells[2].Value.ToString()), int.Parse(dataGridViewThongTinHoaDonNhapHang.Rows[i].Cells[3].Value.ToString()));
             ctnh.Add(a);
             hh.CapNhatThemSoLuong(int.Parse(dataGridViewThongTinHoaDonNhapHang.Rows[i].Cells[0].Value.ToString()), int.Parse(dataGridViewThongTinHoaDonNhapHang.Rows[i].Cells[1].Value.ToString()));
         }
     }
 }