using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcApplication3.Models;
using Telerik.Web.Mvc;
using Telerik.Web.Mvc.Extensions;
using Telerik.Web.Mvc.UI;
using System.ComponentModel;
using System.Web.Routing;
using System.IO;

namespace MvcApplication3.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View(Model());
        }

        [GridAction]
        public ActionResult _Index()
        {
            return View(new GridModel
            {
                Data = Model()
            });
        }

        public ActionResult Edit(int id)
        {
            ViewData["OrderID"] = id;

            return PartialView("Edit");
        }

        private IEnumerable<Orders> Model()
        {
            return new NorthwindEntities1().Orders;
        }
    }
}
