void ReleaseDesignerOutlets()
        {
            if (AddItem != null)
            {
                AddItem.Dispose();
                AddItem = null;
            }

            if (Settings != null)
            {
                Settings.Dispose();
                Settings = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AddItem != null)
            {
                AddItem.Dispose();
                AddItem = null;
            }

            if (contactsTableView != null)
            {
                contactsTableView.Dispose();
                contactsTableView = null;
            }
        }
        private void button1_Click(object sender, System.EventArgs e)
        {
            AddItem      newForm = new AddItem();
            DialogResult addItem = newForm.ShowDialog();

            if (addItem == DialogResult.OK)
            {
                string       name      = newForm.returnItem.getName();
                string       type      = newForm.returnItem.getType();
                string       author    = newForm.returnItem.getAuthor();
                string       publisher = newForm.returnItem.getSource();
                int          stock     = newForm.returnItem.getStock();
                bool         isFile    = newForm.returnItem.isDigital();
                DateTime     date      = newForm.returnItem.getReleaseDate();
                MaterialInfo newItem   = new MaterialInfo(name, author, publisher, date, stock, type, isFile, newForm.returnItem.GetType().ToString());
                this.currentMaterialList.Add(newItem);
                this.libraryManager.addMaterial(newForm.returnItem);
                addRow(newItem);
                dataGridView1.Update();
                dataGridView1.Refresh();
            }
            newForm.Dispose();
            return;
        }
Beispiel #4
0
        private void addSaleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (_LedgerReports != null && !_LedgerReports.IsDisposed)
                {
                    _LedgerReports.Dispose();
                }
                if (_LedgerStatement != null && !_LedgerStatement.IsDisposed)
                {
                    _LedgerStatement.Dispose();
                }
                if (_ListConsignmentDetails != null && !_ListConsignmentDetails.IsDisposed)
                {
                    _ListConsignmentDetails.Dispose();
                }
                if (_ListConsignments != null && !_ListConsignments.IsDisposed)
                {
                    _ListConsignments.Dispose();
                }
                if (_ListCustomers != null && !_ListCustomers.IsDisposed)
                {
                    _ListCustomers.Dispose();
                }
                if (_ListInventory != null && !_ListInventory.IsDisposed)
                {
                    _ListInventory.Dispose();
                }
                if (_AddConsignmentAdvanced != null && !_AddConsignmentAdvanced.IsDisposed)
                {
                    _AddConsignmentAdvanced.Dispose();
                }
                if (_AddCustomer != null && !_AddCustomer.IsDisposed)
                {
                    _AddCustomer.Dispose();
                }
                if (_AddItems != null && !_AddItems.IsDisposed)
                {
                    _AddItems.Dispose();
                }
                if (_DebitorSummary != null && !_DebitorSummary.IsDisposed)
                {
                    _DebitorSummary.Dispose();
                }
                if (_DeleteBill != null && !_DeleteBill.IsDisposed)
                {
                    _DeleteBill.Dispose();
                }
                if (_ItemHistoryReport != null && !_ItemHistoryReport.IsDisposed)
                {
                    _ItemHistoryReport.Dispose();
                }


                if (_AddBill.IsDisposed)
                {
                    _AddBill = new AddBill();
                }

                Home.Home_pnl.Visible = false;

                _AddBill.MdiParent   = this;
                _AddBill.WindowState = FormWindowState.Maximized;
                _AddBill.Show();
                _AddBill.Focus();
            }
            catch (Exception ex)
            {
                notifyIcon1.ShowBalloonTip(1000, this.Name, ex.Message, ToolTipIcon.Info);;
            }
        }
 protected override void OnDisappearing()
 {
     base.OnDisappearing();
     ListView.ItemSelected -= FolderSelected;
     AddItem?.Dispose();
 }