Exemplo n.º 1
0
        public ActionResult Create(Users users)
        {
            if (ModelState.IsValid)
            {
                db.Users.Add(users);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(users);
        }
Exemplo n.º 2
0
 public ActionResult Login(Users users)
 {
     if (ModelState.IsValid)
     {
         using (weatherEntities db = new weatherEntities())
         {
             db.Users.Add(users);
             db.SaveChanges();
             return RedirectToAction("Index", "Account");
         }
     }
     return View(users);
 }
Exemplo n.º 3
0
 public ActionResult Edit(Users users)
 {
     if (ModelState.IsValid)
     {
         db.Entry(users).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(users);
 }