private void addButton_Click(object sender, EventArgs e)
 {
     StockCompanyEditForm nf = new StockCompanyEditForm();
     if (nf.ShowDialog(this) == DialogResult.OK)
     {
         getDatabase().editCompany(null, nf.info);
         Retrieve();
     }
 }
        private void editButton_Click(object sender, EventArgs e)
        {
            if (getCurrentKey() != null)
            {
                Database.StockCompanyInfo info = new Database.StockCompanyInfo();
                info.key = getCurrentKey();

                info.name = Convert.ToString(dataGridView.SelectedRows[0].Cells["NAME"].Value);
                info.stockAmount = Convert.ToUInt64(dataGridView.SelectedRows[0].Cells["STOCK"].Value);
                StockCompanyEditForm nf = new StockCompanyEditForm();
                nf.info = info;
                if (nf.ShowDialog(this) == DialogResult.OK)
                {
                    getDatabase().editCompany(getCurrentKey(), nf.info);
                    Retrieve();
                }
            }
        }