public async Task <IActionResult> Edit(int id, [Bind("UserId,Useremail,UserPassword,UserType,UserStatus")] Gauser gauser) { if (id != gauser.UserId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gauser); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GauserExists(gauser.UserId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(gauser)); }
public async Task <IActionResult> Create([Bind("UserId,Useremail,UserPassword,UserType,UserStatus")] Gauser gauser) { if (ModelState.IsValid) { _context.Add(gauser); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(gauser)); }
public ActionResult Validate(Gauser gauser) { var _gauser = _context.Gauser.Where(_context => _context.Useremail == gauser.Useremail); if (_gauser.Any()) { if (_gauser.Where(_context => _context.UserPassword == gauser.UserPassword).Any()) { return(Json(new { status = true, message = "Login Successfull" })); } else { return(Json(new { status = true, message = "Invalid Password" })); } } else { return(Json(new { status = true, message = "Invalid Email" })); } }