private void load() { BO_DangNhap dangnhap = new BO_DangNhap(); DTO_KhachHang khachhang = new DTO_KhachHang(); khachhang.SDT = sdt; DataSet result = new DataSet(); result = dangnhap.KT_SDT(khachhang, ref tenkh); lb_Ten.Text = tenkh; DTO_HoaDon hoadon = new DTO_HoaDon(); hoadon.MaHD = mahd; BO_ChiTietPhong hienthi = new BO_ChiTietPhong(); DataSet table = hienthi.HienThi(hoadon); if (table.Tables.Count > 0 && table != null) { dgvHienThi.DataSource = table.Tables[0]; } total = 0; if (dgvHienThi.Rows.Count != 0) { for (int i = 0; i < dgvHienThi.Rows.Count - 1; i++) { total += int.Parse(dgvHienThi.Rows[i].Cells["ThanhTien"].Value.ToString()); } } txtTong.Text = total.ToString(); txtTenphong.Text = tenphong; }
public void HienThi() { DTO_HoaDon hoadon = new DTO_HoaDon(); hoadon.MaHD = mahd; BO_ChiTietPhong hienthi = new BO_ChiTietPhong(); DataSet table = hienthi.HienThi(hoadon); if (table.Tables.Count > 0 && table != null) { dgvHienThi.DataSource = table.Tables[0]; } total = 0; if (dgvHienThi.Rows.Count != 0) { for (int i = 0; i < dgvHienThi.Rows.Count - 1; i++) { total += int.Parse(dgvHienThi.Rows[i].Cells["ThanhTien"].Value.ToString()); } } txtTong.Text = total.ToString(); }