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

namespace myblog.Controllers
{
    public class AccountController : ApplicationController
    {
        public AccountController()   
        {

        }


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

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult LogOn(FormCollection collection)
        {
            string username = collection["username"];
            string password = collection["password"];
            BlogMembershipProvider blogMembershipProvider = new BlogMembershipProvider();
            if (blogMembershipProvider.ValidateUser(username, password))
            {
                return RedirectToAction("Index", "Admin");

            }
            else
            {
                return View();
            }
        }


      

    }
}
