You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
3.1 KiB
C#
101 lines
3.1 KiB
C#
using CommonFunc.Tools;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
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;
|
|
using XGL.Data.DBService;
|
|
using XGL.Tools;
|
|
|
|
namespace XGL.Views
|
|
{
|
|
/// <summary>
|
|
/// DryingRoomUC.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class DryingRoomUC : UserControl
|
|
{
|
|
DringRoomService dringRoomService = new DringRoomService();
|
|
public DryingRoomUC()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
InitComBoboxData();
|
|
GetDringRoomData();
|
|
|
|
}
|
|
|
|
private void GetDringRoomData()
|
|
{
|
|
DringRoomListBox.ItemsSource = null;
|
|
DringRoomListBox.Items.Clear();
|
|
DataTable dt = dringRoomService.GetDringRoomData(comboDryRoomInfo.SelectedValue.ToString());
|
|
if (dt == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
|
|
int index = 0;
|
|
int i = 0;
|
|
foreach (DataRow item in dt.Rows)
|
|
{
|
|
index = i++;
|
|
string rfid = item["rfid"].ToString();
|
|
string workorder_code = item["workorder_code"].ToString();
|
|
string materialCode = item["product_code"].ToString();
|
|
//string workorder_code = item["workorder_code"].ToString();
|
|
ModuleUC uc = new ModuleUC(index.ToString(), rfid, workorder_code, materialCode, "10");
|
|
|
|
DringRoomListBox.Items.Add(uc);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
private void InitComBoboxData()
|
|
{
|
|
DataTable dt = dringRoomService.GetDringRoomInfo();
|
|
if (dt == null)
|
|
{
|
|
CustomMessageBox.Show("没有维护设备信息,请维护设备后重试!", CustomMessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
|
|
List<EquipmentMode> listEquip = Utils.ToDataList<EquipmentMode>(dt);
|
|
//comboDryRoomInfo.SelectedValuePath = "quipName";
|
|
//comboDryRoomInfo.DisplayMemberPath = "quipCode";
|
|
//comboDryRoomInfo.ItemsSource = listEquip;
|
|
//绑定
|
|
comboDryRoomInfo.ItemsSource = listEquip;
|
|
comboDryRoomInfo.SelectedValuePath = "quipCode";
|
|
comboDryRoomInfo.DisplayMemberPath = "quipName";
|
|
comboDryRoomInfo.SelectedIndex = 0;
|
|
}
|
|
|
|
private void comboDryRoomInfo_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
string hfCode = comboDryRoomInfo.SelectedValue.ToString();//.Text;
|
|
GetDringRoomData();
|
|
}
|
|
}
|
|
public class EquipmentMode
|
|
{
|
|
public int type { get; set; }
|
|
public string quipCode { get; set; }
|
|
public string quipName { get; set; }
|
|
}
|
|
}
|