Example #1
0
 public void copyProperties(IExpense other)
 {
     other.CheckArgument(nameof(other));
     BillID      = other.BillID;
     Designation = other.Designation;
     Amount      = other.Amount;
     Friend      = other.Friend;
 }
Example #2
0
        public void Add(IExpense expense)
        {
            expense.CheckArgument(nameof(expense));

            var entity = new Expense();

            entity.CopyProperties(expense);
            ExpenseEntities.Add(entity);
        }
Example #3
0
        public void Add(IExpense expense)
        {
            expense.CheckArgument(nameof(expense));

            var newItem = new Expense();

            newItem.CopyProperties(expense);
            ExpenseEntities.Add(newItem);
        }
Example #4
0
 public void CopyProperties(IExpense other)
 {
     other.CheckArgument(nameof(other));
     Id          = other.Id;
     TravelId    = other.TravelId;
     Date        = other.Date;
     Description = other.Description;
     Amount      = other.Amount;
     Friend      = other.Friend;
 }
Example #5
0
 public void CopyProperties(IExpense other)
 {
     other.CheckArgument(nameof(other));
     id          = other.id;
     Date        = other.Date;
     Title       = other.Title;
     Description = other.Description;
     Currency    = other.Currency;
     Friends     = other.Friends;
 }
Example #6
0
        public void Remove(IExpense expense)
        {
            expense.CheckArgument(nameof(expense));

            var entity = ExpenseEntities.FirstOrDefault(i => (i.Id != 0 && i.Id == expense.Id) ||
                                                        (i.Id == 0 && i.Designation != null && i.Designation.Equals(expense.Designation)));

            if (entity != null)
            {
                ExpenseEntities.Remove(entity);
            }
        }
Example #7
0
        public void Remove(IExpense expense)
        {
            expense.CheckArgument(nameof(expense));

            foreach (var item in ExpenseEntities)
            {
                if (item.Id != 0 && item.Id == expense.Id)
                {
                    ExpenseEntities.Remove(item);
                }
                else if (item.Designation != null && item.Designation.Equals(expense.Designation))
                {
                    ExpenseEntities.Remove(item);
                }
            }
        }