コード例 #1
0
        public LoginWindow(Window tu)
        {
            CustomerWindow cu = tu as CustomerWindow;

            InitializeComponent();
            textblock3.Text = cu.label3.Content.ToString();
            textblock4.Text = cu.textblock2.Text;
            textblock5.Text = cu.textbox1.Text;
            try
            {
                price = int.Parse(cu.textblock2.Text.Substring(0, cu.textblock2.Text.Length - 1));
                num   = int.Parse(cu.textbox1.Text.Substring(0, cu.textbox1.Text.Length - 1));
            }
            catch (Exception et)
            {
                MessageBox.Show(et.Message + "LoginWindow类型转化失败!");
            }

            if (cu.comboBox1.SelectedIndex == 0)
            {
                textblock1.Text = "单程票";
                label1.Content  = price * num + "元";
            }
            else
            {
                textblock1.Text = "双程票";
                label1.Content  = price * num * 2 + "元";
            }
        }
コード例 #2
0
        private void Button_cancel_Click(object sender, RoutedEventArgs e)
        {
            CustomerWindow cu = new CustomerWindow(this.price, this.num);

            cu.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            this.Close();
            cu.ShowDialog();
        }
コード例 #3
0
 public OnePicture(CustomerWindow tu)
 {
     InitializeComponent();
     this.cu = tu;
 }