using System.Collections.Generic;
using System.Web.Mvc;
using AspNetMvc.Demo.WebHost.Models;

namespace AspNetMvc.Demo.WebHost.Controllers
{
    public class OrderController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

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

        public ActionResult IfConstruct()
        {
            var product = new Product
                {
                    Name = "Foo",
                    Price = 100
                };
            return View(product); 

        }

        public ActionResult EachAttr()
        {
            var products = new List<Product>(); 
            for (int i = 1; i <= 5; i++)
            {
                products.Add(new Product {Name = "Item" + i, Price = i * 3}); 
            }
            return View(products);
        }

        public ActionResult DifferentMaster()
        {
            return View("DifferentMaster", "External"); 
        }

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

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

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

        public ActionResult Customers()
        {
            var customers = new List<Customer>
                {
                    new Customer{ Name="Foo", Address = "123 Some Street", City="Minneapolis",  State = "MN", Country="USA", PostalCode = "55402"},
                    new Customer{ Name="Bar", Address = "456 Your Dr", City="Tempe",  State = "AZ", Country="USA", PostalCode = "85282"},
                    new Customer{ Name="Howdy", Address = "987 Crazy Ave", City="Bronx", State = "NY", Country="USA", PostalCode = "10465"},
                };
            return View(customers); 
            
        }

        public ActionResult Companies()
        {
            var customers = new List<Company>
                {
                    new Company{ CompanyName="Foo", Address = "123 Some Street", City="Minneapolis",  State = "MN", Country="USA", PostalCode = "55402"},
                    new Company{ CompanyName="Bar", Address = "456 Your Dr", City="Tempe",  State = "AZ", Country="USA", PostalCode = "85282"},
                    new Company{ CompanyName="Howdy", Address = "987 Crazy Ave", City="Bronx", State = "NY", Country="USA", PostalCode = "10465"},
                };
            return View(customers);

        }

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