namespace HStation.WinFrmUI.WE
|
{
|
public partial class AddUtensilDlg : DevExpress.XtraEditors.XtraForm
|
{
|
public AddUtensilDlg()
|
{
|
InitializeComponent();
|
// this.IconOptions.Icon = WinFrmUI.Properties.Resources.App;
|
// this.dataLayoutControl1.SetupLayoutControl();
|
}
|
|
/// <summary>
|
/// 回调事件
|
/// </summary>
|
// public event Func<Model.WaterEquivalent, bool> ReloadDataEvent;
|
|
// private BLL.WaterUtensil _BLLwaterUtensil = new BLL.WaterUtensil();
|
|
/// <summary>
|
/// 验证识别码是否存在事件
|
/// </summary>
|
public event Func<string, bool> VerifyTagNameExistEvent;
|
|
// private Model.WaterEquivalent _model = null;
|
|
// private List<Model.WaterUtensil> AllwaterUtensilList = null;
|
|
/// <summary>
|
/// 绑定
|
/// </summary>
|
public void SetBindingData()
|
{
|
/* _model = new Model.WaterEquivalent();
|
AllwaterUtensilList = _BLLwaterUtensil.GetAll();
|
foreach (var item in AllwaterUtensilList)
|
{
|
var imageItem = new ImageComboBoxItem(item.Name, item.ID);
|
NameComboBoxEdit.Properties.Items.Add(imageItem);
|
}*/
|
}
|
|
//验证
|
private bool Valid()
|
{
|
this.dxErrorProvider1.ClearErrors();
|
if (string.IsNullOrEmpty(this.NameComboBoxEdit.Text.Trim()))
|
{
|
this.dxErrorProvider1.SetError(this.NameComboBoxEdit, "必填项");
|
return false;
|
}
|
return true;
|
}
|
|
//确定
|
private void btnOk_Click(object sender, EventArgs e)
|
{
|
/* if (_model == null)
|
return;
|
if (!Valid())
|
return;
|
if (this.NameComboBoxEdit.EditValue != null)
|
{
|
_model.WaterUtensilID = (long)NameComboBoxEdit.EditValue;
|
}
|
if (!string.IsNullOrEmpty(this.TextEditAmount.EditValue?.ToString()))
|
{
|
_model.Count = Convert.ToInt32(this.TextEditAmount.EditValue);
|
}
|
if (!string.IsNullOrEmpty(textEditWaterEquivalent.EditValue?.ToString()))
|
{
|
_model.RatedFlow = Convert.ToDouble(textEditWaterEquivalent.EditValue);
|
}
|
if (!string.IsNullOrEmpty(TextMinRatedFlo.EditValue?.ToString()))
|
{
|
_model.MinRatedFlow = Convert.ToDouble(TextMinRatedFlo.EditValue);
|
}
|
_model.BelongType = "EquivalentTemplate";
|
if (this.ReloadDataEvent == null)
|
return;
|
if (!this.ReloadDataEvent(_model))
|
{
|
MessageBoxHelper.ShowError("添加失败!");
|
return;
|
}
|
MessageBoxHelper.ShowSuccess("添加成功!");
|
this.DialogResult = System.Windows.Forms.DialogResult.OK;
|
this.Close();*/
|
}
|
}
|
}
|