コード例 #1
0
ファイル: DatabaseModel.Designer.cs プロジェクト: Deiwos3/IMS
 /// <summary>
 /// Deprecated Method for adding a new object to the faculties EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTofaculties(faculty faculty)
 {
     base.AddObject("faculties", faculty);
 }
コード例 #2
0
ファイル: DatabaseModel.Designer.cs プロジェクト: Deiwos3/IMS
 /// <summary>
 /// Create a new faculty object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="isDeleted">Initial value of the IsDeleted property.</param>
 public static faculty Createfaculty(global::System.Int64 id, global::System.String name, global::System.Boolean isDeleted)
 {
     faculty faculty = new faculty();
     faculty.Id = id;
     faculty.Name = name;
     faculty.IsDeleted = isDeleted;
     return faculty;
 }
コード例 #3
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);
     }
 }
コード例 #4
0
ファイル: DBModel.cs プロジェクト: Deiwos3/IMS
 public department AddDepartment(faculty f, string name)
 {
     CheckConnection();
     try
     {
         lock (locker)
         {
             department d = department.Createdepartment(0, name, f.Id, false);
             db.departments.AddObject(d);
             db.SaveChanges();
             return d;
         }
     }
     catch (Exception ex)
     {
         throw new DBException(ErrorTypes.UnexpectedException, ex);
     }
 }
コード例 #5
0
ファイル: DBModel.cs プロジェクト: Deiwos3/IMS
 public void DeleteFaculty(faculty f)
 {
     CheckConnection();
     try
     {
         lock (locker)
         {
             f.IsDeleted = true;
             foreach (var i in f.departments)
                 DeleteDepartment(i);
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw new DBException(ErrorTypes.UnexpectedException, ex);
     }
 }
コード例 #6
0
ファイル: DBModel.cs プロジェクト: Deiwos3/IMS
 public void EditFaculty(faculty f, string name)
 {
     CheckConnection();
     try
     {
         lock (locker)
         {
             f.Name = name;
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw new DBException(ErrorTypes.UnexpectedException, ex);
     }
 }