public void tinhTongTien(List <CTHDNDTO> lst, TextBox txt) { int tong = 0; foreach (CTHDNDTO cth in lst) { tong += cth.ThanhTien1; } txt.Text = tong.ToString(); lblTongTienChu.Text = FormHandling.ChuyenSoSangChuoi(tong); }
private void dgvHDB_CellClick(object sender, DataGridViewCellEventArgs e) { try { DataGridViewRow row = new DataGridViewRow(); row = dgvHDB.Rows[e.RowIndex]; txtSoHDB.Text = row.Cells[0].Value.ToString(); cbxMaNV.SelectedValue = row.Cells[1].Value.ToString(); dtpNgayBan.Text = row.Cells[2].Value.ToString(); cbxMaKH.SelectedValue = row.Cells[3].Value.ToString(); txtTongTien.Text = row.Cells[4].Value.ToString(); lblTongTien.Text = FormHandling.ChuyenSoSangChuoi(double.Parse(row.Cells[4].Value.ToString())); } catch { } }