Пример #1
0
        // GET: Toys
        public ActionResult Index()
        {
            NataleMongoDB db    = new NataleMongoDB();
            var           toys  = db.GetAllToys();
            Giocattoli    model = new Giocattoli();

            model.EntityList = toys.ToList();


            return(View(model));
        }
Пример #2
0
        public ActionResult LoginFacebook(Utente user)
        {
            NataleMongoDB db      = new NataleMongoDB();
            var           account = db.GetUser(user);

            if (account != null)
            {
                Session["Email"] = account.Email.ToString();
                Session["ID"]    = account.ID.ToString();
                return(RedirectToAction("../Home"));
            }
            else
            {
                ModelState.AddModelError("", "Email or Password Error");
            }
            return(View());
        }