private void Button1_Click(object sender, EventArgs e)
        {
            int val = controllerObj.InsertToBelongs(TrackNum, order, (int)comboBox1.SelectedValue);

            if (val > 0)
            {
                if (count == 1)
                {
                    Tracks t = new Tracks();
                    t.Show();
                    this.Close();
                }
                else
                {
                    count = count - 1;
                    InsertToBelongs ins = new InsertToBelongs(TrackNum, count);
                    ins.Show();
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Cannot add the station");
                InsertToBelongs ins = new InsertToBelongs(TrackNum, count);
                ins.Show();
                this.Close();
            }
        }
示例#2
0
        private void Button1_Click(object sender, EventArgs e)
        {
            int val = controllerObj.InsertNewTrack((int)numericUpDown1.Value,
                                                   textBox1.Text);

            if (val > 0)
            {
                InsertToBelongs insert = new InsertToBelongs((int)numericUpDown1.Value, (int)numericUpDown2.Value);
                insert.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("failed!");
            }
        }