Ejemplo n.º 1
0
        public ActionResult Create([Bind(Include = "Id,Name")] GroupDancers groupDancers)
        {
            if (ModelState.IsValid)
            {
                db.GroupDancers.Add(groupDancers);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(groupDancers));
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "Id,Name,Age,Phone,StudioAddress,StudioName,City,Email,Password")] Dancers dancers)
        {
            if (ModelState.IsValid)
            {
                db.Dancers.Add(dancers);
                db.SaveChanges();
                return(RedirectToRoute("MyRoute"));
            }

            return(View(dancers));
        }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,Name,Age,Phone,CompanyAddress,CompanyName,City,Email,Password")] Teacher teacher)
        {
            if (ModelState.IsValid)
            {
                db.Teachers.Add(teacher);
                db.SaveChanges();
                return(RedirectToRoute("MyRoute"));
            }

            return(View(teacher));
        }
Ejemplo n.º 4
0
 public ActionResult Register(Dancers account)
 {
     if (ModelState.IsValid)
     {
         using (DanceDbContext db = new DanceDbContext())
         {
             db.Dancers.Add(account);
             db.SaveChanges();
         }
         ModelState.Clear();
         ViewBag.Message = account.Name + "successfuly registered";
     }
     return(View());
 }