예제 #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));
        }
예제 #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)
 {
 }
예제 #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));
        }
예제 #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;
 }
예제 #5
0
 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;
 }
예제 #6
0
 public virtual void UpdateDescription(TransactionDescription description)
 {
     Description = description;
 }