Esempio n. 1
0
        public void New()
        {
            using (var ctx = new AccContexts())
            using (var ts = new TransactionScope())
            {
                base.createNew((int)enums.ccCardType.MASTERCARD);

                var newmcCard = new mcCard()
                {
                    ccCardID = base.ccCardID
                };

                ctx.mcCard.AddObject(newmcCard);
                ctx.SaveChanges();

                /*Reload object Props*/
                this.mcCardID = newmcCard.ID;
                this.ccCardID = (int)newmcCard.ccCardID;

                ts.Complete();
            }
        }
 /// <summary>
 /// Create a new mcCard object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static mcCard CreatemcCard(global::System.Int32 id)
 {
     mcCard mcCard = new mcCard();
     mcCard.ID = id;
     return mcCard;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the mcCard EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTomcCard(mcCard mcCard)
 {
     base.AddObject("mcCard", mcCard);
 }