public void AddAccount(Account account) { var accountDao = Converter.Convert<Account, AccountDao>(account); dbContext.Accounts.Add(accountDao); dbContext.SaveChanges(); }
public void DeleteAccount(Account account) { var accountDao = dbContext.Accounts.Where(x => x.ClientId.Equals(account.ClientId) && x.Year.Equals(account.Year)).FirstOrDefault(x => x.Name.Equals(account.Name)); dbContext.Accounts.Remove(accountDao); dbContext.SaveChanges(); }
public ActionResult DeleteAccount(Account account) { _factory.GetAccoutnsService().DeleteAccount(account); return new JsonResult { Data = true }; }