Example #1
0
 public bool LogIn(LeagueUser user)
 {
     try
     {
         return db.RunProcedure<bool>("splus.usp_CheckUserCredentials").FirstOrDefault();
     }
     catch(SqlException ex)
     {
         throw;
     }
 }
Example #2
0
 public bool CreateAccount(LeagueUser u)
 {
     try
     {
         return db.ExecuteProcedure("splus.usp_InsertSummoner", new
         {
             SummonerID = u.SummonerID,
             Username = u.SummonerName,
             Password = u.Password
         });
     }
     catch(SqlException ex)
     {
         throw;
     }
 }
 public IHttpActionResult LogIn(LeagueUser user)
 {
     user.Password = hashPassword(user.Password);
     try
     {
         bool isLoggedIn = db.LogIn(user);
         if(isLoggedIn)
         {
             return Ok(isLoggedIn);
         }
         return Unauthorized();
     }
     catch(Exception ex)
     {
         return InternalServerError(ex);
     }
 }
 public IHttpActionResult CreateAccount(LeagueUser user)
 {
     user.Password = hashPassword(user.Password);
     try
     {
         bool isCreated = db.CreateAccount(user);
         if (isCreated)
         {
             return Ok(isCreated);
         }
         else
         {
             return Ok(false);
         }
     }
     catch(Exception ex)
     {
         return InternalServerError();
     }
 }