using DevExpress.XtraEditors;
|
|
namespace ISupply.WinFrm.Main
|
{
|
public partial class AddSyStemTypeDlg : DevExpress.XtraEditors.XtraForm
|
{
|
public AddSyStemTypeDlg()
|
{
|
InitializeComponent();
|
}
|
|
public event Func<Model.SystemType, bool> ReloadEvent;
|
|
|
|
//验证
|
private bool Valid()
|
{
|
this.dxErrorProvider1.ClearErrors();
|
if (string.IsNullOrEmpty(this.TxtName.Text.Trim()))
|
{
|
this.dxErrorProvider1.SetError(this.TxtName, "必填项");
|
return false;
|
}
|
return true;
|
}
|
|
|
private void btnOk_Click(object sender, EventArgs e)
|
{
|
if (!Valid()) return;
|
var model = new Model.SystemType();
|
model.Name = this.TxtName.Text;
|
model.TagName = this.TagName.Text;
|
model.Description = this.TxtDescription.Text;
|
model.UseStatus = Model.eUseStatus.Enable;
|
if (ReloadEvent(model))
|
{
|
XtraMessageBox.Show("添加成功!");
|
}
|
this.Close();
|
}
|
}
|
}
|