示例#1
0
        public ActionResult Create([Bind(Include = "Id,Name,Email,Password")] TeamMember teamMember)
        {
            if (ModelState.IsValid)
            {
                db.TeamMembers.Add(teamMember);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(teamMember));
        }
        public ActionResult Create([Bind(Include = "Id,TeamMemberId,Description,DueDate,IsDone")] TaskToDo taskToDo)
        {
            if (ModelState.IsValid)
            {
                db.TaskToDos.Add(taskToDo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.TeamMemberId = new SelectList(db.TeamMembers, "Id", "Name", taskToDo.TeamMemberId);
            return(View(taskToDo));
        }