private void button4_Click_1(object sender, EventArgs e) { Train_chooser t1 = new Train_chooser(); t1.Show(); this.Close(); }
private void button3_Click(object sender, EventArgs e) { bool p = false; if (!statues) { p = (comboBox1.Text != "" && comboBox2.Text != "" && lbarr[0].Text != "" && lbarr[1].Text != "" && cbarr[0].Text != "" && cbarr[1].Text != ""); } else { p = (comboBox1.Text != "" && comboBox2.Text != "" && lbarr[0].Text != "" && lbarr[1].Text != "" && cbarr[0].Text != "" && cbarr[1].Text != "") && (lbarr2[0].Text != "" && lbarr2[1].Text != "" && cbarr2[0].Text != "" && cbarr2[1].Text != ""); } if (p) { if (statues) { bool flag = false; string[] arr = cbarr[1].Text.Split('-'); string[] brr = cbarr2[1].Text.Split('-'); if (int.Parse(brr[0]) == int.Parse(arr[0])) { if (int.Parse(brr[1]) == int.Parse(arr[1])) { if (int.Parse(brr[2]) == int.Parse(arr[2])) { flag = false; } else if (int.Parse(brr[2]) > int.Parse(arr[2])) { flag = true; } else { flag = false; } } else if (int.Parse(brr[1]) > int.Parse(arr[1])) { flag = true; } else { flag = false; } } else if (int.Parse(brr[0]) > int.Parse(arr[0])) { flag = true; } else { flag = false; } if (!flag) { MessageBox.Show("You should select the right data"); } else { if (comboBox1.Text != comboBox2.Text) { Train_chooser t = new Train_chooser(); t.Show(); this.Hide(); } else { MessageBox.Show("يجب ان لا تكون مدينه القيام تشبه مدينه الوصول "); } } } else { if (comboBox1.Text != comboBox2.Text) { Train_chooser t = new Train_chooser(); t.Show(); this.Hide(); } else { MessageBox.Show("يجب ان لا تكون مدينه القيام تشبه مدينه الوصول "); } } } else { MessageBox.Show("ادخل البيانات كامله من فضلك"); } }