private void addRoomButton_Click(object sender, EventArgs e) { string maPhong = cbMaPhong.SelectedValue.ToString(); string tenPhong = phongBLL.loadTenPhong(cbMaPhong.SelectedValue.ToString()); DateTime ngayThue = phongBLL.loadNgayThuePhong(cbMaPhong.SelectedValue.ToString()); DateTime ngayHienTai = DateTime.Now; double songayThue = (ngayHienTai.Date - ngayThue.Date).TotalDays; double donGia = phongBLL.loadDonGia(cbMaPhong.SelectedValue.ToString()); double phuThu = phongBLL.loadPhuThuNuocNgoai(cbMaPhong.SelectedValue.ToString()); double tiLePhuThu = phongBLL.loadTiLePhuThuNuocNgoai(cbMaPhong.SelectedValue.ToString()); double thanhTien = donGia * songayThue * phuThu * tiLePhuThu; string[] row = new string[] { (index + 1).ToString(), maPhong, tenPhong, ngayThue.ToString("yyyy-MM-dd"), songayThue.ToString(), donGia.ToString(), thanhTien.ToString() }; dgvDanhSachPhongThanhToan.Rows.Add(row); txtTongGiaTri.Text = (double.Parse(txtTongGiaTri.Text) + thanhTien).ToString(); index++; }