コード例 #1
0
        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();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 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));
 }