using System;
using System.Web.Mvc;
using TelerikMvcPrototype.Models;

namespace TelerikMvcPrototype.Controllers
{
	public class HomeController : Controller
	{
		public DateTime? EndDate { get; set; }
		public DateTime? StartDate { get; set; }

		private InitiativeModel _model;
		public InitiativeModel Model
		{
			get
			{
				if (_model == null)
				{
					_model = new InitiativeModel();
				}

				return this._model;
			}
			set { this._model = value; }
		}

		public ActionResult Index()
		{
			ViewData["startDate"] = StartDate ?? DateTime.Today;
			ViewData["endDate"] = EndDate ?? DateTime.Today.AddMonths(1);

			return View(Model);
		}
	}
}
