Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LoginController : Controller
- {
- // GET: /<controller>/
- //[Route("/Login")]
- public ActionResult Index()
- {
- return View();
- }
- public bool Login(Workflow.Models.WorkflowContext wfc, string username, string password)
- {
- var user = wfc.User.Where(u => u.Active && u.Username == username && u.Password == password).ToList();
- if (user.Count > 0)
- {
- //User may log in
- return true;
- }
- else
- //Access Denied
- return false;
- }
- }
- [Authorize]
- public class HomeController : Controller
- {
- [Route("/Home")]
- public ActionResult Index()
- {
- return View();
- }
- public ActionResult About()
- {
- ViewData["Message"] = "Your application description page.";
- return View();
- }
- public ActionResult Contact()
- {
- ViewData["Message"] = "Your contact page.";
- return View();
- }
- public ActionResult Error()
- {
- return View();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement