Exemple #1
0
        public ActionResult Index(double amount)
        {
            ExpenseManager expenseManager = new ExpenseManager();
            User           currentUser    = SetSession.GetCurrentUser();
            Expense        currentExpense = new Expense();

            currentExpense.UserId = currentUser.Id;
            currentExpense.Amount = amount;

            ViewBag.msg = expenseManager.AddDailyExpenses(currentExpense);

            return(View());
        }
Exemple #2
0
        public ActionResult Add(double amount)
        {
            if (amount <= 0)
            {
                ViewBag.msg = "Wrong Input or Lower Amount";
                return(View());
            }
            ExpenseManager expenseManager = new ExpenseManager();
            User           currentUser    = SetSession.GetCurrentUser();
            Expense        currentExpense = new Expense();

            currentExpense.UserId = currentUser.Id;
            currentExpense.Amount = amount;

            ViewBag.msg = expenseManager.AddDailyExpenses(currentExpense);

            return(View());
        }