Beispiel #1
0
        public static Payment Create(
            TransactionDescription description,
            DateTime transactionDate,
            PaymentType paymentType,
            Double amount,
            BudgetType budgetType,
            SpendType spendType,
            Note note,
            string chequeNumber,
            FundType fundType)
        {
            if (paymentType == null)
            {
                return(null);
            }
            if (budgetType == null)
            {
                return(null);
            }
            if (spendType == null)
            {
                return(null);
            }
            if (fundType == null)
            {
                return(null);
            }
            if (transactionDate == DateTime.MinValue)
            {
                return(null);
            }
            if (amount <= 0.00)
            {
                return(null);
            }
            if (!string.IsNullOrWhiteSpace(chequeNumber))
            {
                int result;
                if (!int.TryParse(chequeNumber, out result))
                {
                    return(null);
                }
            }

            return(new Payment(
                       description, transactionDate,
                       paymentType, amount, budgetType,
                       spendType, note, chequeNumber, fundType));
        }
Beispiel #2
0
 private Payment(
     TransactionDescription description,
     DateTime transactionDate,
     PaymentType paymentType,
     double amount,
     BudgetType budgetType,
     SpendType spendType,
     Note note,
     string chequeNumber,
     FundType fundType) :
     base(description, transactionDate,
          paymentType, amount, budgetType, note, fundType)
 {
     SpendType    = spendType;
     ChequeNumber = chequeNumber;
 }