Example #1
0
 public static bool DeleteClass(Class SelectedClass)
 {
     try
     {
         DataAccessLayer.DeleteObject(SelectedClass);
         DataAccessLayer.SaveChanges(System.Data.Objects.SaveOptions.None);
     }
     catch (Exception ex)
     {
         string s = ex.ToString();
         DataAccessLayer.Refresh(System.Data.Objects.RefreshMode.StoreWins, SelectedClass);
         return false;
     }
     DataAccessLayer.Refresh(System.Data.Objects.RefreshMode.StoreWins, SelectedClass);
     return true;
 }
Example #2
0
 /// <summary>
 /// Create a new Class object.
 /// </summary>
 /// <param name="classId">Initial value of the ClassId property.</param>
 public static Class CreateClass(global::System.Int32 classId)
 {
     Class @class = new Class();
     @class.ClassId = classId;
     return @class;
 }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Classes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToClasses(Class @class)
 {
     base.AddObject("Classes", @class);
 }
Example #4
0
 public static int SaveClass(Class SelectedClass)
 {
     return DataAccessLayer.SaveChanges();
 }