public ActionResult Create([Bind(Include = "UserId,RoleId,MemberName,RoleName")] ASPNetUserRoles aSPNetUserRoles)
        {
            if (ModelState.IsValid)
            {
                db.ASPNetUserRoles.Add(aSPNetUserRoles);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(aSPNetUserRoles));
        }
Exemple #2
0
        public ActionResult Create([Bind(Include = "EventId,ChapterId,EventDate,EventTitle,DateModified,DateCreated")] Event @event)
        {
            @event.DateModified = System.DateTime.Now;
            @event.DateCreated  = System.DateTime.Now;
            CreateChapterDD();

            var chapterId = Request.Form["ChapterId"].ToString();

            @event.ChapterId = int.Parse(chapterId);

            if (ModelState.IsValid)
            {
                db.Events.Add(@event);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(@event));
        }