using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GirdCustomPopup.Models;
using Kendo.Mvc.Extensions;
using Kendo.Mvc.UI;

namespace GirdCustomPopup.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";

            return View();
        }

        public ActionResult Read([DataSourceRequest] DataSourceRequest request)
        {
            var data = Enumerable.Range(1, 100).Select(i => new Model
            {
                Id = i, 
                Name = "Name " + i,
                ItemName = "ItemName " + i,
                IsSystemDefined = i %2 == 0
            });

            return Json(data.ToDataSourceResult(request));
        }

    }
}
