Exemplo n.º 1
0
 public List <LoginList> GetAllUser()
 {
     using (LoginDBContext loginDBContext = new LoginDBContext())
     {
         return((loginDBContext.UserTable).ToList());
     }
 }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
        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());
        }
Exemplo n.º 4
0
        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());
        }
Exemplo n.º 5
0
        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());
        }
Exemplo n.º 6
0
 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;
 }
Exemplo n.º 7
0
        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);
            }
        }
Exemplo n.º 8
0
        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());
        }
Exemplo n.º 9
0
 public PersonController(LoginDBContext context)
 {
     _context = context;
 }
Exemplo n.º 10
0
 public AdminServices(LoginDBContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 11
0
 public UserController(LoginDBContext context)
 {
     _context = context;
 }
Exemplo n.º 12
0
 public LoginController(LoginDBContext context)
 {
     _context = context;
 }
Exemplo n.º 13
0
 public UsuarioRepository(LoginDBContext Context)
 {
     dBContext = Context ?? throw new ArgumentNullException(nameof(Context));
     dbSet     = dBContext.Set <Usuario>();
 }
Exemplo n.º 14
0
 public LoginService(LoginDBContext context)
 {
     _context = context;
 }