Exemple #1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            AirCompaniesEditForm newForm = new AirCompaniesEditForm();

            if (newForm.ShowDialog() == DialogResult.OK)
            {
                newForm.newAirсompany.InsertNewAircompany();
            }
            this.RefreshItems();
        }
Exemple #2
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            int airCompID = (int)aircompaniesListDataGridView.SelectedRows[0].Cells[0].Value;

            AirCompaniesEditForm newForm = new AirCompaniesEditForm();

            foreach (Aircompany aircompany in acList)
            {
                if (aircompany.AircompanyID == airCompID)
                {
                    newForm.newAirсompany = aircompany;
                    if (newForm.ShowDialog() == DialogResult.OK)
                    {
                        newForm.newAirсompany.UpdateAircompany();
                    }
                }
            }
            this.RefreshItems();
        }