using DevExpress.XtraEditors;
|
using System;
|
using System.Windows.Forms;
|
|
namespace IStation.WinFrmUI.Monitor
|
{
|
/// <summary>
|
/// 设置排序码
|
/// </summary>
|
public partial class SetTimeStepDlg : XtraForm
|
{
|
public SetTimeStepDlg()
|
{
|
InitializeComponent();
|
this.IconOptions.Icon = IStation.WinFrmUI.Properties.Resources.App;
|
this.layoutControl1.SetupLayoutControl();
|
}
|
|
/// <summary>
|
/// 回调事件
|
/// </summary>
|
public event Action<int> ReloadDataEvent;
|
|
/// <summary>
|
/// 绑定事件
|
/// </summary>
|
public void SetBindingData(int SortCode)
|
{
|
this.txtSortCode.EditValue = SortCode;
|
}
|
|
//验证
|
private bool Valid()
|
{
|
this.dxErrorProvider1.ClearErrors();
|
if (string.IsNullOrEmpty(this.txtSortCode.Text.Trim()))
|
{
|
this.dxErrorProvider1.SetError(this.txtSortCode, "必填项");
|
return false;
|
}
|
return true;
|
}
|
|
//确定
|
private void btnOk_Click(object sender, EventArgs e)
|
{
|
if (!Valid())
|
return;
|
if (this.ReloadDataEvent != null)
|
{
|
this.ReloadDataEvent.Invoke(int.Parse(this.txtSortCode.Text));
|
}
|
this.DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
|
}
|
}
|