コード例 #1
0
        private void btn_modify_Click(object sender, EventArgs e)
        {
            ListViewItem item = new ListViewItem();

            if (this.lv_Main.SelectedItems.Count > 0)
            {
                item = this.lv_Main.SelectedItems[0];
            }

            switch (this.category)
            {
            case "flights":
                AddFlightForm addFlight = new AddFlightForm(Int32.Parse(item.SubItems[0].Text));
                addFlight.ShowDialog();
                this.ReloadListView();
                break;

            case "airplanes":
                AddModifyAirplane plane = new AddModifyAirplane(Int32.Parse(item.SubItems[3].Text));
                plane.ShowDialog();
                this.ReloadListView();
                break;

            case "airlines":
                Add_ModifyAirline line = new Add_ModifyAirline(Int32.Parse(item.SubItems[5].Text));
                line.ShowDialog();
                this.ReloadListView();
                break;
            }
        }
コード例 #2
0
        private void editToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Add_ModifyAirline form2 = new Add_ModifyAirline(this.id);

            form2.ShowDialog();
            this.ReloadListView();
        }
コード例 #3
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            switch (this.category)
            {
            case "flights":
                AddFlightForm addFlight = new AddFlightForm(0);
                addFlight.ShowDialog();
                this.ReloadListView();
                break;

            case "airplanes":
                AddModifyAirplane plane = new AddModifyAirplane(0);
                plane.ShowDialog();
                this.ReloadListView();
                break;

            case "airlines":
                Add_ModifyAirline line = new Add_ModifyAirline(0);
                line.ShowDialog();
                this.ReloadListView();
                break;
            }
        }