Пример #1
0
 private static bool AddBudgetRecord(BudgetRecord budgetRecord)
 {
     BudgetCollection.Insert(budgetRecord);
     UpdateIndex(budgetRecord.RecordType == RecordTypeEnum.Income ? budgetRecord.Amount : -budgetRecord.Amount,
                 budgetRecord.Date);
     return(true);
 }
Пример #2
0
        public static BudgetRecord GetNewRecord(double amount, RecordTypeEnum recordType, bool regularRecord = false, string description = "")
        {
            var budgetRecord = new BudgetRecord()
            {
                Date        = DateTime.Now,
                IsActive    = true,
                Amount      = amount,
                RecordType  = recordType,
                Description = description
            };

            return(budgetRecord);
        }
Пример #3
0
        public static bool AddIncome(double ammount, string description = "")
        {
            var newRecord = BudgetRecord.GetNewRecord(ammount, RecordTypeEnum.Income, false, description);

            return(AddBudgetRecord(newRecord));
        }