public List <LoginList> GetAllUser() { using (LoginDBContext loginDBContext = new LoginDBContext()) { return((loginDBContext.UserTable).ToList()); } }
public ActionResult Login(Login login) { try { string Userrole = ""; if (!ModelState.IsValid) { LoginDBContext loginDBContext = new LoginDBContext(); DataSet ds = new DataSet(); ds = loginDBContext.getPassword(login.Username); var hashedPassword = Convert.ToString(ds.Tables[0].Rows[0]["UserPassword"]); var doesPasswordMatch = Crypto.VerifyHashedPassword(hashedPassword, login.UserPassword); if (doesPasswordMatch) { Userrole = Convert.ToString(ds.Tables[0].Rows[0]["Userrole"]); Session["Role"] = Userrole; return(RedirectToAction("AdminHome")); } else { Session["Role"] = "User"; return(RedirectToAction("Index", "Matches")); } } } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "Login", "Login"))); } return(View()); }
public List <uye> idyeGore(int id1) { LoginDBContext ctx = new LoginDBContext(); return(ctx.tbKullanicilers.Where(uye => uye.id == id1).Select(x => new uye { kid = x.id, kad = x.Kullanici_Ad, ksifre = x.Sifre }).ToList()); }
public List <uye> Kullan() { LoginDBContext ctx = new LoginDBContext(); return(ctx.tbKullanicilers.Select(x => new uye { kid = x.id, kad = x.Kullanici_Ad, ksifre = x.Sifre }).ToList()); }
public string id(string KullaniciAd, string Sifre) { LoginDBContext ctx = new LoginDBContext(); var q2 = ctx.tbKullanicilers .Where(x => x.Kullanici_Ad == KullaniciAd && x.Sifre == Sifre).FirstOrDefault(); return(q2.id.ToString()); }
public JWTTokenController( SignInManager <IdentityUser> signInManager, UserManager <IdentityUser> userManager, RoleManager <IdentityRole> roleManager, IConfiguration configuration, LoginDBContext ldbContext) { _signInManager = signInManager; _userManager = userManager; _roleManager = roleManager; _configuration = configuration; _ldbContext = ldbContext; }
public bool KullaniciGiris(string KullaniciAd, string Sifre) { LoginDBContext ctx = new LoginDBContext(); var q1 = from p in ctx.tbKullanicilers where p.Kullanici_Ad == KullaniciAd && p.Sifre == Sifre select p; if (q1.Any()) { //Session["id"] = q2.id; return(true); } else { return(false); } }
public ActionResult Register(Login login) { try { if (ModelState.IsValid) { LoginDBContext loginDBContext = new LoginDBContext(); var hashedpassword = Crypto.HashPassword(login.UserPassword); login.Userrole = "Admin"; login.UserPassword = hashedpassword; loginDBContext.InsertUserDetails(login); Session["Role"] = "Admin"; return(RedirectToAction("AdminHome")); } } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "Login", "Register"))); } return(View()); }
public PersonController(LoginDBContext context) { _context = context; }
public AdminServices(LoginDBContext dbContext) { _dbContext = dbContext; }
public UserController(LoginDBContext context) { _context = context; }
public LoginController(LoginDBContext context) { _context = context; }
public UsuarioRepository(LoginDBContext Context) { dBContext = Context ?? throw new ArgumentNullException(nameof(Context)); dbSet = dBContext.Set <Usuario>(); }
public LoginService(LoginDBContext context) { _context = context; }