Example #1
0
        /// <summary>
        /// create new bank w/ optioanl addressing
        /// </summary>
        /// <param name="name"></param>
        /// <param name="address"></param>
        public void New(string name, Address address = null)
        {
            using (var ctx = new AccContexts())
            {
                base.New((int)enums.entityType.bank);

                var _newBank = new AccountingLib.Models.bank()
                {
                    name     = name,
                    entityID = base.ENTITYID
                };
                ctx.bank.AddObject(_newBank);
                ctx.SaveChanges();

                if (address != null)
                {
                }

                /*Update Class props*/
                this.bankID   = _newBank.ID;
                this.bankName = _newBank.name;
            }
        }
Example #2
0
        /// <summary>
        /// create new bank w/ optioanl addressing
        /// </summary>
        /// <param name="name"></param>
        /// <param name="address"></param>
        public void New(string name,Address address=null)
        {
            using (var ctx = new AccContexts())
            {
                base.New((int)enums.entityType.bank);

                var _newBank = new AccountingLib.Models.bank()
                {
                    name=name,
                    entityID=base.ENTITYID
                };
                ctx.bank.AddObject(_newBank);
                ctx.SaveChanges();

                if (address != null)
                {

                }

                /*Update Class props*/
                this.bankID = _newBank.ID;
                this.bankName = _newBank.name;
            }
        }
 /// <summary>
 /// Create a new bank object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static bank Createbank(global::System.Int32 id)
 {
     bank bank = new bank();
     bank.ID = id;
     return bank;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the bank EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTobank(bank bank)
 {
     base.AddObject("bank", bank);
 }