void getBase(OperatorEnum opratorEnum, AdministrativeAlgoRuleEnum timeRule)
        {
            base.OpratorEnum = opratorEnum;
            this._timeRule   = timeRule;
            this.TitleString = $"{ opratorEnum.GetLocalDescription()}-{timeRule.GetLocalDescription()}";
            this.RaisePropertyChanged(() => ShowRead);
            this.RaisePropertyChanged(() => ShowEdit);
            this.RaisePropertyChanged(() => ShowMaxNumber);
            this.RaisePropertyChanged(() => ShowSameMaxNumber);

            var cp = CommonDataManager.GetCPCase(base.LocalID);

            this.Sources = cp.GetClassHours(cp.ClassHours.Select(ch => ch.ID)?.ToArray());

            var results = new List <UITwoStatusWeek>();
            var groups  = cp.Positions.GroupBy(p => p.DayPeriod.Period);

            if (groups != null)
            {
                foreach (var g in groups)
                {
                    var             first = g.First();
                    UITwoStatusWeek week  = new UITwoStatusWeek()
                    {
                        Period       = first.DayPeriod,
                        PositionType = first.Position,
                    };
                    week.SetStatus(true);
                    results.Add(week);
                }
            }
            this.Periods = results;

            this.Search();
        }
        void getBase(OperatorEnum opratorEnum, MixedAlgoRuleEnum timeRule)
        {
            base.OpratorEnum = opratorEnum;
            this._timeRule   = timeRule;
            this.TitleString = $"{ opratorEnum.GetLocalDescription()}-{timeRule.GetLocalDescription()}";
            this.RaisePropertyChanged(() => ShowRead);
            this.RaisePropertyChanged(() => ShowEdit);

            var cl = base.GetClCase(base.LocalID);

            var results = new List <UITwoStatusWeek>();
            var groups  = cl.Positions.GroupBy(p => p.DayPeriod.Period);

            if (groups != null)
            {
                foreach (var g in groups)
                {
                    var             first = g.First();
                    UITwoStatusWeek week  = new UITwoStatusWeek()
                    {
                        Period       = first.DayPeriod,
                        PositionType = first.Position,
                    };
                    week.SetStatus(true);
                    results.Add(week);
                }
            }

            this.Periods = results;
            this.Search();
        }
Ejemplo n.º 3
0
        void getBase(OperatorEnum opratorEnum, AdministrativeAlgoRuleEnum timeRule)
        {
            base.OpratorEnum = opratorEnum;
            this.TitleString = $"{ opratorEnum.GetLocalDescription()}-{timeRule.GetLocalDescription()}";
            this.RaisePropertyChanged(() => ShowRead);
            this.RaisePropertyChanged(() => ShowEdit);

            var cp = CommonDataManager.GetCPCase(base.LocalID);

            this.Teachers = cp.Teachers.Select(t =>
            {
                return(new UITeacher()
                {
                    ID = t.ID,
                    Name = t.Name
                });
            })?.ToList();

            this.SelectTeacher = this.Teachers.FirstOrDefault();

            var results = new List <UITwoStatusWeek>();
            var groups  = cp.Positions.GroupBy(p => p.DayPeriod.Period);

            if (groups != null)
            {
                foreach (var g in groups)
                {
                    var             first = g.First();
                    UITwoStatusWeek week  = new UITwoStatusWeek()
                    {
                        Period       = first.DayPeriod,
                        PositionType = first.Position,
                    };
                    week.SetStatus(true);
                    results.Add(week);
                }
            }
            this.Periods = results;
        }
        public void Initilize()
        {
            CLCase clModel = CommonDataManager.GetCLCase(base.LocalID);

            var results = new List <UITwoStatusWeek>();
            var groups  = clModel.Positions.GroupBy(p => p.DayPeriod.Period);

            if (groups != null)
            {
                foreach (var g in groups)
                {
                    var             first = g.First();
                    UITwoStatusWeek week  = new UITwoStatusWeek()
                    {
                        Period       = first.DayPeriod,
                        PositionType = first.Position,
                    };
                    week.SetStatus(true);

                    if (first.Position != XYKernel.OS.Common.Enums.Position.AB &&
                        first.Position != XYKernel.OS.Common.Enums.Position.PB &&
                        first.Position != XYKernel.OS.Common.Enums.Position.Noon)
                    {
                        g.ToList().ForEach(gg =>
                        {
                            if (gg.DayPeriod.Day == DayOfWeek.Monday)
                            {
                                week.Monday.IsChecked = gg.IsSelected;
                            }
                            else if (gg.DayPeriod.Day == DayOfWeek.Tuesday)
                            {
                                week.Tuesday.IsChecked = gg.IsSelected;
                            }
                            else if (gg.DayPeriod.Day == DayOfWeek.Wednesday)
                            {
                                week.Wednesday.IsChecked = gg.IsSelected;
                            }
                            else if (gg.DayPeriod.Day == DayOfWeek.Thursday)
                            {
                                week.Thursday.IsChecked = gg.IsSelected;
                            }
                            else if (gg.DayPeriod.Day == DayOfWeek.Friday)
                            {
                                week.Friday.IsChecked = gg.IsSelected;
                            }
                            else if (gg.DayPeriod.Day == DayOfWeek.Saturday)
                            {
                                week.Saturday.IsChecked = gg.IsSelected;
                            }
                            else if (gg.DayPeriod.Day == DayOfWeek.Sunday)
                            {
                                week.Sunday.IsChecked = gg.IsSelected;
                            }
                        });
                    }

                    results.Add(week);
                }
            }
            this.Periods = results;
        }
