public void CategoryAccountDelete(Guid id) { CategoryAccount item = db.CategoryAccounts.FirstOrDefault(x => x.Id == id && x.Budget.Id == CurrentOwner.Id); db.CategoryAccounts.Remove(item); db.SaveChanges(); }
public CategoryAccount CategoryAccountAddUpdate(Guid?id, string name, string description) { CategoryAccount item = db.CategoryAccounts.FirstOrDefault(x => x.Id == id && x.Budget.Id == CurrentOwner.Id); if (item == null) { item = db.CategoryAccounts.Create(); item.Budget = CurrentOwner; db.CategoryAccounts.Add(item); } item.Name = name; item.Description = description; db.SaveChanges();; return(item); }
public Account AccountSaveAdd(Guid accountId, string name, Currency currency, CategoryAccount category, bool deleted, string description, decimal creditLimit) { return(AccountSaveAdd(accountId, name, currency.Id, category.Id, deleted, description, creditLimit, true)); }