Example #1
0
        public static Income Create(
            TransactionDescription description,
            DateTime transactionDate,
            PaymentType paymentType,
            Double amount,
            BudgetType budgetType,
            Note note,
            FundType fundType)
        {
            if (paymentType == null)
            {
                return(null);
            }
            if (budgetType == null)
            {
                return(null);
            }
            if (fundType == null)
            {
                return(null);
            }
            if (transactionDate == DateTime.MinValue)
            {
                return(null);
            }
            if (amount <= 0.00)
            {
                return(null);
            }

            return(new Income(
                       description, transactionDate,
                       paymentType, amount, budgetType, note, fundType));
        }
Example #2
0
 private Income(
     TransactionDescription description,
     DateTime transactionDate,
     PaymentType paymentType,
     double amount,
     BudgetType budgetType,
     Note note,
     FundType fundType) :
     base(description, transactionDate,
          paymentType, amount, budgetType, note, fundType)
 {
 }
Example #3
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));
        }
Example #4
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;
 }
 protected Transaction(
     TransactionDescription description,
     DateTime transactionDate,
     PaymentType paymentType,
     Double amount,
     BudgetType budgetType,
     Note note,
     FundType fundType
     ) : this()
 {
     Description = description;
     Date        = transactionDate;
     PaymentType = paymentType;
     BudgetType  = budgetType;
     Amount      = amount;
     Notes       = note;
     BankCleared = false;
     FundType    = fundType;
 }
 private FundType GetFund()
 {
     return(FundType.Create("Revenue", "Revenue"));
 }