public bool RegisterNewUser(SummonerModel newSummoner) { try { Summoner registeredSummoner = accountRep.Register(newSummoner); logRep.logRegistration(registeredSummoner); } catch (Exception exc) { errorRep.LogError(exc, "Register", "UserController"); return false; } return true; }
public ActionResult CreateSummoner(SummonerModel model) { var server = Request["Servers"]; model.Server = int.Parse(server); UserController ctrl = new UserController(); bool success = ctrl.RegisterNewUser(model); if (success) { ViewBag.SuccessMsg = "Success! User created."; } else { ViewBag.ErrorMsg = "There was an error creating the user. See the Error Logs"; } return View(); }
public Summoner Register(SummonerModel newSummoner) { Summoner summoner = new Summoner(); summoner.DeviceId = newSummoner.DeviceId; summoner.Username = newSummoner.Username; summoner.LoLUsername = newSummoner.LolAccount; summoner.DateRegistered = DateTime.Now; if (newSummoner.Server > 0) { summoner.Server1 = db.Servers.First(s => s.ServerId == newSummoner.Server); } db.Summoners.Add(summoner); this.CreateSummonersGames(summoner); db.SaveChanges(); return summoner; }