Exemple #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.win = ((OSKernel.Presentation.Arranging.Administrative.Modify.Algo.ClassHour.Dialog.CreateRequiredStartingTime)(target));
                return;

            case 2:
                this.filterControl = ((OSKernel.Presentation.Arranging.Administrative.Modify.Algo.ClassHour.Dialog.FilterView)(target));
                return;

            case 3:
                this.cb_checked = ((System.Windows.Controls.CheckBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void save(object obj)
        {
            CreateRequiredStartingTime window = obj as CreateRequiredStartingTime;

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

            if (this.OpratorEnum == OperatorEnum.Add)
            {
                if (this.SelectClassHour == null)
                {
                    return;
                }

                window.Add = new UIClassHourRule
                {
                    UID      = Guid.NewGuid().ToString(),
                    IsActive = this.IsActive,
                    Period   = this.SelectPeriod,
                    Day      = this.SelectDay,
                    FirstID  = this.SelectClassHour.ID,
                    Weight   = this.Weight
                };
                window.Add.Period.Day = this.SelectDay;
            }
            else
            {
                window.Modify = new UIClassHourRule
                {
                    UID      = Guid.NewGuid().ToString(),
                    IsActive = this.IsActive,
                    Period   = this.SelectPeriod,
                    Day      = this.SelectDay,
                    FirstID  = this.SelectClassHour.ID,
                    Weight   = this.Weight
                };
                window.Modify.Period.Day = this.SelectDay;
            }

            window.DialogResult = true;
        }
        void cancel(object obj)
        {
            CreateRequiredStartingTime window = obj as CreateRequiredStartingTime;

            window.Close();
        }