| | |
| | | |
| | | namespace HStation.WinFrmUI |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | public partial class InputXhsProjectInfoWizardPage : DevExpress.XtraEditors.XtraUserControl, Yw.WinFrmUI.IWizardPage<ImportXhsProjectViewModel> |
| | | { |
| | |
| | | InitializeComponent(); |
| | | } |
| | | |
| | | private ImportXhsProjectViewModel _vm = null; |
| | | /// <summary> |
| | | /// 页面状态改变事件 |
| | | /// </summary> |
| | | public event Action PageStateChangedEvent; |
| | | |
| | | private ImportXhsProjectViewModel _vm = null;//操作对象 |
| | | private bool _isInitialize = false;//是否初始化 |
| | | private Lazy<HStation.BLL.XhsProject> _bllProject = new(() => new HStation.BLL.XhsProject());//项目bll |
| | | private Lazy<Yw.BLL.SysFlagStd> _bllFlag = new(() => new Yw.BLL.SysFlagStd());//标签bll |
| | | |
| | | /// <summary> |
| | | /// 初始化 |
| | | /// </summary> |
| | | public void InitialPage(ImportXhsProjectViewModel t) |
| | | public async void InitialPage(ImportXhsProjectViewModel t) |
| | | { |
| | | if (_isInitialize) |
| | | { |
| | | return; |
| | | } |
| | | _vm = t; |
| | | var allFlagList = await _bllFlag.Value.GetFlagListBySysType(HStation.Xhs.DataType.XhsProject); |
| | | this.setFlagsEditCtrl1.SetBindingData(allFlagList, null); |
| | | _isInitialize = true; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 是否初始化 |
| | | /// </summary> |
| | | public bool IsInitialize |
| | | { |
| | | get { return _isInitialize; } |
| | | } |
| | | private bool _isInitialize = false; |
| | | |
| | | public event Action PageStateChangedEvent; |
| | | |
| | | /// <summary> |
| | | /// 是否允许上一步 |
| | | /// 允许上一步 |
| | | /// </summary> |
| | | public bool AllowPrev |
| | | { |
| | | get { return true; } |
| | | get |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 是否允许下一步 |
| | | /// 允许下一步 |
| | | /// </summary> |
| | | public bool AllowNext |
| | | { |
| | | get { return true; } |
| | | get |
| | | { |
| | | return _isInitialize; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 是否允许取消 |
| | | /// 允许取消 |
| | | /// </summary> |
| | | public bool AllowCancel |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 是否允许完成 |
| | | /// 允许完成 |
| | | /// </summary> |
| | | public bool AllowComplete |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 能否返回上一步 |
| | | /// 能否上一步 |
| | | /// </summary> |
| | | public bool CanPrev() |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 能否进入下一步 |
| | | /// 能否下一步 |
| | | /// </summary> |
| | | 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 = this.txtTagNme.Text.Trim(); |
| | | _vm.TagName = tagName; |
| | | _vm.Description = this.txtDescription.Text.Trim(); |
| | | return true; |
| | | } |