Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 public static int SaveClass(Class SelectedClass)
 {
     return DataAccessLayer.SaveChanges();
 }