public void AddSuggestie(string beschrijving, string genre, Client client) { var s = new Suggestie() { Beschrijving = beschrijving, Genre = genre, Client = client, TimeStamp = DateTime.Now }; Suggesties.Add(s); }
public Klacht(string omschrijving, Client client) { Omschrijving = omschrijving; Client = client; TimeStamp = DateTime.Now; }
public ActionResult CreateClient(GebruikerViewModel.CreateClientViewModel model) { if (UserStillLoggedIn() || _gebruikerRepository.FindById((int)Session["gebruiker"]) is Client) { return ReturnToLogin(); } if (ModelState.IsValid) { try { if (model.GeselecteerdOpvangtehuisId != null) { if (_gebruikerRepository.FindByUsername(model.GebruikersNaam) != null) { this.AddNotification("Er is al reeds iemand met deze gebruikersnaam", NotificationType.ERROR); return RedirectToAction("CreateClient"); } //var crypto = new SimpleCrypto.PBKDF2(); //var encrytwachtwoord = crypto.Compute(model.Wachtwoord); string pass = BCrypt.Net.BCrypt.HashPassword(model.Wachtwoord, BCrypt.Net.BCrypt.GenerateSalt()); var client = new Client(model.Naam, model.Voornaam, _opvangtehuisRepository.FindByName(model.GeselecteerdOpvangtehuisId), model.GebruikersNaam, pass); _gebruikerRepository.AddClient(client); _gebruikerRepository.SaveChanges(); if (_gebruikerRepository.FindById((int)Session["gebruiker"]) is Admin) { this.AddNotification("Cliënt toegevoegd", NotificationType.SUCCESS); return RedirectToAction("AdminIndex"); } this.AddNotification("Cliënt toegevoegd", NotificationType.SUCCESS); return RedirectToAction("OpvoederIndex"); } } catch (ApplicationException e) { ModelState.AddModelError("", e.Message); } } var ccvm = new GebruikerViewModel.CreateClientViewModel() { GebruikerType = _gebruikerRepository.FindById((int)Session["gebruiker"]).GetType().Name, Opvangtehuizen = _opvangtehuisRepository.FindAll().Select(oh => oh.Naam).ToList() }; return View(ccvm); }
public Forum GetForum(Opvoeder opvoeder, Client client) { if (client == null || opvoeder == null) { return null; } if (!IsForumAlGemaakt(client.Id, opvoeder.Id)) { var forum = new Forum(opvoeder, client); Forums.Add(forum); opvoeder.AddForum(forum); return forum; } return Forums.FirstOrDefault(f => f.Client == client && f.Opvoeder == opvoeder); }
public void UpdateClient(Client client) { _context.Entry(client).State = EntityState.Modified; }
public void AddClient(Client client) { _context.GebruikerSet.Add(client); }
public void AddKlacht(string omschrijving, Client client) { var klacht = new Klacht(omschrijving, client); Klachten.Add(klacht); }
public Forum(Opvoeder opvoeder, Client client) { Opvoeder = opvoeder; Client = client; Posts = new List<Post>(); }