private void PopulateGeneral(AbstractExpenseItem item) { var rDate = new DateTime(random.Next(7) + 2000, random.Next(12) + 1, random.Next(28) + 1); item.ModifyAmount(RandomAmount); //item.modifyDescription(item.[GetType()]().FullName + " " + rDate.ToString()) item.ModifyDateIncurred(rDate); item.ModifyProjectCode(RandomProjectCode); }
private AbstractExpenseItem CreateExpenseItem(Claim claim, ExpenseType type, DateTime dateIncurred, string description, decimal amount) { AbstractExpenseItem item = (claim.CreateNewExpenseItem(type)); item.ModifyDateIncurred(dateIncurred); item.ModifyDescription(description); item.ModifyAmount(Money(amount, claim)); return(item); }
public virtual void CopyAllExpenseItemsFromAnotherClaim([Named("Claim or Template")] Claim otherClaim, [Optionally, Named("New date to apply to all items"), Mask("d")] DateTime newDate) { for (int i = 0; i < otherClaim.ExpenseItems.Count; i++) { AbstractExpenseItem otherItem = (otherClaim.ExpenseItems[i]); AbstractExpenseItem newItem = CopyAnExistingExpenseItem(otherItem); newItem.ModifyDateIncurred(newDate); Container.Persist(ref newItem); } }