public ClassRoomType GetReference(ClassRoomType extObj) { foreach (ClassRoomType item in ClassRoomsTypes) { if(((IDomainIdentity<ClassRoomType>)item).EqualsByParams(extObj) && ((IDomainIdentity<ClassRoomType>)item).EqualsByID(extObj)) { return item; } } return null; }
public string ExistTypeInFactors(ClassRoomType type) { CheckDataInFactors f = new CheckDataInFactors(eStorage); List<FactorSettings> factors= f.CheckType(type); string s = ""; if (factors.Count == 0) return s; else { foreach (var item in factors) { s += item.FactorName + ":" + item.UsersFactorName + "\n"; } } return s; }
public int ExistTypeInClassRoom(ClassRoomType type) { int count = 0; foreach (var item in eStorage.ClassRooms.ToList()) { if (item.ClassRoomTypes == null) return 0; foreach (var types in item.ClassRoomTypes.ToList()) { if (type == types) count++; } } return count; }
public int ExistClasses(string name, StudentSubGroup[] group, ClassRoomType[] type, Teacher[] teacher) { int count = 0; foreach (var item in eStorage.Classes.ToList()) { if ((item.Name.ToUpper() == name.ToUpper()) && (item.Teacher == teacher) && (item.RequireForClassRoom == type) && item.SubGroups == group) { count++; } } return count; }
public void EditType(ClassRoomType editType, string Description) { List<ClassRoomType> type = eStorage.ClassRoomsTypes.ToList(); int id = (int)((Domain.IDomainIdentity<ClassRoomType>)editType).ID; type.Remove(editType); type.Add(new ClassRoomType(id, Description)); eStorage = new Domain.Services.EntityStorage(eStorage.Classes.ToArray(), type.ToArray(), eStorage.StudentSubGroups.ToArray(), eStorage.Teachers.ToArray(), eStorage.ClassRooms.ToArray()); }
public void EditClasses(StudentsClass classes, string name, StudentSubGroup[] group, ClassRoomType[] type, Teacher[] teacher) { List<StudentsClass> Classes = eStorage.Classes.ToList(); int id = (int)((Domain.IDomainIdentity<StudentsClass>)classes).ID; Classes.Remove(classes); Classes.Add(new StudentsClass(id, group, teacher, name, type)); eStorage = new Domain.Services.EntityStorage(Classes.ToArray(), eStorage.ClassRoomsTypes.ToArray(), eStorage.StudentSubGroups.ToArray(), eStorage.Teachers.ToArray(), eStorage.ClassRooms.ToArray()); }
public void DelType(ClassRoomType delType) { List<ClassRoomType> type = eStorage.ClassRoomsTypes.ToList(); type.Remove(delType); eStorage = new Domain.Services.EntityStorage(eStorage.Classes.ToArray(), type.ToArray(), eStorage.StudentSubGroups.ToArray(), eStorage.Teachers.ToArray(), eStorage.ClassRooms.ToArray()); }
public void ADDClasses(string name, StudentSubGroup[] group, ClassRoomType[] type, Teacher[] teacher, int count) { List<StudentsClass> classes = eStorage.Classes.ToList(); int id = IdClasses(); for (int i = 0; i < count; i++) { classes.Add(new StudentsClass(id, group, teacher, name, type)); id++; } eStorage = new Domain.Services.EntityStorage(classes.ToArray(), eStorage.ClassRoomsTypes.ToArray(), eStorage.StudentSubGroups.ToArray(), eStorage.Teachers.ToArray(), eStorage.ClassRooms.ToArray()); }
public CheckingType(ClassRoomType Type, Visibility Visible, bool Checking) { this.Type = Type; this.Checking = Checking; this.Visible = Visible; this.Content = Type.Description; }
public List<FactorSettings> CheckType(ClassRoomType type) { this.Type = type; List<FactorSettings> usedFactors = new List<FactorSettings>(); Factors = FactorsEditors.GetUsersFactors(CurrentBase.Factors); foreach (FactorSettings factor in Factors) { if (factor.Data != null && factor.Data.GetType() == typeof(Dictionary<StudentsClass, List<ClassRoom>>)) { Dictionary<StudentsClass, List<ClassRoom>> t = (Dictionary<StudentsClass, List<ClassRoom>>)factor.Data; t = (Dictionary<StudentsClass, List<ClassRoom>>)FactorsEditors.RestoreLinks(t, store); bool ex = false; foreach (StudentsClass key in t.Keys) { foreach (ClassRoom itemClassR in t[key]) { if (itemClassR.ClassRoomTypes.Contains(Type) || key.RequireForClassRoom.Contains(Type)) { usedFactors.Add(factor); ex = true; break; } } if (ex) break; } } if (factor.Data != null && factor.Data.GetType() == typeof(List<FixedClasses>)) { List<FixedClasses> t = (List<FixedClasses>)factor.Data; t = (List<FixedClasses>)FactorsEditors.RestoreLinks(t, store); foreach (FixedClasses fixedClass in t) { if (fixedClass.Room.ClassRoomTypes.Contains(Type) || fixedClass.sClass.RequireForClassRoom.Contains(Type)) { usedFactors.Add(factor); break; } } } if (factor.Data != null && factor.Data.GetType() == typeof(Dictionary<Teacher, List<ClassRoom>>)) { Dictionary<Teacher, List<ClassRoom>> data = (Dictionary<Teacher, List<ClassRoom>>)factor.Data; data = (Dictionary<Teacher, List<ClassRoom>>)FactorsEditors.RestoreLinks(data, store); bool ex = false; foreach (List<ClassRoom> list in data.Values) { foreach (ClassRoom itemClassR in list) { if (itemClassR.ClassRoomTypes.Contains(Type)) { usedFactors.Add(factor); ex = true; break; } } if (ex) break; } } } return usedFactors; }