Esempio n. 1
0
        public void New()
        {
            base.createNew((int)enums.ccCardType.VISACARD);

            using (var ctx = new AccContexts())
            using (var ts = new TransactionScope())
            {

                var newvisaCard = new visaCard()
                {
                    ccCardID = base.ccCardID
                };

                ctx.visaCard.AddObject(newvisaCard);
                ctx.SaveChanges();

                /*Reload object Props*/
                this.visaCardID = newvisaCard.ID;

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