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();
}
///
/// 流量点
///
public double Q { get; set; }
///
/// 绑定数据
///
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();
}
}
}