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);
        }
Beispiel #2
0
        public ActionResult Create(Login login)
        {
            if (ModelState.IsValid)
            {
                db.Login.Add(login);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(login));
        }
Beispiel #3
0
        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));
        }
Beispiel #4
0
        //[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"));
            }
        }
Beispiel #5
0
 public IActionResult Create(UserLogin user)
 {
     _context.UserLogin.Add(user);
     _context.SaveChanges();
     return(View("Welcome", user));
 }
Beispiel #6
0
 public void CreateLoginDet(LoginDetail logDet)
 {
     _context.LoginDetails.Add(logDet);
     _context.SaveChanges();
 }