Пример #1
0
        private void Dg_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {
            UIMaxHoursDaily maxHours = e.Row.DataContext as UIMaxHoursDaily;

            if (maxHours != null)
            {
                maxHours.IsChecked = true;
            }
        }
        private void Dg_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
        {
            //MaxHours
            UIMaxHoursDaily cellEdit = e.Row.DataContext as UIMaxHoursDaily;

            if (cellEdit != null)
            {
                cellEdit.IsChecked = true;
            }
        }
        public void Initilize()
        {
            Messenger.Default.Register <HostView>(this, save);

            this.Comments = CommonDataManager.GetMixedRuleComments(MixedRuleEnum.TeacherMaxHoursDaily);

            var cl = base.GetClCase(base.LocalID);
            // 绑定教师
            int no = 0;
            List <UIMaxHoursDaily> rules = new List <UIMaxHoursDaily>();

            cl.Teachers.ForEach(t =>
            {
                UIMaxHoursDaily teacherRule = new UIMaxHoursDaily()
                {
                    MaxHours  = 1,
                    TeacherID = t.ID,
                    Teacher   = t.Name,
                    Courses   = cl.GetCourses(t.ID),
                    NO        = ++no,
                };
                rules.Add(teacherRule);
            });
            this.Rules = rules;

            // 绑定课程
            List <UICourseSetting> courses = new List <UICourseSetting>();

            cl.Courses.ForEach(c =>
            {
                UICourseSetting setting = new UICourseSetting();
                setting.ID     = c.ID;
                setting.Name   = c.Name;
                setting.Value  = 1;
                setting.Weight = 100;
                courses.Add(setting);
            });

            // 绑定教师状态
            var rule = base.GetClRule(base.LocalID);

            rule.MaxHoursDaily.ForEach(h =>
            {
                var first = this.Rules.FirstOrDefault(r => r.TeacherID.Equals(h.TeacherID));
                if (first != null)
                {
                    first.MaxHours  = h.MaxHour;
                    first.Weight    = (Models.Enums.WeightTypeEnum)h.Weight;
                    first.IsChecked = true;
                }
            });
        }
Пример #4
0
        public void Initilize()
        {
            this.Comments = CommonDataManager.GetAdminRuleComments(AdministrativeRuleEnum.TeacherMaxHoursDaily);

            Messenger.Default.Register <HostView>(this, save);

            var cp = CommonDataManager.GetCPCase(base.LocalID);
            // 绑定教师
            int no = 0;
            List <UIMaxHoursDaily> rules = new List <UIMaxHoursDaily>();

            cp.Teachers.ForEach(t =>
            {
                UIMaxHoursDaily teacherRule = new UIMaxHoursDaily()
                {
                    MaxHours  = 1,
                    TeacherID = t.ID,
                    Teacher   = t.Name,
                    Courses   = cp.GetCourses(t.ID),
                    NO        = ++no,
                };
                rules.Add(teacherRule);
            });
            this.Rules = rules;

            // 绑定教师状态
            var rule = CommonDataManager.GetAminRule(base.LocalID);

            rule.MaxHoursDaily.ForEach(h =>
            {
                var first = this.Rules.FirstOrDefault(r => r.TeacherID.Equals(h.TeacherID));
                if (first != null)
                {
                    first.MaxHours  = h.MaxHour;
                    first.Weight    = (WeightTypeEnum)h.Weight;
                    first.IsChecked = true;
                }
            });
        }
Пример #5
0
 void weightChanged(UIMaxHoursDaily maxHoursDaily)
 {
     maxHoursDaily.IsChecked = true;
 }