using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SwitchSample
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void cboSeat_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int index;
            decimal price;
            //取得用户选取项目索引
            index = cboSeat.SelectedIndex;
            switch (index)
            {
                case 0:          //1-10 排
                    price = 1200;
                    break;
                case 1:          // 11-20, 21-30, 91-100 排
                case 2:
                case 9:
                    price = 1000;
                    break;
                case 3:         //31-40, 41-50, 51-60 排
                case 4:
                case 5:
                    price = 800;
                    break;
                default:        //其他
                    price = 600;
                    break;
            }
            //打印查询售价
            txtPrice.Text = price.ToString();
        }
    }
}
