WinMoveTruss.xaml.cs
2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using HHECS.BLL.Services;
using HHECS.Model.Entities;
using System;
using System.Windows;
namespace HHECS.WinCommon.Controls
{
/// <summary>
/// WinMoveTruss.xaml 的交互逻辑
/// </summary>
public partial class WinMoveTruss : Window
{
private readonly Equipment DeviceEntity;
private readonly BaseWorkStationService baseWorkStationService = new BaseWorkStationService();
public string stationId = string.Empty;
public WinMoveTruss(Equipment equipment)
{
InitializeComponent();
DeviceEntity = equipment;
InitControl();
}
private void InitControl()
{
cbx_StationId.ItemsSource = baseWorkStationService.GetAll();
cbx_StationId.DisplayMemberPath = "WorkStationName";
cbx_StationId.SelectedValuePath = "Id";
}
private void Btn_Issue_Click(object sender, RoutedEventArgs e)
{
string code = DeviceEntity.Code;
if (cbx_StationId.SelectedValue?.ToString() == null)
{
MessageBox.Show("请选择需要到达目的站台", "注意", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
else
{
stationId = cbx_StationId.SelectedValue.ToString();
this.DialogResult = true;
}
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
//var temp = AppSession.BllService.GetDictWithDetailsAndTrussCode(DeviceEntity.Code);
//var stations = AppSession.Dal.GetCommonModelByCondition<Station>($"where trussPutStationId <> 0 and transportNormal = '{DeviceEntity.Code}'");
//if (stations.Success)
//{
// //stations.Data.Distinct(t => t.)
// //var dictDetails = stations.Data.ToDictionary(t => t.TrussPutStationId, i => i.Name);
// var dictDetails = stations.Data;
// cbx_StationId.ItemsSource = dictDetails;
// cbx_StationId.DisplayMemberPath = "Name";
// cbx_StationId.SelectedValuePath = "TrussPutStationId";
//}
//else
//{
// MessageBox.Show($"错误{stations.Msg}");
// return;
//}
}
private void Btn_Cancel_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void Window_Closed(object sender, EventArgs e)
{
this.Close();
}
}
}