/// <summary> /// Create a new Group object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="groupAbbreviation">Initial value of the GroupAbbreviation property.</param> /// <param name="cource">Initial value of the Cource property.</param> /// <param name="studCount">Initial value of the StudCount property.</param> /// <param name="specialtyAbbreviation">Initial value of the SpecialtyAbbreviation property.</param> /// <param name="studyTypeId">Initial value of the StudyTypeId property.</param> /// <param name="facultyId">Initial value of the FacultyId property.</param> /// <param name="fieldOfStudyId">Initial value of the FieldOfStudyId property.</param> public static Group CreateGroup(global::System.Int32 id, global::System.String groupAbbreviation, global::System.Int32 cource, global::System.Int32 studCount, global::System.String specialtyAbbreviation, global::System.Int32 studyTypeId, global::System.Int32 facultyId, global::System.Int32 fieldOfStudyId) { Group group = new Group(); group.Id = id; group.GroupAbbreviation = groupAbbreviation; group.Cource = cource; group.StudCount = studCount; group.SpecialtyAbbreviation = specialtyAbbreviation; group.StudyTypeId = studyTypeId; group.FacultyId = facultyId; group.FieldOfStudyId = fieldOfStudyId; return group; }
/// <summary> /// Deprecated Method for adding a new object to the Groups EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToGroups(Group group) { base.AddObject("Groups", group); }
public void Import() { using (UniversitySheduleContainer cnt = new UniversitySheduleContainer("name=UniversitySheduleContainer")) { foreach (var g in readedgroups) { if (g.Add) { Group newGroup = new Group() { GroupAbbreviation = g.groupCode, Cource = g.course, StudCount = g.studentAmount, SpecialtyAbbreviation = g.specCode, StudyTypeId = g.studyForm, FieldOfStudyId = g.studyDirection, FacultyId = 1, }; cnt.Groups.AddObject(newGroup); } } cnt.SaveChanges(); } }