public bool Validate(LoginInfo li,out List<DataElement> de) { Logger.Info("LoginController:"); de=new List<DataElement>(); if (string.IsNullOrEmpty(li.password)||string.IsNullOrEmpty(li.username)) { return false; } de.Add(new DataElement(){Name = "username",Value = li.username}); de.Add(new DataElement() { Name = "password", Value = li.password }); return true; }
public ActionResult LogIn(LoginInfo loginInfo) { List<DataElement> de; int userId; Logger.Info("LoginController:username="******" password="******"LoginController:Fail validation."); return RedirectToAction("Index"); } if (!LoginAccount(de,out userId)) { Logger.Info("LoginController:Fail LoginAccount"); return RedirectToAction("Index"); } Session["userId"] = userId; Logger.Info("LoginController:Success Login "+userId); return RedirectToAction("Index"); }