lixiaojun
2024-12-23 c2b56fc9401718620dd2a280557b8c716e4ad05a
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/04-scheme/01-info/CreateXhsSchemeInfoPage.cs
@@ -1,4 +1,6 @@
namespace HStation.WinFrmUI
using DevExpress.Utils.Svg;
namespace HStation.WinFrmUI
{
    public partial class CreateXhsSchemeInfoPage : DevExpress.XtraEditors.XtraUserControl, Yw.WinFrmUI.IWizardPage<CreateXhsSchemeViewModel>
    {
@@ -26,6 +28,7 @@
        /// </summary>
        public async void InitialPage(CreateXhsSchemeViewModel t)
        {
            if (_isInitialize)
            {
                return;
@@ -57,7 +60,9 @@
                t.Scheme = new XhsSchemeVmo();
                if (t.AllSchemeList != null && t.AllSchemeList.Count > 0)
                {
                    t.Scheme.SortCode = t.AllSchemeList.Max(x => x.SortCode) + 1;
                    var sort_code= t.AllSchemeList.Max(x => x.SortCode) + 1;
                    t.Scheme.SortCode = sort_code;
                    this.txtName.EditValue = $"方案{sort_code}";
                }
            }
        }
@@ -77,6 +82,7 @@
            }
            _vm.Scheme.Name = this.txtName.Text.Trim();
            _vm.Scheme.NO = this.txtNO.Text.Trim();
            _vm.Scheme.SiteID = _vm.ProjectSite.ID;
            _vm.Scheme.Flags = this.setFlagsEditCtrl1.SelectedFlagList;
            _vm.Scheme.AllowCustom = this.ckAllowCustom.Checked;
            _vm.Scheme.ChangeTypes = this.xhsSchemeChangeTypeCheckedListHorizCtrl1.GetCheckedList();
@@ -144,7 +150,11 @@
        /// 能否下一步
        /// </summary>
        public bool CanNext()
        {
        {
            if (!_isInitialize)
            {
                return false;
            }
            return Save();
        }
@@ -161,7 +171,14 @@
        /// </summary>
        public bool CanComplete()
        {
            return Save();
            if (!_isInitialize)
            {
                return false;
            }
            if (!Save())
                return false;
            var bol = Task.Run(async () => await CreateXhsSchemeHelper.Create(_vm)).Result;
            return bol;
        }