public static bool DeleteKingdom(Kingdom SelectedKingdom) { try { DataAccessLayer.DeleteObject(SelectedKingdom); DataAccessLayer.SaveChanges(System.Data.Objects.SaveOptions.None); } catch (Exception ex) { string s = ex.ToString(); DataAccessLayer.Refresh(System.Data.Objects.RefreshMode.StoreWins, SelectedKingdom); return false; } DataAccessLayer.Refresh(System.Data.Objects.RefreshMode.StoreWins, SelectedKingdom); return true; }
/// <summary> /// Create a new Kingdom object. /// </summary> /// <param name="kingdomId">Initial value of the KingdomId property.</param> public static Kingdom CreateKingdom(global::System.Int32 kingdomId) { Kingdom kingdom = new Kingdom(); kingdom.KingdomId = kingdomId; return kingdom; }
/// <summary> /// Deprecated Method for adding a new object to the Kingdoms EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToKingdoms(Kingdom kingdom) { base.AddObject("Kingdoms", kingdom); }
public static int SaveKingdom(Kingdom SelectedKingdom) { return DataAccessLayer.SaveChanges(); }