using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TelerikMvcApp84.Models;

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

            List<OrderViewModel> orders = new List<OrderViewModel>();

            for (int i = 1; i < 50; i++)
            {
                OrderViewModel order = new OrderViewModel
                {
                    OrderID = i,
                    Freight = i * 10,
                    OrderDate = DateTime.Now.AddDays(i),
                    ShipName = "ShipName " + i,
                    ShipCity = "ShipCity " + i
                };

                orders.Add(order);
            }

            return View(orders);
        }
    }
}
