using AjaxContentParameter.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Kendo.Mvc.Extensions;
using Kendo.Mvc.UI;
namespace AjaxContentParameter.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to kick-start your ASP.NET MVC application.";

            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }

        public ActionResult CustomCommand_Read([DataSourceRequest] DataSourceRequest request)
        {
           
            List<EmployeeModel> employees = new List<EmployeeModel>();

            employees.Add(new EmployeeModel(){ EmployeeID= 1, FirstName="John", LastName="Doe" });
            employees.Add(new EmployeeModel(){ EmployeeID= 2, FirstName="Jane", LastName="Doe" });
            return Json(employees.ToDataSourceResult(request));
        }
    }
}
