private void systemsDataGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            if (MessageBox.Show("Do you want to delete System with Serial Number \"" + e.Row.Cells[3].Value + "\"?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) ==
                DialogResult.Yes)
            {
                var serial = (string)e.Row.Cells[3].Value;
                systemsTableAdapter.DeleteBySystemSerial(serial);

                var unitParts = new SystemsInventoryDataSetTableAdapters.UnitPartsTableAdapter();
                var movementRecords = new SystemsInventoryDataSetTableAdapters.MovementRecordsTableAdapter();
                var itemPurchaseOrders = new SystemsInventoryDataSetTableAdapters.ItemPurchaseOrdersTableAdapter();

                unitParts.DeleteBySystemSerial(serial);
                movementRecords.DeleteBySystemSerial(serial);
                itemPurchaseOrders.DeleteBySystemSerial(serial);

                return;
            }

            e.Cancel = true;
        }
        private void button3_Click(object sender, EventArgs e)
        {
            if (m_AddMode)
            {
                if (String.IsNullOrEmpty(serialTextBox.Text)) return;
                if (MessageBox.Show("Are you sure you want to cancel?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) ==
                DialogResult.Yes)
                {
                    var unitParts = new SystemsInventoryDataSetTableAdapters.UnitPartsTableAdapter();
                    var movementRecords = new SystemsInventoryDataSetTableAdapters.MovementRecordsTableAdapter();
                    var itemPurchaseOrders = new SystemsInventoryDataSetTableAdapters.ItemPurchaseOrdersTableAdapter();

                    unitParts.DeleteBySystemSerial(serialTextBox.Text);
                    movementRecords.DeleteBySystemSerial(serialTextBox.Text);
                    itemPurchaseOrders.DeleteBySystemSerial(serialTextBox.Text);

                    systemsBindingSource.CancelEdit();
                    systemsBindingSource.AddNew();
                }
                return;
            }
            Service.Instance.ActivePage = new ListInventory();
        }