예제 #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the departments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTodepartments(department department)
 {
     base.AddObject("departments", department);
 }
예제 #2
0
 /// <summary>
 /// Create a new department object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="facultyId">Initial value of the FacultyId property.</param>
 /// <param name="isDeleted">Initial value of the IsDeleted property.</param>
 public static department Createdepartment(global::System.Int64 id, global::System.String name, global::System.Int64 facultyId, global::System.Boolean isDeleted)
 {
     department department = new department();
     department.Id = id;
     department.Name = name;
     department.FacultyId = facultyId;
     department.IsDeleted = isDeleted;
     return department;
 }
예제 #3
0
파일: DBModel.cs 프로젝트: Deiwos3/IMS
 public void DeleteDepartment(department d)
 {
     CheckConnection();
     try
     {
         lock (locker)
         {
             d.IsDeleted = true;
             foreach (var i in d.studentsgroups)
                 DeleteStudentGroups(i);
             foreach (var i in d.ref_subject_department)
                 db.ref_subject_department.DeleteObject(i);
             foreach (var i in d.ref_teacher_department)
                 db.ref_teacher_department.DeleteObject(i);
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw new DBException(ErrorTypes.UnexpectedException, ex);
     }
 }
예제 #4
0
파일: DBModel.cs 프로젝트: Deiwos3/IMS
 public void EditDepartment(faculty f, department d, string name)
 {
     CheckConnection();
     try
     {
         lock (locker)
         {
             d.Name = name;
             d.FacultyId = f.Id;
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw new DBException(ErrorTypes.UnexpectedException, ex);
     }
 }
예제 #5
0
파일: DBModel.cs 프로젝트: Deiwos3/IMS
 public List<subject> GetSubjectsByDepartment(department d)
 {
     CheckConnection();
     try
     {
         lock (locker)
         {
             return d.ref_subject_department.Select(i => i.subject).ToList();
         }
     }
     catch (Exception ex)
     {
         throw new DBException(ErrorTypes.UnexpectedException, ex);
     }
 }
예제 #6
0
파일: DBModel.cs 프로젝트: Deiwos3/IMS
 public void EditStudentGroup(studentsgroup s, string newName, department d, DateTime dateIn, DateTime dateOut, int course)
 {
     CheckConnection();
     try
     {
         lock (locker)
         {
             s.Name = newName;
             s.DepartmentId = d.Id;
             s.DateIn = dateIn;
             s.DateOut = dateOut;
             s.Course = course;
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw new DBException(ErrorTypes.UnexpectedException, ex);
     }
 }
예제 #7
0
파일: DBModel.cs 프로젝트: Deiwos3/IMS
 public studentsgroup AddStudentGroup(string name, department d, DateTime dateIn, DateTime dateOut, int course)
 {
     CheckConnection();
     try
     {
         lock (locker)
         {
             studentsgroup s = studentsgroup.Createstudentsgroup(0, name, course, d.Id, dateIn, dateOut, false);
             db.studentsgroups.AddObject(s);
             db.SaveChanges();
             return s;
         }
     }
     catch (Exception ex)
     {
         throw new DBException(ErrorTypes.UnexpectedException, ex);
     }
 }