Ejemplo n.º 1
0
 public List<Account> GetAccount(Account account)
 {
     var accounts = (from p in context.Accounts
                     where p.Name == account.Name && p.CompanyID==account.CompanyID
                     select p).ToList();
     return accounts;
 }
Ejemplo n.º 2
0
 public void UpdateAccount(Account account)
 {
     try
     {
         var currentAccount = context.Accounts.Find(account.AccountID);
         context.Entry(currentAccount).CurrentValues.SetValues(account);
         SaveChanges();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
 public long InsertAccount(Account account)
 {
     context.Entry(account).State = EntityState.Added;
     SaveChanges();
     return account.AccountID;
 }