public ActionResult Index(Refmaster rfobj)
 {
     LilacDao getBool = new LilacDao(ConfigurationManager.ConnectionStrings["lilacDBforWeb"].ConnectionString);
     bool returnValue = getBool.GetLogin(rfobj.refid,rfobj.password);
     if (returnValue == true)
     {
         string flagvalue = "45c75d19-6b05-43ef-80b3-fe70e2b5aff5";
         return RedirectToAction("UtilityReports", "Admin", new { flagvalue=flagvalue });
     }
     else
     {
         TempData["error"] = "Username or Password incorrect";
         return RedirectToAction("index", "Admin");
     }
 }
示例#2
0
        public bool GetLogin(float username, string password)
        {
            using (ISession session =new SessionManager(_connectionString).Open())
            {
                Refmaster lgobj = new Refmaster();
                lgobj = session.QueryOver<Refmaster>().Where(x => x.refid == username).Where(x => x.password == password).Where(x => x.user_type == "1").List().FirstOrDefault();

                if (lgobj == null)
                {
                    return false;
                }
                else
                    //if (lgobj.refid == username && lgobj.password == password && lgobj.user_type == "1")
                    return true;
            }
        }