You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
2 years ago
|
using BBWYB.Client.Models;
|
||
|
using SJ.Controls;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Windows;
|
||
|
using System.Windows.Controls;
|
||
|
|
||
|
namespace BBWYB.Client.Views.SelectShop
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// SelectShop.xaml 的交互逻辑
|
||
|
/// </summary>
|
||
|
public partial class SelectShopW : BWindow
|
||
|
{
|
||
|
public IList<Department> DepartmentList { get; set; }
|
||
|
public Shop Shop { get; set; }
|
||
|
|
||
|
public SelectShopW(IList<Department> departmentList)
|
||
|
{
|
||
|
InitializeComponent();
|
||
|
this.DepartmentList = departmentList;
|
||
|
this.Loaded += SelectShop_Loaded;
|
||
|
}
|
||
|
|
||
|
private void SelectShop_Loaded(object sender, RoutedEventArgs e)
|
||
|
{
|
||
|
var d = cbx_department.SelectedItem as Department;
|
||
|
cbx_shop.ItemsSource = d.ShopList;
|
||
|
|
||
|
}
|
||
|
|
||
|
private void btn_ok_Click(object sender, RoutedEventArgs e)
|
||
|
{
|
||
|
Shop = cbx_shop.SelectedItem as Shop;
|
||
|
this.DialogResult = true;
|
||
|
this.Close();
|
||
|
}
|
||
|
|
||
|
private void cbx_department_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||
|
{
|
||
|
var d = cbx_department.SelectedItem as Department;
|
||
|
cbx_shop.ItemsSource = d.ShopList;
|
||
|
cbx_shop.SelectedIndex = 0;
|
||
|
}
|
||
|
}
|
||
|
}
|