コード例 #1
0
 public COMPTA_Bank CreateBank(COMPTA_Bank bankToAdd)
 {
     using (SUPERPEntities context = new SUPERPEntities(false))
     {
         var bank = context.COMPTA_Bank.Add(bankToAdd);
         context.SaveChanges();
         return(bank);
     }
 }
コード例 #2
0
        public COMPTA_Bank EditBank(COMPTA_Bank bankToEdit)
        {
            using (SUPERPEntities context = new SUPERPEntities(false))
            {
                var bank = context.COMPTA_Bank.Find(bankToEdit.id);

                if (bank == null)
                {
                    return(null);
                }

                bank = bankToEdit;
                context.SaveChanges();
                return(bank);
            }
        }