// GET: Transactions/Details/5
        public ActionResult Details(int id)
        {
            var data  = db.Get(id);
            var model = new Transactions(data);

            return(View(model));
        }
Exemple #2
0
        // GET: Schedule/Details/5
        public ActionResult Details(int id)
        {
            var data  = db.Get(id);
            var model = new Schedule(data);

            model.Transactions = new SqlDataServices <Data.Models.Transactions>().GetAll(model.ID, typeof(Schedule)).Select(e => new Transactions(e)).OrderBy(e => e.Date).ToList();
            return(View(model));
        }
Exemple #3
0
        // GET: Payee/Details/5
        public ActionResult Details(int id)
        {
            var data             = db.Get(id);
            var model            = new Payee(data);
            var transactionsData = new SqlDataServices <Data.Models.Transactions>().GetAll(id, typeof(Data.Models.Payee)).OrderBy(e => e.Date);

            foreach (var item in transactionsData)
            {
                model.Transactions.Add(new Transactions(item));
            }
            return(View(model));
        }
Exemple #4
0
        // GET api/<controller>/5
        public string Get(int id)
        {
            var data   = db.Get(id);
            int result = data.CategoryID;

            return(result.ToString());
        }
Exemple #5
0
        // GET api/<controller>/5
        public string Get(int id)
        {
            var    data = db.Get(id);
            string result;

            if (data.Type == Data.Enums.CategoryType.Income)
            {
                result = "Income";
            }
            else
            {
                result = "Expense";
            }
            return(result);
        }