Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 /// <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;
 }
Esempio n. 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Kingdoms EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToKingdoms(Kingdom kingdom)
 {
     base.AddObject("Kingdoms", kingdom);
 }
Esempio n. 4
0
 public static int SaveKingdom(Kingdom SelectedKingdom)
 {
     return DataAccessLayer.SaveChanges();
 }