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

namespace Form_AutocCompleteFor.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Index(AdditionalModel model)
        {
            return View();
        }

        public JsonResult GetAllProducts()
        {
            var products = new List<SaleOrderViewModel>() {
                new SaleOrderViewModel(){Name = "Cherry", Value = 1, Color = "red" },
                new SaleOrderViewModel(){Name = "Orange", Value = 2, Color = "orange" },
                new SaleOrderViewModel(){Name = "Apple",  Value = 3, Color = "green" },
            };

            return Json(products, JsonRequestBehavior.AllowGet);
        }
    }
}
