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; }
/// <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; }
/// <summary> /// Deprecated Method for adding a new object to the Classes EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToClasses(Class @class) { base.AddObject("Classes", @class); }
public static int SaveClass(Class SelectedClass) { return DataAccessLayer.SaveChanges(); }