| | |
| | | using DevExpress.XtraEditors; |
| | | 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 IBox.WinFrmUI |
| | | namespace IBox.WinFrmUI |
| | | { |
| | | public partial class ProtocolXMZ : DevExpress.XtraEditors.XtraUserControl |
| | | { |
| | |
| | | InitializeComponent(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public IBoxProtocolViewModel GetData() |
| | | { |
| | | var model = new IBoxProtocolViewModel(); |
| | | model.IP = this.textEditIP.Text; |
| | | model.Port = this.textEditPort.Text; |
| | | model.SlotNumber = int.Parse(this.textEditSlotNumber.Text); |
| | | model.RackNumber=int.Parse(this.textEditRackNumber.Text); |
| | | model.RackNumber = int.Parse(this.textEditRackNumber.Text); |
| | | return model; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | public void SetData(IBoxProtocolViewModel model) |
| | | { |
| | | this.textEditIP.Text = model.IP; |
| | | this.textEditPort.Text = model.Port; |
| | | this.textEditSlotNumber.Text = model.SlotNumber.ToString(); |
| | | this.textEditRackNumber.Text=model.RackNumber.ToString(); |
| | | this.textEditRackNumber.Text = model.RackNumber.ToString(); |
| | | } |
| | | } |
| | | } |