Ejemplo n.º 5
0
        void getBase(OperatorEnum opratorEnum, MixedAlgoRuleEnum timeRule)
        {
            base.OpratorEnum = opratorEnum;
            this.TitleString = $"{ opratorEnum.GetLocalDescription()}-{timeRule.GetLocalDescription()}";
            this.RaisePropertyChanged(() => ShowRead);
            this.RaisePropertyChanged(() => ShowEdit);

            var cl = base.GetClCase(base.LocalID);

            this.Teachers = cl.Teachers.Select(t =>
            {
                return(new UITeacher()
                {
                    ID = t.ID,
                    Name = t.Name
                });
            })?.ToList();

            this.SelectTeacher = this.Teachers.FirstOrDefault();

            var results = new List <UITwoStatusWeek>();
            var groups  = cl.Positions.GroupBy(p => p.DayPeriod.Period);

            if (groups != null)
            {
                foreach (var g in groups)
                {
                    var             first = g.First();
                    UITwoStatusWeek week  = new UITwoStatusWeek()
                    {
                        Period       = first.DayPeriod,
                        PositionType = first.Position,
                    };
                    week.SetStatus(true);

                    if (first.Position != XYKernel.OS.Common.Enums.Position.AB &&
                        first.Position != XYKernel.OS.Common.Enums.Position.PB &&
                        first.Position != XYKernel.OS.Common.Enums.Position.Noon)
                    {
                        g.ToList().ForEach(gg =>
                        {
                            if (gg.DayPeriod.Day == DayOfWeek.Monday)
                            {
                                week.Monday.IsChecked = gg.IsSelected;
                            }
                            else if (gg.DayPeriod.Day == DayOfWeek.Tuesday)
                            {
                                week.Tuesday.IsChecked = gg.IsSelected;
                            }
                            else if (gg.DayPeriod.Day == DayOfWeek.Wednesday)
                            {
                                week.Wednesday.IsChecked = gg.IsSelected;
                            }
                            else if (gg.DayPeriod.Day == DayOfWeek.Thursday)
                            {
                                week.Thursday.IsChecked = gg.IsSelected;
                            }
                            else if (gg.DayPeriod.Day == DayOfWeek.Friday)
                            {
                                week.Friday.IsChecked = gg.IsSelected;
                            }
                            else if (gg.DayPeriod.Day == DayOfWeek.Saturday)
                            {
                                week.Saturday.IsChecked = gg.IsSelected;
                            }
                            else if (gg.DayPeriod.Day == DayOfWeek.Sunday)
                            {
                                week.Sunday.IsChecked = gg.IsSelected;
                            }
                        });
                    }

                    results.Add(week);
                }
            }
            this.Periods = results;
        }