using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ClientExpressionInHierarchy.Models;
using Telerik.Web.Mvc;

namespace ClientExpressionInHierarchy.Controllers
{
    public class HomeController : Controller
    {
        private LoansDBEntities context = new LoansDBEntities();

        [GridAction]
        public ActionResult _LoandsHierarchy()
        {
            return View(new GridModel(context.Loans));
        }

        [GridAction]
        public ActionResult _PropertiesHierarchyAjax(int id)
        {
            return View(new GridModel(context.Properties.Where(p => p.LoanID == id)));
        }

        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";

            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
