Example #1
0
        public DataTable GetExpenses(string pos, string id)
        {
            ExpenseRepository dataAccess = new ExpenseRepository();
            DataTable         datatable  = dataAccess.GetExpenses(pos, id);

            return(datatable);
        }
        /// <summary>
        /// Get Expenses
        /// </summary>
        /// <returns></returns>
        // GET: api/Expense
        public IHttpActionResult Get()
        {
            ExpenseRepository ExpenseRepository = new ExpenseRepository(Convert.ToInt32(Request.Headers.GetValues("CurrentUserID").First()));

            List <Expense> ExpenseList = ExpenseRepository.GetExpenses();

            return(Json(new { Expenses = ExpenseList }));
        }
Example #3
0
        public ActionResult ExpenseManager()
        {
            ViewData["Message"] = "Your expense manager page.";
            var expenseRepository = new ExpenseRepository();
            var expenses          = expenseRepository.GetExpenses();

            return(View(expenses));
        }
        protected override void OnLoad(EventArgs e)
        {
            var user = (User)this.Session["LoggedUser"];

            var repository = new ExpenseRepository();
            var expenses   = repository.GetExpenses(user.Id);

            this.MyExpensesGridView.DataSource = expenses;
            this.DataBind();

            base.OnLoad(e);
        }