public bool UpdateEntity(Usuario entity) { var usuarioUpdate = dbSet.Update(entity); var result = dBContext.SaveChanges(); dBContext.Entry(entity).State = EntityState.Modified; return(result > 0 ? true : false); }
public ActionResult Create(Login login) { if (ModelState.IsValid) { db.Login.Add(login); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(login)); }
public ActionResult Create([Bind(Include = "ID,UserName,UserPassword,Email,UserPasswordSecurity,ReleaseDate")] Login login) { DateTime dtnow = DateTime.Now; if (ModelState.IsValid) { db.Logins.Add(login); db.SaveChanges(); return(RedirectToAction("List")); } return(View(login)); }
//[ValidateAntiForgeryToken] public IActionResult Create(UserLogin user) { if (ModelState.IsValid) { var dbUser = _context.UserLogin.SingleOrDefault(u => u.Email == user.Email); if (dbUser == null) { _context.UserLogin.Add(new UserLogin { Name = user.Name, Email = user.Email, City = user.City, Password = user.Password }); _context.SaveChanges(); return(View("Welcome")); } else { return(View()); } } else { return(View("ErrorPage")); } }
public IActionResult Create(UserLogin user) { _context.UserLogin.Add(user); _context.SaveChanges(); return(View("Welcome", user)); }
public void CreateLoginDet(LoginDetail logDet) { _context.LoginDetails.Add(logDet); _context.SaveChanges(); }