using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Command; using Microsoft.Win32; using MiniExcelLibs; using SlnMesnac.RfidUpload.NLog; using SlnMesnac.RfidUpload.Business; using SlnMesnac.RfidUpload.Common; using SlnMesnac.RfidUpload.Model; using SlnMesnac.RfidUpload.Model.apiParam; using SlnMesnac.RfidUpload.Model.config; using SlnMesnac.RfidUpload.TouchSocket; using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading.Tasks; using ApiServer = SlnMesnac.RfidUpload.TouchSocket.ApiServer; using System.Windows; using System.Threading; using static SlnMesnac.RfidUpload.UI.SelectRouterWindow; using static SlnMesnac.RfidUpload.UI.viewModel.containerStorageQueryByCsbViewModel; using SlnMesnac.RfidUpload.UI.TempData; namespace SlnMesnac.RfidUpload.UI.viewModel { public class MainWindowViewModel : ViewModelBase { TransferOrderViewModel transferOrderViewModel = new TransferOrderViewModel(); ContainerTransferOrderViewModel containerTransferOrderViewModel = new ContainerTransferOrderViewModel(); private readonly LogHelper logger = LogHelper.Instance; private readonly HandleBusiness _business = HandleBusiness.Instance; private readonly SerialPortBusiness _serialPortBusiness = SerialPortBusiness.Instance; private ObservableCollection listItems = new ObservableCollection(); private ObservableCollection labelItems = new ObservableCollection(); private CsbHandleBusiness csbHandleBusiness = CsbHandleBusiness.Instance; private WebApiServerApp webApiServerApp = WebApiServerApp.Instance; private ApiServer apiServer = ApiServer.GetInstance(); private AppConfig appConfig = AppConfig.Instance; private JsonChange jsonChange = JsonChange.Instance; private int No = 1; private SysData sysData = SysData.Instance; //暂存库存容器分发配发机构数据 private Institution Institution; #region 参数定义 /// /// 串口 /// private ObservableCollection _serialPortItems = new ObservableCollection(); public ObservableCollection SerialPortItems { get { return _serialPortItems; } set { _serialPortItems = value; RaisePropertyChanged(() => SerialPortItems); } } private string _selectedSerialPortItems = string.Empty; public string SelectedSerialPortItems { get { return _selectedSerialPortItems; } set { _selectedSerialPortItems = value; RaisePropertyChanged(() => SelectedSerialPortItems); } } /// /// 波特率 /// private ObservableCollection _baudRateItems = new ObservableCollection() { 9600, 115200 }; public ObservableCollection BaudRateItems { get { return _baudRateItems; } set { _baudRateItems = value; RaisePropertyChanged(() => BaudRateItems); } } private int _selectedBaudRateItems = 115200; public int SelectedBaudRateItems { get { return _selectedBaudRateItems; } set { _selectedBaudRateItems = value; RaisePropertyChanged(() => SelectedBaudRateItems); } } /// /// 数据位 /// private ObservableCollection _dataBitsItems = new ObservableCollection() { 2, 4, 6, 8 }; public ObservableCollection DataBitsItems { get { return _dataBitsItems; } set { _dataBitsItems = value; RaisePropertyChanged(() => DataBitsItems); } } private int _selectedDataBitsItems = 8; public int SelectedDataBitsItems { get { return _selectedDataBitsItems; } set { _selectedDataBitsItems = value; RaisePropertyChanged(() => SelectedDataBitsItems); } } /// ///停止位 /// private ObservableCollection _stopBitsItems = new ObservableCollection() { 0, 1, 2, 3, 4 }; public ObservableCollection StopBitsItems { get { return _stopBitsItems; } set { _stopBitsItems = value; RaisePropertyChanged(() => StopBitsItems); } } private int _selectedStopBitsItems = 1; public int SelectedStopBitsItems { get { return _selectedStopBitsItems; } set { _selectedStopBitsItems = value; RaisePropertyChanged(() => SelectedStopBitsItems); } } /// ///校验位 /// private ObservableCollection _parityItems = new ObservableCollection() { "None", "Odd", "Even", "Mark", "Space" }; public ObservableCollection ParityItems { get { return _parityItems; } set { _parityItems = value; RaisePropertyChanged(() => ParityItems); } } private string _selectedParityItems = "None"; public string SelectedParityItems { get { return _selectedParityItems; } set { _selectedParityItems = value; RaisePropertyChanged(() => SelectedParityItems); } } /// /// 标签数量 /// private int labelCountParam = 0; public int LabelCountParam { get { return labelCountParam; } set { labelCountParam = value;RaisePropertyChanged(() => LabelCountParam); } } /// /// 主界面当前调拨单号 /// private string _mainPageDbdh = ""; public string MainPageDbdh { get { return _mainPageDbdh; } set { _mainPageDbdh = value; RaisePropertyChanged(() => MainPageDbdh); } } /// /// 主界面当前送货单号 /// private string _trackNo = ""; public string TrackNo { get { return _trackNo; } set { _trackNo = value; RaisePropertyChanged(() => TrackNo); } } /// /// 主界面当前封发计划 /// private string _mainPageFfjhNo = ""; public string MainPageFfjhNo { get { return _mainPageFfjhNo; } set { _mainPageFfjhNo = value; RaisePropertyChanged(() => MainPageFfjhNo); } } /// /// 主界面提示信息 /// private string _mainPageTipMessage = ""; public string MainPageTipMessage { get { return _mainPageTipMessage; } set { _mainPageTipMessage = value; RaisePropertyChanged(() => MainPageTipMessage); } } /// /// 工作模式 /// private int workModelParam = 0; public int WorkModelParam { get { return workModelParam; } set { workModelParam = value; RaisePropertyChanged(() => WorkModelParam); } } /// /// 分发验证后的对象 /// private TransferOrderInfo _transferOrderInfo = new TransferOrderInfo(); public TransferOrderInfo TransferOrderInfoItem { get { return _transferOrderInfo; } set { _transferOrderInfo = value; RaisePropertyChanged(() => TransferOrderInfoItem); } } private int rfidDeviceStatus = 0; public int RfidDeviceStatus { get { return rfidDeviceStatus; } set { rfidDeviceStatus = value; RaisePropertyChanged(nameof(RfidDeviceStatus)); } } /// /// 日志打印ListBox /// private IEnumerable logInfoListBox; public IEnumerable LogInfoListBox { get { return logInfoListBox; } set { logInfoListBox = value; RaisePropertyChanged(() => LogInfoListBox); } } /// /// 标签信息DataGrid /// private IEnumerable labelInfoDataGrid; public IEnumerable LabelInfoDataGrid { get { return labelInfoDataGrid; } set { labelInfoDataGrid = value; RaisePropertyChanged(() => LabelInfoDataGrid); } } #endregion #region 事件定义 /// /// 打开串口 /// public RelayCommand OpenSerialPortCommand { get; set; } /// /// 关闭串口 /// public RelayCommand CloseSerialPortCommand { get; set; } /// /// 导出文件 /// public RelayCommand ExportFilesCommand { get; set; } #endregion /// /// 清空列表 /// public RelayCommand EmptyFilesCommand { get; set; } public RelayCommand FinishCommand { get; set; } public RelayCommand systemSetCommand { get; set; } /// /// 设置工作模式 /// public RelayCommand SetWorkModelCommand { get; set; } public MainWindowViewModel() { containerStorageQueryByCsbViewModel.RefreshSubmitVerifyEvent += RefreshSubmitVerify; containerStorageQueryByCsbViewModel.RefreshTrackNoEvent += RefreshTrackNo; TransferOrderViewModel.RefreshSubmitVerifyEvent += RefreshSubmitVerify; SelectRouterWindow.RefreshSubmitVerifyEvent += RefreshSubmitVerify; logger.Info("程序启动"); EmptyFilesCommand = new RelayCommand(EmptyFiles); ExportFilesCommand = new RelayCommand(ExportFiles); OpenSerialPortCommand = new RelayCommand(OpenSerialPort); CloseSerialPortCommand = new RelayCommand(CloseSerialPort); SetWorkModelCommand = new RelayCommand(SetWorkModel); systemSetCommand = new RelayCommand(SystemSet); FinishCommand = new RelayCommand(Finish); this.Init(); //测试数据 //sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "1234567890", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now }); //sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "1234", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now }); //sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now }); //sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "554434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now.AddDays(1) }); //sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now }); //sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now }); //sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now }); //sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now }); //sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now }); //sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now }); //sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now }); //sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now }); } private void Init() { WorkModelParam = Convert.ToInt32(appConfig.workModel); //webApiServerApp.Init(); //apiServer.RefreshScanInfoInCenterStartEvent += () => //{ // OpenSerialPort(); //}; //apiServer.RefreshScanInfoInCenterStopEvent += () => //{ // CloseSerialPort(); //}; //apiServer.RefreshScanInfoOutCenterStartEvent += () => //{ // OpenSerialPort(); //}; //apiServer.RefreshScanInfoOutCenterStopEvent += () => //{ // CloseSerialPort(); //}; //加载标签信息 _business.InstructionInfoDataGridEvent += RefreshLabelInfoDataGrid; //加载解析日志 _business.RefreshLogMessageEvent += message => { // logger.Info(message); PrintMessageToListBox(message); }; //接收串口数据 _serialPortBusiness.ReceivedDataEvent += buffer => { //粘包数据处理 List dataPackages = _business.SplitPackets(buffer); foreach (byte[] package in dataPackages) { _business.LabelHandle(package); //LabelCountParam += 1; } }; //加载串口通讯日志 _serialPortBusiness.RefreshLogMessageEvent += message => { logger.Info(message); PrintMessageToListBox(message); }; _serialPortBusiness.GetSerialPorts(out List serialPorts); SerialPortItems = new ObservableCollection(serialPorts); } /// /// 打开串口通讯 /// private void OpenSerialPort() { try { // LabelTest(); //_serialPortBusiness.OpenSerialPort(); this.GetParity(out int parity); _serialPortBusiness.OpenSerialPort(_selectedSerialPortItems, _selectedBaudRateItems, parity, _selectedDataBitsItems, _selectedStopBitsItems); if (rfidDeviceStatus != 1) { RfidDeviceStatus = 1; } } catch (Exception e) { PrintMessageToListBox($"串口通讯打开异常:{e.Message}"); } } /// /// 关闭串口通讯 /// private void CloseSerialPort() { try { _serialPortBusiness.Close(); if (rfidDeviceStatus != 2) { RfidDeviceStatus = 2; } } catch (Exception e) { PrintMessageToListBox($"串口通讯关闭异常:{e.Message}"); } } /// /// 导出文件 /// private void ExportFiles() { try { var info = labelItems.ToList(); // 创建 SaveFileDialog 对象 SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "Excel文件 (*.xlsx)|*.xlsx|所有文件 (*.*)|*.*"; saveFileDialog.Title = "保存文件"; saveFileDialog.FileName = $"标签信息{DateTime.Now.Date:yyyy-MM-dd}.xlsx"; if (saveFileDialog.ShowDialog() == true) { string filePath = saveFileDialog.FileName; MiniExcel.SaveAs(filePath, info); PrintMessageToListBox($"标签数据导出成功:{filePath}"); } } catch(Exception ex) { PrintMessageToListBox($"标签数据导出异常:{ex.Message}"); logger.Error($"标签数据导出异常", ex); } } private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI"); private void Finish() { try { if (workModelParam == 1) //新容器入库 { var info = labelItems.ToList(); var strList = info.Select(x => x.result).ToList(); int batchNo = 0; string opBatch = System.Guid.NewGuid().ToString("N").Substring(0, 20); ListPage ls = new ListPage(strList, 500); CsbResult res = new CsbResult(); foreach (var enumerable in ls.GetPage()) { batchNo++; res = csbHandleBusiness.containerStorageBatchQueryByCsb(TrackNo,batchNo.ToString(), enumerable.ToList()); } MainPageTipMessage = $"新容器入库 [{res.GetMsg()}]"; if (res.IsSuccess) { Task.Run(() => { Thread.Sleep(3000); CsbResult res = csbHandleBusiness.receContainerStorageByCsb(TrackNo, "1"); Application.Current.Dispatcher.Invoke(() => { MainPageTipMessage = $"新容器入库反馈接口,[{res.GetMsg()}]"; }); }); } } else if (workModelParam == 2) //封发-按调拨单 { var info = labelItems.ToList(); var strList = info.Select(x => x.result).ToList(); int batchNo = 0; string opBatch = System.Guid.NewGuid().ToString("N").Substring(0, 20); ListPage ls = new ListPage(strList, 500); CsbResult res = new CsbResult(); foreach (var enumerable in ls.GetPage()) { batchNo++; res = csbHandleBusiness.containerScanSealByCsb(TransferOrderInfoItem.ffjhNo, opBatch, TransferOrderInfoItem.ffjhscrq, batchNo.ToString(), enumerable.ToList()); } // MessageBox.Show($"封发-按调拨单 [{res.GetMsg()}]"); MainPageTipMessage = $"封发-按调拨单 [{res.GetMsg()}]"; if (res.IsSuccess) { Task.Run(() => { //若干秒以后调反馈接口,确认是否和实际相符 Thread.Sleep(3000); CsbResult res = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch); Application.Current.Dispatcher.Invoke(() => { MainPageTipMessage = $"封发-按调拨单反馈接口,[{res.GetMsg()}]"; // 如果需要弹出消息框,也需要在 UI 线程调用 MessageBox // MessageBox.Show($"封发-按调拨单反馈接口,[{res.GetMsg()}]"); }); }); } } else if (WorkModelParam == 3 || WorkModelParam == 4) //库存容器封发配发 -- 6.13.容器直连配发-开始配发 { //四、6.9接收容器条码接口 var info = labelItems.ToList(); var strList = info.Select(x => x.result).ToList(); int batchNo = 0; string opBatch = OpBatchManager.BathNo; ListPage ls = new ListPage(strList, 500); CsbResult res = new CsbResult(); foreach (var enumerable in ls.GetPage()) { batchNo++; res = csbHandleBusiness.containerScanSealByCsb(TransferOrderInfoItem.ffjhNo, opBatch, TransferOrderInfoItem.ffjhscrq, batchNo.ToString(), enumerable.ToList()); } MainPageTipMessage = $"封发-按调拨单 [{res.GetMsg()}]"; if (res.IsSuccess) { Task.Run(() => { // 五、6.10反馈接收结果(利用上一步的opBatch) Task.Delay(3000); CsbResult res1 = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch); MainPageTipMessage = $"封发-按调拨单反馈接口,[{res1.GetMsg()}]"; if(!res1.IsSuccess) return; //六、6.12 效验发运计划(利用上一步的opBatch) string stationOrgCode = Institution != null ? Institution.stationOrgCode : ""; string stationOrgName = Institution != null ? Institution.stationOrgName : ""; CsbResult res2 = csbHandleBusiness.tranPlanCheckByCsb(_transferOrderInfo.ffjhNo, opBatch, stationOrgCode, stationOrgName); MainPageTipMessage = "校验发运计划结果:" + res2.GetMsg(); if (res2.IsSuccess) { // 七、6.13.容器直连配发-开始配发 CsbResult res3 = csbHandleBusiness.containerAllotByCsb(TransferOrderInfoItem.ffjhNo, opBatch); MainPageTipMessage = $"库存容器封发配发 -- 6.13.容器直连配发-开始配发 [{res3.GetMsg()}]"; if (res3.IsSuccess) { Task.Delay(3000); // Thread.Sleep(3000); //八、反馈接收接口,确认是否和实际相符 for (int i = 0; i < 3; i++) { try { CsbResult res4 = csbHandleBusiness.containerAllotResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch); MainPageTipMessage = $"八、反馈接收接口,确认是否和实际相符[{res4.GetMsg()}]"; if (res4.IsSuccess) { break; }; } catch (Exception ex) { logger.Info(ex.Message); Task.Delay(3000); } } } } }); } //string opBatch = OpBatchManager.BathNo; //CsbResult res = csbHandleBusiness.containerAllotByCsb(TransferOrderInfoItem.ffjhNo,opBatch); //MessageBox.Show($"库存容器封发配发 -- 6.13.容器直连配发-开始配发 [{res.GetMsg()}]"); //Task.Run(() => //{ // Thread.Sleep(3000); // //若干秒以后调反馈接口,确认是否和实际相符 // CsbResult res = csbHandleBusiness.containerAllotResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch); // MessageBox.Show($"库存容器封发配发--若干秒以后调反馈接口,确认是否和实际相符[{res.GetMsg()}]"); //}); } else if (workModelParam == -1) { MessageBox.Show("工作模式错误"); return; } }catch(Exception ex) { MessageBox.Show(ex.Message); } } /// /// 清空标签信息列表 /// private void EmptyFiles() { No = 0; labelItems.Clear(); LabelCountParam = 0; } private void SystemSet() { systemSetWindow systemSetWindow = new systemSetWindow(); systemSetWindow.ShowDialog(); } private void SetWorkModel(object modelFlag) { // WorkModelParam = Convert.ToInt32(modelFlag); int WorkModel = Convert.ToInt32(modelFlag); // appConfig.workModel = this.workModelParam.ToString(); //TransferOrderWindow transferOrderWindow = new TransferOrderWindow(transferOrderViewModel); //transferOrderWindow.ShowDialog(); if(WorkModel == 1) //新容器入库 { containerStorageQueryByCsb storageQueryByCsb = new containerStorageQueryByCsb(); storageQueryByCsb.ShowDialog(); } else if(WorkModel == 2) //容器封发-按调拨单 { TransferOrderWindow transferOrderWindow = new TransferOrderWindow(transferOrderViewModel); transferOrderWindow.ShowDialog(); } else if (WorkModel == 3) //库存容器封发配发 { containerTransferOrderViewModel.BelongPage = 3; ContainerTransferOrderWindow containerTransferOrderWindow = new ContainerTransferOrderWindow(containerTransferOrderViewModel); containerTransferOrderWindow.ShowDialog(); } else if (WorkModel == 4) //卸车容器封发配发 { containerTransferOrderViewModel.BelongPage = 4; ContainerTransferOrderWindow containerTransferOrderWindow = new ContainerTransferOrderWindow(containerTransferOrderViewModel); containerTransferOrderWindow.ShowDialog(); }else if (WorkModel == 5) //退出 { System.Environment.Exit(0); } } /// /// 加载标签信息DataGrid /// /// private void RefreshLabelInfoDataGrid(InstructionInfo instructionInfo) { if (instructionInfo == null) return; App.Current.Dispatcher.BeginInvoke((Action)(() => { int no =labelItems.Count; DataGridEnt dataGridEnt = new DataGridEnt(); dataGridEnt.no = ++no; dataGridEnt.dbdh = _transferOrderInfo.dbdh; dataGridEnt.result = instructionInfo.data; dataGridEnt.recordtime = DateTime.Now; labelItems.Add(dataGridEnt); LabelInfoDataGrid = labelItems; LabelCountParam += 1; })); Task.Run(() => { if (workModelParam == 101) { var info = BatchOpenQuery.Instance; info.rqtm = instructionInfo.data; _business.upload(101, jsonChange.ModeToJson(info), "新容器入库"); } }); } /// /// listBox绑定日志 /// /// private void PrintMessageToListBox(string message) { lock (string.Empty) { try { listItems.Add($"{DateTime.Now.ToString("HH:mm:ss")}==>{message}"); LogInfoListBox = listItems.OrderByDescending(x => x); } catch (Exception ex) { logger.Error("日志数据绑定异常", ex); } } } /// /// 标签解析测试 /// private void LabelTest() { // 模拟接收到的粘包数据 byte[] receivedData = { 0xAA, 0x55, 0x00, 0x1F, 0x31, 0x03, 0x45, 0x32, 0x30, 0x30, 0x33, 0x30, 0x33, 0x32, 0x37, 0x38, 0x31, 0x30, 0x30, 0x31, 0x35, 0x30, 0x30, 0x35, 0x39, 0x30, 0x44, 0x35, 0x35, 0x36, 0x2C, 0xAA, 0x55, 0x00, 0x1F, 0x31, 0x03, 0x45, 0x32, 0x30, 0x30, 0x33, 0x30, 0x33, 0x32, 0x37, 0x38, 0x31, 0x30, 0x30, 0x31, 0x35, 0x30, 0x30, 0x35, 0x39, 0x30, 0x44, 0x35, 0x35, 0x36, 0x2C, 0xAA, 0x55, 0x00, 0x1F, 0x31, 0x03, 0x45, 0x32, 0x30, 0x30, 0x33, 0x30, 0x33, 0x32, 0x37, 0x38, 0x31, 0x30, 0x30, 0x31, 0x35, 0x30, 0x30, 0x35, 0x39, 0x30, 0x44, 0x35, 0x35, 0x36, 0x2C, 0xAA, 0x55, 0x00, 0x1F, 0x31, 0x03, 0x45, 0x32, 0x30, 0x30, 0x33, 0x30, 0x33, 0x32, 0x37, 0x38, 0x31, 0x30, 0x30, 0x31, 0x35, 0x30, 0x30, 0x35, 0x39, 0x30, 0x44, 0x35, 0x35, 0x36, 0x2C, 0xAA, 0x55, 0x00, 0x27, 0x31, 0x03, 0x46, 0x43, 0x31, 0x30, 0x30, 0x38, 0x32, 0x30, 0x32, 0x30, 0x30 }; //粘包数据的处理 List dataPackages = _business.SplitPackets(receivedData); // 打印处理后的数据包 foreach (byte[] package in dataPackages) { _business.LabelHandle(package); //LabelCountParam += 1; } } /// /// 转换校验位 /// /// private void GetParity(out int parity) { switch (_selectedParityItems) { case "None": parity = 0; break; case "Odd": parity = 1; break; case "Even": parity = 2; break; case "Mark": parity = 3; break; case "Space": parity = 4; break; default: parity = 0; break; } } /// /// /// model -当前工作模式 /// msg -接口返回信息 /// dbdh -调拨单号 /// /// /// /// private void RefreshSubmitVerify(int model,string msg,TransferOrderInfo transferOrderInfo=null, Institution institution = null) { MainPageTipMessage = msg; appConfig.workModel = model.ToString(); WorkModelParam = model ; if (transferOrderInfo != null) { MainPageDbdh = transferOrderInfo.dbdh; MainPageFfjhNo = transferOrderInfo.ffjhNo; TransferOrderInfoItem = transferOrderInfo; } if(institution != null) { Institution = institution; } } private void RefreshTrackNo(string trackNo) { MainPageTipMessage = "trackNo:" + trackNo; TrackNo = trackNo; } } } class DataGridEnt { public int no { get; set; } public string dbdh { get; set; } public string result { get; set; } public DateTime recordtime { get; set; } }