Beispiel #1
0
        private void xóaLịchSửGiaoDịchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult dlg = MessageBox.Show("Bạn muốn xóa lịch sử giao dịch này?", "Xóa hội viên", MessageBoxButtons.YesNo);

            if (dlg == DialogResult.Yes)
            {
                int currentRowIndex = dtgv_PaymentHistory.CurrentCellAddress.Y;// 'current row selected
                if (-1 < currentRowIndex && currentRowIndex < dtgv_PaymentHistory.RowCount)
                {
                    hoiVien  data    = new hoiVien();
                    string   mahv    = data.GetIDfromName(dtgv_PaymentHistory.Rows[currentRowIndex].Cells["HoiVien"].Value.ToString());
                    DateTime payDate = Convert.ToDateTime(dtgv_PaymentHistory.Rows[currentRowIndex].Cells["dateOfPay"].Value.ToString());
                    data.DeletePayment(mahv, payDate);
                    log.Insert("Thực hiện xóa lịch sử thanh toán của hội viên " + mahv);
                    retrieveInfo();
                }
            }
        }