using DevExpress.XtraEditors;
|
using System;
|
using System.Windows.Forms;
|
|
namespace IStation.WinFrmUI.Basic
|
{
|
public partial class QueryQDlg : XtraForm
|
{
|
public QueryQDlg()
|
{
|
InitializeComponent();
|
this.IconOptions.Icon = WinFrmUI.Properties.Resources.App;
|
this.dataLayoutControl1.SetupLayoutControl();
|
}
|
|
|
|
/// <summary>
|
/// 流量点
|
/// </summary>
|
public double Q { get; set; }
|
|
/// <summary>
|
/// 绑定数据
|
/// </summary>
|
public void SetBindingData(string name)
|
{
|
this.txtQ.EditValue = name;
|
}
|
|
//验证
|
private bool Valid()
|
{
|
this.dxErrorProvider1.ClearErrors();
|
if (string.IsNullOrEmpty(this.txtQ.Text.Trim()))
|
{
|
this.dxErrorProvider1.SetError(this.txtQ, "必填项");
|
return false;
|
}
|
return true;
|
}
|
|
//确定
|
private void btnOk_Click(object sender, EventArgs e)
|
{
|
if (!Valid())
|
return;
|
this.Q = double.Parse(this.txtQ.Text);
|
this.DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
|
}
|
}
|