1
0
Fork 0
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.

59 lines
1.8 KiB
C#

using HighWayIot.Repository.domain;
using HighWayIot.Repository.service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HighWayIot.Winform.UserControlPages.ParamConfigPages
{
public partial class RFIDParamSettingPage : UserControl
{
private Zx_rfid_settingService zx_rfid_settingService = Zx_rfid_settingService.Instance;
public RFIDParamSettingPage()
{
InitializeComponent();
}
private void GetRfidButton_Click(object sender, EventArgs e)
{
this.rfidDataGridView.Rows.Clear();
List<Zx_rfid_setting> list = zx_rfid_settingService.GetRfidInfos();
foreach (var item in list)
{
this.rfidDataGridView.Rows.Add(item.Id, item.RfidIp, item.RfidEpc, item.WorkstateNo);
}
}
private void rfidDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
// 检查是否双击了有效的行(排除列头)
if (e.RowIndex >= 0)
{
// 获取双击的行
DataGridViewRow row = rfidDataGridView.Rows[e.RowIndex];
// 获取该行的数据
int id = (int)row.Cells["Id"].Value;
string RfidIp = (string)row.Cells["RfidIp"].Value;
string RfidEpc = (string)row.Cells["RfidEpc"].Value;
string WorkstateNo = (string)row.Cells["WorkstateNo"].Value;
UpdateRfidWindow window = new UpdateRfidWindow(id, RfidIp,RfidEpc, WorkstateNo);
window.Show();
}
}
}
}