示例#1
0
        public ActionResult Index()
        {
            ViewBag.Title = "Catalogo Usuarios";
            if (Session["InfoUser"] == null)
            {
                return(RedirectToAction("Index", "Login"));
            }
            Mod_Session obj = (Mod_Session)Session["InfoUser"];

            ViewBag.Login = obj;
            return(View());
        }
示例#2
0
        public Mod_Session ValidUser(string Login, string Pass)
        {
            var Result = db.Database.SqlQuery <Mod_Session>("SP_LOGIN_VALIDATE @Login, @Pass",
                                                            new SqlParameter("@Login", Login),
                                                            new SqlParameter("@Pass", Pass)).ToList();

            Mod_Session InfoUser = new Mod_Session();

            foreach (var item in Result)
            {
                InfoUser.Usr_Name     = item.Usr_Name;
                InfoUser.Usr_LastName = item.Usr_LastName;
                InfoUser.Usr_Login    = item.Usr_Login;
                InfoUser.Usr_Mail     = item.Usr_Mail;
            }

            return(InfoUser);
        }