Exemplo n.º 1
0
 public DropItem(string key, Type typekey, PairInfo info)
 {
     Key     = key;
     KeyType = typekey;
     Info    = info;
     Item    = new DropInformation();
 }
Exemplo n.º 2
0
        public DropItem(object key, Type typekey, PairInfo info)
        {
            Key     = key;
            KeyType = typekey;
            Info    = info;

            state    = this.Factory.Backing(nameof(State), 0);
            n_dIndex = this.Factory.Backing(nameof(N_DIndex), 0);
            item     = this.Factory.Backing(nameof(Item), new DropInformation());
            itemTwo  = this.Factory.Backing(nameof(ItemTwo), new DropInformation());
            isValid  = this.Factory.Backing(nameof(IsValueValid), false);
        }
Exemplo n.º 3
0
        public void Init()
        {
            var limit = SheduleSettings.WeekDayMaxCount;

            IEnumerable <Group> ifiltered = ClassGroups.ToArray();

            if (DepartmentIndex != -1)
            {
                ifiltered =
                    ClassGroups
                    .Where(x => x.CodeOfDepartment == ClassDepartments[DepartmentIndex].CodeOfDepartment).ToArray();
            }
            foreach (var row in Data)
            {
                row.Clear();
            }
            filtered = ifiltered.ToArray();

            IEnumerable <Teacher> ifilteredteacher = ClassTeachers.ToArray();

            if (DepartmentIndex != -1)
            {
                ifilteredteacher =
                    ClassTeachers
                    .Where(x => x.CodeOfDepartment == ClassDepartments[DepartmentIndex].CodeOfDepartment).ToArray();
            }
            filteredTeacher = ifilteredteacher.ToArray();

            IEnumerable <ClassRoom> ifilteredclassroom = ClassClassrooms.ToArray();

            if (DepartmentIndex != -1)
            {
                ifilteredclassroom =
                    ClassClassrooms
                    .Where(x => x.CodeOfDepartment == ClassDepartments[DepartmentIndex].CodeOfDepartment).ToArray();
            }
            filteredClassroom = ifilteredclassroom.ToArray();

            for (int i = 0; i < filtered.Length; i++)
            {
                int j = 0;
                foreach (DayOfWeek week in Enum.GetValues(typeof(DayOfWeek)))
                {
                    if (week == DayOfWeek.Sunday)
                    {
                        continue;
                    }
                    if (week == DayOfWeek.Saturday)
                    {
                        limit = SheduleSettings.SaturdayMaxCount;
                    }
                    else
                    {
                        limit = SheduleSettings.WeekDayMaxCount;
                    }

                    for (int k = 0; k < limit; k++)
                    {
                        var pair = new PairInfo(k + 1, week);
                        Data[j].Add(new DropItem(filtered[i].NameOfGroup, typeof(Group), pair)
                        {
                            Item = new DropInformation {
                                Group = filtered[i].NameOfGroup
                            }
                        });
                        j++;
                    }
                }
            }
            Columns.Clear();
            foreach (var key in Data.First().Select(x => x.Key))
            {
                Columns.Add(key);
            }
            Rows.Clear();
            if (filtered.Length != 0)
            {
                foreach (var row in (Data.Select(x => x[0].Info)))
                {
                    Rows.Add(row);
                }
            }
            if (ch != 0)
            {
                Transform(ch);
            }
        }