// GET: Transactions/Details/5 public ActionResult Details(int id) { var data = db.Get(id); var model = new Transactions(data); return(View(model)); }
// 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)); }
// 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)); }
// GET api/<controller>/5 public string Get(int id) { var data = db.Get(id); int result = data.CategoryID; return(result.ToString()); }
// 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); }