public void New() { using (var ctx = new AccContexts()) using (var ts = new TransactionScope()) { base.createNew((int)enums.cardType.DebitCard); var newDBCard = new AccountingLib.Models.dbCard() { cardID = base.cardID, cardTypeID = this.CARDTYPEID }; ctx.dbCard.AddObject(newDBCard); ctx.SaveChanges(); /*reload object props*/ this.dbCardID = newDBCard.ID; ts.Complete(); } }
/// <summary> /// Create a new dbCard object. /// </summary> /// <param name="id">Initial value of the ID property.</param> public static dbCard CreatedbCard(global::System.Int32 id) { dbCard dbCard = new dbCard(); dbCard.ID = id; return dbCard; }
/// <summary> /// Deprecated Method for adding a new object to the dbCard EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTodbCard(dbCard dbCard) { base.AddObject("dbCard", dbCard); }