示例#1
0
        public ActionResult Index()
        {
            var list = _bal.GetAllEmployees();

            ViewBag.Employees = list;
            return(View());
        }
示例#2
0
        public ActionResult ViewList()
        {
            List <User> res = _bal.GetAllEmployees();

            Session["List"] = res;
            if (Session["Id"] != null)
            {
                if ((string)Session["Role"] == "Admin")
                {
                    return(View(res));
                }
                else
                {
                    return(RedirectToAction("Index", "Login"));
                }
            }
            else
            {
                return(RedirectToAction("Index", "Login"));
            }
        }