namespace HStation.WinFrmUI { public partial class InputXhsProjectInfoWizardPage : DevExpress.XtraEditors.XtraUserControl, Yw.WinFrmUI.IWizardPage { public InputXhsProjectInfoWizardPage() { InitializeComponent(); } /// /// 页面状态改变事件 /// public event Action PageStateChangedEvent; private ImportXhsProjectViewModel _vm = null;//操作对象 private bool _isInitialize = false;//是否初始化 private Lazy _bllProject = new(() => new HStation.BLL.XhsProject());//项目bll private Lazy _bllFlag = new(() => new Yw.BLL.SysFlagStd());//标签bll /// /// 初始化 /// public async void InitialPage(ImportXhsProjectViewModel t) { if (_isInitialize) { return; } _vm = t; _isInitialize = true; var allFlagList = await _bllFlag.Value.GetFlagListBySysType(HStation.Xhs.DataType.XhsProject); this.setFlagsEditCtrl1.SetBindingData(allFlagList, null); } /// /// 允许上一步 /// public bool AllowPrev { get { return true; } } /// /// 允许下一步 /// public bool AllowNext { get { return _isInitialize; } } /// /// 允许取消 /// public bool AllowCancel { get { return true; } } /// /// 允许完成 /// public bool AllowComplete { get { return false; } } /// /// 能否上一步 /// public bool CanPrev() { return true; } /// /// 能否下一步 /// public bool CanNext() { if (!_isInitialize) { return false; } this.dxErrorProvider1.ClearErrors(); if (string.IsNullOrEmpty(this.txtName.Text.Trim())) { this.dxErrorProvider1.SetError(this.txtName, "必填项"); return false; } var tagName = this.txtTagNme.Text.Trim(); if (!string.IsNullOrEmpty(tagName)) { if (_bllProject.Value.IsExistTagName(tagName).Result) { this.dxErrorProvider1.SetError(this.txtTagNme, "标记已存在"); return false; } } _vm.NO = this.txtNO.Text.Trim(); _vm.Name = this.txtName.Text.Trim(); _vm.Customer = this.txtCustomer.Text.Trim(); _vm.Address = this.txtAddress.Text.Trim(); _vm.Flags = null; _vm.TagName = tagName; _vm.Description = this.txtDescription.Text.Trim(); return true; } /// /// 能否关闭 /// public bool CanCancel() { return true; } /// /// 能否完成 /// public bool CanComplete() { return false; } } }