示例#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.CreateClassHoursRequiredTimes)(target));
         return;
     }
     this._contentLoaded = true;
 }
        void save(object obj)
        {
            CreateClassHoursRequiredTimes window = obj as CreateClassHoursRequiredTimes;

            if (!this.Validate())
            {
                this.ShowDialog("提示信息", "学生、班级、课程 至少选择一个", DialogSettingType.OnlyOkButton, DialogType.Warning);
                return;
            }

            if (this.OpratorEnum == OperatorEnum.Add)
            {
                window.Add = new UIClassHourRule
                {
                    UID      = this.UID,
                    Weight   = this.Weight,
                    IsActive = this.IsActive,
                    Periods  = this.getTimes(),
                };

                window.Add.CourseID  = base.SelectCourse?.ID;
                window.Add.ClassID   = base.SelectClass?.ID;
                window.Add.TeacherID = base.SelectTeacher?.ID;
            }
            else
            {
                window.Modify = new UIClassHourRule
                {
                    UID      = this.UID,
                    Weight   = this.Weight,
                    IsActive = this.IsActive,
                    Periods  = this.getTimes(),
                };

                window.Modify.CourseID  = base.SelectCourse?.ID;
                window.Modify.ClassID   = base.SelectClass?.ID;
                window.Modify.TeacherID = base.SelectTeacher?.ID;
            }

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

            window.Close();
        }