public ActionResult Create([Bind(Include = "Id,NotebookOwner,DateCreated,LastModified,Title,Desctiption,Body")] Notebook notebook)
        {
            if (ModelState.IsValid)
            {
                db.Notebooks.Add(notebook);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(Json(notebook, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public ActionResult Create([Bind(Include = "Id,Username,FirstName,LastName,Email,AccountCreatedOnDate,LastLoggin,isAdmin,isTeacher")] User user)
        {
            if (ModelState.IsValid)
            {
                db.Users.Add(user);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(user));
        }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "Id,Owner,DateCreated,LastModified,Font,Back,DeckId,Rating")] Notecard notecard)
        {
            if (ModelState.IsValid)
            {
                db.Notecards.Add(notecard);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(notecard));
        }