예제 #1
0
        private void supplierRecoverButton_Click(object sender, EventArgs e)
        {
            int count = 0;

            for (int i = supplierListDataGridView.Rows.Count - 1; i >= 0; i--)
            {
                bool recover = (bool)supplierListDataGridView.Rows[i].Cells["SelectedSupplierColumn"].Value;
                if (recover == true)
                {
                    sda.undelete((string)supplierListDataGridView.Rows[i].Cells["SupplierIDColumn"].Value, conn);
                    supplierListDataGridView.Rows.Remove(supplierListDataGridView.Rows[i]);
                    count++;
                }
            }


            if (count == 0)
                MessageBox.Show(rs.GetString("selectAccountMsg"), "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            else
            {
                if (supplierListDataGridView.Rows.Count > 0)
                {
                    supplierSelectAllButton.Enabled = true;
                    supplierDeselectAllButton.Enabled = true;
                    supplierRecoverButton.Enabled = true;
                    supplierPermanentlyDeleteButton.Enabled = true;
                }
                else
                {
                    supplierSelectAllButton.Enabled = false;
                    supplierDeselectAllButton.Enabled = false;
                    supplierRecoverButton.Enabled = false;
                    supplierPermanentlyDeleteButton.Enabled = false;
                }

                supplierListDataGridView.ClearSelection();

                MessageBox.Show(rs.GetString("deletedAccountRecoverMsg"));
            }
        }