void save(object obj)
        {
            CreateBetweenClassHours window = obj as CreateBetweenClassHours;

            if (!this.Validate())
            {
                return;
            }

            if (this.OpratorEnum == OperatorEnum.Add)
            {
                window.Add = new UIClassHourRule
                {
                    UID        = Guid.NewGuid().ToString(),
                    IsActive   = this.IsActive,
                    ClassHours = this.TargetHours?.ToList(),
                    Weight     = this.Weight,
                    MaxDays    = this.MaxDays,
                    MinDays    = this.MinDays,
                };

                if (_timeRule == MixedAlgoRuleEnum.MaxDaysBetweenClassHours)
                {
                    window.Add.MaxAndMinDayString = $" 最大天数:{window.Add.MaxDays}";
                }
                else if (_timeRule == MixedAlgoRuleEnum.MinDaysBetweenClassHours)
                {
                    window.Add.MaxAndMinDayString = $" 最小天数:{window.Add.MinDays}";
                }
            }
            else
            {
                window.Modify = new UIClassHourRule
                {
                    UID        = Guid.NewGuid().ToString(),
                    IsActive   = this.IsActive,
                    ClassHours = this.TargetHours?.ToList(),
                    Weight     = this.Weight,
                    MaxDays    = this.MaxDays,
                    MinDays    = this.MinDays,
                };

                if (_timeRule == MixedAlgoRuleEnum.MaxDaysBetweenClassHours)
                {
                    window.Add.MaxAndMinDayString = $" 最大天数:{window.Add.MaxDays}";
                }
                else if (_timeRule == MixedAlgoRuleEnum.MinDaysBetweenClassHours)
                {
                    window.Add.MaxAndMinDayString = $" 最小天数:{window.Add.MinDays}";
                }
            }

            window.DialogResult = true;
        }
示例#2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.win = ((OSKernel.Presentation.Arranging.Mixed.Modify.Algo.ClassHour.Dialog.CreateBetweenClassHours)(target));
                return;

            case 2:
                this.source_list = ((System.Windows.Controls.ListBox)(target));
                return;

            case 3:
                this.target_list = ((System.Windows.Controls.ListBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void cancel(object obj)
        {
            CreateBetweenClassHours window = obj as CreateBetweenClassHours;

            window.Close();
        }