Example #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            string str1 = comboBox1.Text.ToString();
            string str2 = comboBox2.Text.ToString();

            if (str1 == "" || str2 == "")
            {
                MessageBox.Show("内容不能为空");
                return;
            }
            if (str1 == str2)
            {
                MessageBox.Show("出发地和目的地不能相等");
                return;
            }
            if (grp1.Road_True(str1, str2))
            {
                MessageBox.Show("当前路线已有安排");
                return;
            }
            if (!TextBox5_Is_Number())
            {
                MessageBox.Show("旅行费用必须为数字!");
                return;
            }
            if (!TextBox4_Is_Number())
            {
                MessageBox.Show("旅途时间格式不正确!");
                return;
            }
            grp1.Out_Trans_Data(comboBox1.Text.ToString(),
                                comboBox2.Text.ToString(),
                                comboBox3.Text.ToString(),
                                Text_To_Money(),
                                Text_To_Go_Time(),
                                Text_To_Trans_Time());
            grp1.Change_Road(str1, str2, 1);
            grp1.Out_Data_Updata();
            MessageBox.Show("添加线路成功");
        }