public ActionResult Index(FooDo2.Models.user Model)
        {
            var db    = new QFoodDBEntitiesFooDo();
            var users = db.users;

            return(View(users.ToList()));
        }
示例#2
0
        public ActionResult Authorize(FooDo2.Models.user Model1)
        {
            var userDetails = db.users.Where(x => x.login == Model1.login && x.password == Model1.password).FirstOrDefault();

            if (userDetails == null)
            {
                return(RedirectToAction("Index", "Login"));
            }
            else
            {
                Session["userManager"] = userDetails.manager;
                Session["userID"]      = userDetails.ID;
                if (userDetails.manager == 1)
                {
                    return(RedirectToAction("IndexManager", "Home"));
                }
                else
                {
                    return(RedirectToAction("Index", "Home"));
                }
            }
        }
 public ActionResult Add(FooDo2.Models.user Model)
 {
     return(View());
 }