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

namespace MvcApplication1.Controllers
{
    public class ListaController : Controller
    {
        //
        // GET: /Lista/

        static List<string> ListaElementow = new List<string>();

        public ActionResult Index(FormCollection form)
        {
            if (form.Count > 0)
                ListaElementow.Add(form[0].ToString() + " " + DateTime.Now.ToLongTimeString());
            if (Request.IsAjaxRequest())
                return View("Lista", ListaElementow);
            else
                return View();
        }

        public ActionResult DodajElementDoListy(FormCollection form)
        {
            if (form.Count > 0)
                ListaElementow.Add(form[0].ToString() + " " + DateTime.Now.ToLongTimeString());

            return View("Lista", ListaElementow);
        }

    }
}
