private void dtgvTuaNgay_RowEnter(object sender, DataGridViewCellEventArgs e) { try { int rowIndex = e.RowIndex; int result = 0; QLThemDichVuBUS _DichVu = new QLThemDichVuBUS(); if (_DichVu.IsNumber(dtgvTuaNgay["clSTT", rowIndex].Value.ToString(), ref result)) { rowEnterIndex = int.Parse(dtgvTuaNgay["clSTT", rowIndex].Value.ToString()); } }catch { } }
public void LoadDataThemDL() { QLDichVuBUS _Service = new QLDichVuBUS(); QLThemDichVuBUS _DichVu = new QLThemDichVuBUS(); string strTien = ""; strTien = cmbTenDV.SelectedValue.ToString(); int giamGia = int.Parse(nmdGiamGia.Value.ToString()); int intTien = 0; if (_DichVu.IsNumber(strTien, ref intTien) == true) { if (giamGia != 0) { if (rdbtnCertificat.Checked == true) { txbCertificat.Text = (intTien / 100 * (100 - giamGia)).ToString(); txbTienMat.Text = 0.ToString(); } else { txbTienMat.Text = (intTien / 100 * (100 - giamGia)).ToString(); txbCertificat.Text = 0.ToString(); } } else { if (rdbtnCertificat.Checked == true) { txbCertificat.Text = intTien.ToString(); txbTienMat.Text = 0.ToString(); } else { txbTienMat.Text = intTien.ToString(); txbCertificat.Text = 0.ToString(); } } } else { txbTienMat.Text = 0.ToString(); txbCertificat.Text = 0.ToString(); } }