public void removeInvoice(int indexOfGrid) { DataTable table = invoiceView.getDataTable(); string code = table.Rows[indexOfGrid]["INVOICE_CODE"] + ""; if (code != null && !code.Equals("")) { if (model.deleteInvoice(code)) { //delete in grid table.Rows.RemoveAt(indexOfGrid); } else { invoiceView.showMessageBox(Resources.MB_FAILURE, System.Windows.Forms.MessageBoxIcon.Information); } } else { invoiceView.showMessageBox(Resources.MB_FAILURE + ": mã hóa đơn rỗng.", System.Windows.Forms.MessageBoxIcon.Error); } }