// -- [NonSerialized] // -- public bool Changed; public new void Add(Semester item) { if (base.Exists(x => x.ToString().Trim() == item.ToString().Trim())) { throw new Exception($"Семестр \"{item}\" уже существует!"); } base.Add(item); base.Sort(); // -- Changed = true; // добавлено 29.06.2019 if (!Loaded) { return; } var server = new OleDbServer { Connection = Helper.ConnectionString }; var columns = new Dictionary <string, object> { { "IdSemester", "P" + item.IdSemester.ToString() }, { "Number", item.Number } }; server.InsertInto("Semesters", columns); if (!string.IsNullOrWhiteSpace(server.LastError)) { throw new Exception(server.LastError); } }
// -- [NonSerialized] // -- public bool Changed; public new void Add(Teacher item) { if (base.Exists(x => x.ToString().Trim() == item.ToString().Trim())) { throw new Exception($"Преподаватель \"{item}\" уже существует!"); } base.Add(item); base.Sort(); // -- Changed = true; // добавлено 29.06.2019 if (!Loaded) { return; } var server = new OleDbServer { Connection = Helper.ConnectionString }; var columns = new Dictionary <string, object> { { "IdTeacher", "P" + item.IdTeacher.ToString() }, { "FullName", item.FullName }, { "IdMatter", "P" + item.IdMatter.ToString() }, { "Login", item.Login }, { "Password", item.Password } }; server.InsertInto("Teachers", columns); if (!string.IsNullOrWhiteSpace(server.LastError)) { throw new Exception(server.LastError); } }
// -- [NonSerialized] // -- public bool Changed; public new void Add(Performance item) { if (base.Exists(x => x.ToString().Trim() == item.ToString().Trim())) { throw new Exception($"Успеваемость \"{item}\" уже существует!"); } base.Add(item); base.Sort(); // -- Changed = true; // добавлено 29.06.2019 if (!Loaded) { return; } var server = new OleDbServer { Connection = Helper.ConnectionString }; var columns = new Dictionary <string, object> { { "IdPerformance", "P" + item.IdPerformance.ToString() }, { "IdSemester", "P" + item.IdSemester.ToString() }, { "IdMatter", "P" + item.IdMatter.ToString() }, { "Grade", item.Grade }, { "IdStudent", "P" + item.IdStudent.ToString() } }; server.InsertInto("Performances", columns); if (!string.IsNullOrWhiteSpace(server.LastError)) { throw new Exception(server.LastError); } }
public new void Add(Student item) { base.Add(item); base.Sort(); if (!Loaded) { return; } var server = new OleDbServer { Connection = Helper.ConnectionString }; var columns = new Dictionary <string, object> { { "IdStudent", "P" + item.IdStudent.ToString() }, { "FullName", item.FullName }, { "BirthDay", item.BirthDay }, { "EducationCertificate", item.EducationCertificate }, { "ReceiptDate", item.ReceiptDate }, { "Address", item.Address }, { "PhoneNumber", item.PhoneNumber }, { "SocialStatus", item.SocialStatus }, { "Notes", item.Notes }, { "Photo", item.Photo ?? new byte[] { } }, { "IdSpeciality", "P" + item.IdSpeciality.ToString() }, { "IdSpecialization", "P" + item.IdSpecialization.ToString() }, { "IdStudyGroup", "P" + item.IdStudyGroup.ToString() } }; server.InsertInto("Students", columns); if (!string.IsNullOrWhiteSpace(server.LastError)) { throw new Exception(server.LastError); } }
public new void Add(Semester item) { if (base.Exists(x => x.ToString().Trim() == item.ToString().Trim())) { throw new Exception($"Семестр \"{item}\" уже существует!"); } else { base.Add(item); } base.Sort(); if (!Loaded) { return; } var server = new OleDbServer { Connection = Helper.ConnectionString }; var columns = new Dictionary <string, object> { { "IdSemester", "P" + item.IdSemester.ToString() }, { "Number", item.Number } }; server.InsertInto("Semesters", columns); }
public new void Add(Matter item) { if (base.Exists(x => x.ToString().Trim() == item.ToString().Trim())) { throw new Exception($"Предмет \"{item}\" уже существует!"); } else { base.Add(item); } base.Sort(); if (!Loaded) { return; } var server = new OleDbServer { Connection = Helper.ConnectionString }; var columns = new Dictionary <string, object> { { "IdMatter", "P" + item.IdMatter.ToString() }, { "Name", item.Name } }; server.InsertInto("Matters", columns); if (!string.IsNullOrWhiteSpace(server.LastError)) { throw new Exception(server.LastError); } }
public new void Add(StudyGroup item) { if (base.Exists(x => x.ToString().Trim() == item.ToString().Trim())) { throw new Exception($"Группа \"{item}\" уже существует!"); } base.Add(item); base.Sort(); if (!Loaded) { return; } var server = new OleDbServer { Connection = Helper.ConnectionString }; var columns = new Dictionary <string, object> { { "IdStudyGroup", "P" + item.IdStudyGroup.ToString() }, { "Number", item.Number }, { "TrainingPeriod", item.TrainingPeriod }, { "IdSpeciality", "P" + item.IdSpeciality.ToString() }, { "IdSpecialization", "P" + item.IdSpecialization.ToString() } }; server.InsertInto("StudyGroups", columns); if (!string.IsNullOrWhiteSpace(server.LastError)) { throw new Exception(server.LastError); } }
public new void Add(MattersCourse item) { if (base.Exists(x => x.ToString().Trim() == item.ToString().Trim())) { throw new Exception($"Курс \"{item}\" уже существует!"); } base.Add(item); base.Sort(); if (!Loaded) { return; } var server = new OleDbServer { Connection = Helper.ConnectionString }; var columns = new Dictionary <string, object> { { "IdMattersCourse", "P" + item.IdMatter.ToString() }, { "IdSpeciality", "P" + item.IdSpeciality.ToString() }, { "IdSpecialization", "P" + item.IdSpecialization.ToString() }, { "IdMatter", "P" + item.IdMatter.ToString() }, { "CourseType", item.CourseType }, { "RatingSystem", item.RatingSystem }, { "HoursCount", item.HoursCount } }; server.InsertInto("MattersCourses", columns); }
public new void Add(Speciality item) { if (base.Exists(x => x.ToString().Trim() == item.ToString().Trim())) { throw new Exception($"Специальность \"{item}\" уже существует!"); } base.Add(item); base.Sort(); if (!Loaded) { return; } var server = new OleDbServer { Connection = Helper.ConnectionString }; var columns = new Dictionary <string, object> { { "IdSpeciality", "P" + item.IdSpeciality.ToString() }, { "Name", item.Name }, { "Number", item.Number } }; server.InsertInto("Specialities", columns); if (!string.IsNullOrWhiteSpace(server.LastError)) { throw new Exception(server.LastError); } }
// -- [NonSerialized] // -- public bool Changed; public new void Add(Student item) { // -- Допускаются студенты с одиковым полным именем // -- if (base.Exists(x => x.ToString().Trim() == item.ToString().Trim())) // -- throw new Exception($"Студент \"{item}\" уже существует!"); base.Add(item); base.Sort(); // -- Changed = true; // добавлено 29.06.2019 if (!Loaded) { return; } var server = new OleDbServer { Connection = Helper.ConnectionString }; var columns = new Dictionary <string, object> { { "IdStudent", "P" + item.IdStudent.ToString() }, { "FullName", item.FullName }, { "BirthDay", item.BirthDay }, { "EducationCertificate", item.EducationCertificate }, { "ReceiptDate", item.ReceiptDate }, { "Address", item.Address }, { "PhoneNumber", item.PhoneNumber }, { "SocialStatus", item.SocialStatus }, { "Notes", item.Notes }, { "Photo", item.Photo ?? new byte[] { } }, { "IdSpeciality", "P" + item.IdSpeciality.ToString() }, { "IdSpecialization", "P" + item.IdSpecialization.ToString() }, { "IdStudyGroup", "P" + item.IdStudyGroup.ToString() } }; server.InsertInto("Students", columns); if (!string.IsNullOrWhiteSpace(server.LastError)) { throw new Exception(server.LastError); } }