using System.Web.Mvc;
using TelerikMvcAppTabStripLoad.Models;

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

            return View();
        }

        public ActionResult DetailPerson()
        {
            ViewBag.Message = "Your person detail page.";

            var testModel = new Person() { PersonID = 1, FirstName = "John", LastName = "Doe", Sex = "Male"};

            return PartialView("~/Views/Shared/_PersonView.cshtml", testModel);
        }

        public ActionResult EditPerson(Person model)
        {
            ViewBag.Message = "Your person detail page.";    

            return PartialView("~/Views/Shared/_PersonEdit.cshtml", model);
        }

        public ActionResult SavePerson(Person model)
        {
            //save model to db

            return View("Index", model);
        }

        public ActionResult DetailHouse()
        {
            ViewBag.Message = "Your house detail page.";

            return PartialView("~/Views/Shared/_HomeView.cshtml");
        }

        public ActionResult DetailCar()
        {
            ViewBag.Message = "Your car detail page.";

            return PartialView("~/Views/Shared/_CarView.cshtml");
        }
    }
}
