private async void ShowDialog(Actie actie) { var dialog = new ContentDialog() { Title = actie.Beschrijving, FullSizeDesired = true, MaxWidth = this.ActualWidth // Required for Mobile! }; var panel = new StackPanel(); panel.Children.Add(new TextBlock { Text = "Geldig tot: " + actie.GeldigTot, TextWrapping = TextWrapping.Wrap, Margin = new Thickness(0, 0, 0, 10) }); Image image = new Image(); BitmapImage imageBitMap = new BitmapImage(new Uri(this.BaseUri, "/Assets/QRcode.jpg")); ImageSource source = imageBitMap; image.Source = source; panel.Children.Add(image); dialog.Content = panel; dialog.CloseButtonText = "Close"; var result = await dialog.ShowAsync(); }
public override void PasteFont(out Actie result) { PropertyBundleChangedActie actie = new PropertyBundleChangedActie(new Vorm[] { this }, "Opmaak plakken"); if (uitlijning != Program.TekstFont.Uitlijning) { actie.Items.Add(new PropertyChangedActie(this, "Uitlijning", uitlijning, Program.TekstFont.Uitlijning)); } if (font != Program.TekstFont.Font) { actie.Items.Add(new PropertyChangedActie(this, "Font", font, Program.TekstFont.Font)); } if (kleur != Program.TekstFont.Kleur) { actie.Items.Add(new PropertyChangedActie(this, "Kleur", kleur, Program.TekstFont.Kleur)); } if (meeschalen != Program.TekstFont.Meeschalen) { actie.Items.Add(new PropertyChangedActie(this, "Meeschalen", meeschalen, Program.TekstFont.Meeschalen)); } uitlijning = Program.TekstFont.Uitlijning; font = Program.TekstFont.Font; kleur = Program.TekstFont.Kleur; meeschalen = Program.TekstFont.Meeschalen; result = actie; }
public void DeleteActie(int actieid) { Actie actie = ctx.Acties.Find(actieid); ctx.Acties.Remove(actie); ctx.SaveChanges(); }
public void VerwijderActie() { _groep.CurrentState = new MotivatieGoedgekeurdState(_groep); var model = new VerwijderActieModel(); model.actieId = 1; var container = new ActieContainer(); _groep.AddContainer(container); var actie = new Actie("Test", "Actie"); container.VoegActieToe(actie); _actieRepository.Setup(c => c.GetById(1)).Returns(actie); var result = _controller.VerWijderActie(_cursist, model); var redirect = result as ViewResult; _actieRepository.Verify(a => a.SaveChanges(), Times.Once); Assert.Equal("MaakActie", redirect?.ViewName); }
internal async Task <bool> bewerkActieAsync(Actie actie) { var evenementJson = JsonConvert.SerializeObject(actie); HttpClient client = new HttpClient(); var json = await client.PostAsync("http://localhost:65078/api/bewerkActie/", new StringContent(evenementJson, System.Text.Encoding.UTF8, "application/json")); return(json.IsSuccessStatusCode); }
public PadActie(Pad pad, Actie actie, int order) { Pad = pad; Actie = actie; PadId = pad.PadId; ActieId = actie.ActieId; Order = order; }
private async void SaveAsync(object sender, Windows.UI.Xaml.RoutedEventArgs e) { var actieAnswer = false; if (Validate()) { if (actieObject != null) { actieObject.Beschrijving = Beschrijving.Text; var dateObject = Datum.Date.Date.ToString().Substring(0, 10) + " " + Time.Time.ToString(); DateTime myDateObject = DateTime.Parse(dateObject); actieObject.GeldigTot = myDateObject; actieAnswer = await actieViewModel.bewerkActieAsync(actieObject); if (actieAnswer) { this.Frame.Navigate(typeof(BeheerOndernemerPage)); ToastTemplateType toastTemplate = ToastTemplateType.ToastText02; XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate); XmlNodeList toastTekstElementen = toastXml.GetElementsByTagName("text"); toastTekstElementen[0].AppendChild(toastXml.CreateTextNode("Actie")); toastTekstElementen[1].AppendChild(toastXml.CreateTextNode(actieObject.Beschrijving + " aangepast")); IXmlNode toastNode = toastXml.SelectSingleNode("/toast"); ((XmlElement)toastNode).SetAttribute("duration", "long"); ToastNotification toast = new ToastNotification(toastXml); ToastNotificationManager.CreateToastNotifier().Show(toast); } } else { var date = Datum.Date.Date.ToString().Substring(0, 10) + " " + Time.Time.ToString(); DateTime myDate = DateTime.Parse(date); Actie actie = new Actie( Beschrijving.Text, myDate, Int32.Parse(bedrijf) ); actieAnswer = await actieViewModel.addActieAsync(actie); if (actieAnswer) { this.Frame.Navigate(typeof(BeheerOndernemerPage)); ToastTemplateType toastTemplate = ToastTemplateType.ToastText02; XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate); XmlNodeList toastTekstElementen = toastXml.GetElementsByTagName("text"); toastTekstElementen[0].AppendChild(toastXml.CreateTextNode("Actie")); toastTekstElementen[1].AppendChild(toastXml.CreateTextNode(actie.Beschrijving + " werd toegevoegd aan je acties")); IXmlNode toastNode = toastXml.SelectSingleNode("/toast"); ((XmlElement)toastNode).SetAttribute("duration", "long"); ToastNotification toast = new ToastNotification(toastXml); ToastNotificationManager.CreateToastNotifier().Show(toast); } } } }
public Actie AddActie(string actienaam, string informatie, double bedrag, BegrotingsType begrotingstype) { var actie = new Actie(actienaam, informatie, bedrag); if (begrotingstype.Acties == null) { begrotingstype.Acties = new List <Actie>(); } begrotingstype.Acties.Add(actie); return(begrotingrepo.CreateActie(actie)); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { actieObject = e.Parameter as Actie; bedrijf = e.Parameter as String; if (actieObject != null) { Beschrijving.Text = actieObject.Beschrijving; Datum.Date = actieObject.getDate; Time.Time = actieObject.getHour; } }
public IHttpActionResult PostActie(Actie actie) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } serviceContext.Acties.Add(actie); serviceContext.SaveChanges(); return(Ok(actie)); }
public IActionResult VerWijderActie(Cursist cursist, VerwijderActieModel model) { Groep groep = cursist.Groep; Actie actie = _actieRepository.GetById(model.actieId); groep.VerwijderActie(actie); _actieRepository.VerwijderActie(actie); _actieRepository.SaveChanges(); ViewBag._userMessage = String.Format("{0} {1} is succesvol verwijderd", actie.Datum == null ? "Actie" : "Evenement", actie.Titel); return(ActieMaken(cursist)); }
public IActionResult UpdateActie(Cursist cursist, ActieViewModel model) { Groep groep = cursist.Groep; if (ModelState.IsValid) { Actie actie = _actieRepository.GetById(model.Id); actie.Titel = model.Titel; actie.Omschrijving = model.Omschrijving; _actieRepository.SaveChanges(); ViewBag._userMessage = "Actie is succesvol gewijzigd"; return(ActieMaken(cursist)); } ViewBag._userError = "Gelieve alle velden correct in te vullen"; return(ActieMaken(cursist)); }
private void Actie_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (acties.SelectedItems.Count > 0) { if (acties.SelectedValue != null) { huidigeActie = acties.SelectedValue as Actie; Beschrijving.Text = huidigeActie.Beschrijving; Datum.Date = huidigeActie.getDate; Time.Time = huidigeActie.getHour; evenementen.SelectedItem = null; Evenement.Visibility = Visibility.Collapsed; Actie.Visibility = Visibility.Visible; Onderneming.Visibility = Visibility.Collapsed; } } }
public override void PasteFont(out Actie result) { PropertyBundleChangedActie actie = new PropertyBundleChangedActie(new Vorm[] { this }, "Opmaak plakken"); if (puntstijl != Program.PuntFont.PuntStijl) { actie.Items.Add(new PropertyChangedActie(this, "PuntStijl", puntstijl, Program.PuntFont.PuntStijl)); } if (kleur != Program.PuntFont.Kleur) { actie.Items.Add(new PropertyChangedActie(this, "Kleur", kleur, Program.PuntFont.Kleur)); } puntstijl = Program.PuntFont.PuntStijl; kleur = Program.PuntFont.Kleur; result = actie; }
public override void PasteFont(out Actie result) { PropertyBundleChangedActie actie = new PropertyBundleChangedActie(new Vorm[] { this }, "Opmaak plakken"); if (pen.Color != Program.VlakFont.Pen.Color) { actie.Items.Add(new PropertyChangedActie(this, "LijnKleur", pen.Color, Program.VlakFont.Pen.Color)); } if (pen.DashStyle != Program.VlakFont.Pen.DashStyle) { actie.Items.Add(new PropertyChangedActie(this, "LijnStijl", pen.DashStyle, Program.VlakFont.Pen.DashStyle)); } if (pen.Width != Program.VlakFont.Pen.Width) { actie.Items.Add(new PropertyChangedActie(this, "LijnDikte", pen.Width, Program.VlakFont.Pen.Width)); } if (vulKleur1 != Program.VlakFont.Kleur1) { actie.Items.Add(new PropertyChangedActie(this, "VulKleur1", vulKleur1, Program.VlakFont.Kleur1)); } if (vulKleur2 != Program.VlakFont.Kleur2) { actie.Items.Add(new PropertyChangedActie(this, "VulKleur2", vulKleur2, Program.VlakFont.Kleur2)); } if (opvulsoort != Program.VlakFont.OpvulSoort) { actie.Items.Add(new PropertyChangedActie(this, "OpvulType", opvulsoort, Program.VlakFont.OpvulSoort)); } if (vulstijl != Program.VlakFont.VulStijl) { actie.Items.Add(new PropertyChangedActie(this, "VulStijl", vulstijl, Program.VlakFont.VulStijl)); } if (loophoek != Program.VlakFont.LoopHoek) { actie.Items.Add(new PropertyChangedActie(this, "LoopHoek", loophoek, Program.VlakFont.LoopHoek)); } pen = (Pen)Program.VlakFont.Pen.Clone(); opvulsoort = Program.VlakFont.OpvulSoort; vulKleur1 = Program.VlakFont.Kleur1; vulKleur2 = Program.VlakFont.Kleur2; vulstijl = Program.VlakFont.VulStijl; loophoek = Program.VlakFont.LoopHoek; result = actie; }
public IHttpActionResult BewerkActie(Actie actie) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = serviceContext.Acties.SingleOrDefault(a => a.Id == actie.Id); if (result != null) { result.GeldigTot = actie.GeldigTot; result.Beschrijving = actie.Beschrijving; serviceContext.SaveChanges(); return(Ok(actie)); } return(BadRequest(ModelState)); }
public override void PasteFont(out Actie result) { PropertyBundleChangedActie actie = new PropertyBundleChangedActie(new Vorm[] { this }, "Opmaak plakken"); if (pen.Color != Program.LijnFont.Color) { actie.Items.Add(new PropertyChangedActie(this, "LijnKleur", pen.Color, Program.LijnFont.Color)); } if (pen.DashStyle != Program.LijnFont.DashStyle) { actie.Items.Add(new PropertyChangedActie(this, "LijnStijl", pen.DashStyle, Program.LijnFont.DashStyle)); } if (pen.Width != Program.LijnFont.Width) { actie.Items.Add(new PropertyChangedActie(this, "LijnDikte", pen.Width, Program.LijnFont.Width)); } //if (pen.DashPattern != Program.LijnFont.DashPattern) // actie.Items.Add(new PropertyChangedActie(this, "DashPattern", pen.DashPattern, Program.LijnFont.DashPattern)); pen = (Pen)Program.LijnFont.Clone(); result = actie; }
public void MaakBericht_MaaktBerichtAan() { var model = new DeelActieViewModel(); _groep2.CurrentState = new MotivatieGoedgekeurdState(_groep); model.Id = 1; var container = new ActieContainer(); _groep2.AddContainer(container); var actie = new Actie("Test", "Actie"); container.VoegActieToe(actie); _actieRepository.Setup(c => c.GeefActie(1)).Returns(actie); _actieRepository.Setup(c => c.GetById(1)).Returns(actie); model.Aankodiging = "TestBeschrijving"; _controller.MaakBericht(_cursist2, model); _actieRepository.Verify(a => a.SaveChanges()); }
public IActionResult VoegActieToe(Cursist cursist, ActieViewModel model) { Groep groep = cursist.Groep; if (ModelState.IsValid) { try { var actie = new Actie(model.Titel, model.Omschrijving); groep.VoegActieToe(actie); _actieRepository.SaveChanges(); ViewBag._userMessage = $"Actie {actie.Titel} is succesvol toegevoegd"; return(ActieMaken(cursist)); } catch (ArgumentException e) { ViewBag._userError = e.Message; return(ActieMaken(cursist)); } } ViewBag._userError = "Gelieve alle velden correct in te vullen"; return(ActieMaken(cursist)); }
public void MaakBericht_ReturntIndex() { var model = new DeelActieViewModel(); _groep2.CurrentState = new MotivatieGoedgekeurdState(_groep); model.Id = 1; var container = new ActieContainer(); _groep2.AddContainer(container); var actie = new Actie("Test", "Actie"); container.VoegActieToe(actie); _actieRepository.Setup(c => c.GeefActie(1)).Returns(actie); _actieRepository.Setup(c => c.GetById(1)).Returns(actie); model.Aankodiging = "TestBeschrijving"; _controller.MaakBericht(_cursist2, model); var result = _controller.ActieMaken(_cursist); var action = result as RedirectToActionResult; Assert.Equal("Index", action?.ActionName); }
public IActionResult VoegEvenementToe(Cursist cursist, EvenementViewModel model) { Groep groep = cursist.Groep; if (ModelState.IsValid) { try { var evenement = new Actie(model.Titel, model.Omschrijving, model.Datum); groep.VoegActieToe(evenement); _cursistRepository.SaveChanges(); ViewBag._userMessage = $"Evenement {evenement.Titel} is succesvol aangemaakt"; return(ActieMaken(cursist)); } catch (ArgumentException e) { ViewBag._userError = e.Message; return(ActieMaken(cursist)); } } ViewBag._userError = "Gelieve alle velden correct in te vullen"; return(ActieMaken(cursist)); }
public void DeleteActie(Actie actie) { _acties.Remove(actie); }
public void ChangeActie(Actie actie) { begrotingrepo.UpdateActie(actie); }
public void GetBegrotingenFromExcelViaStream(Stream fileStream) { GemeenteManager gemeenteMgr = new GemeenteManager(uowMgr); // Open het Excel document met read-only acces. using (SpreadsheetDocument document = SpreadsheetDocument.Open(fileStream, false)) { // Referentie maken naar het Workbook Part. WorkbookPart workbookPart = document.WorkbookPart; // Vind de eerste sheet en maak een referentie naar de worksheet. Sheet sheet = workbookPart.Workbook.Descendants <Sheet>().First(); // Gooi een exception als de sheet niet wordt gevonden. if (sheet == null) { throw new ArgumentException("De sheet met begrotingen werd niet gevonden!"); } // Maak een referentie naar de Worksheet Part. WorksheetPart worksheetPart = (WorksheetPart)workbookPart.GetPartById(sheet.Id); int i = 2; string cityString = ""; List <Categorie> categories = GetAllCategorieën().ToList(); do { // CITY & BUDGET string actionBudgetString = GetCellValue(worksheetPart, workbookPart, "O" + i); double actionBudget; Double.TryParse(actionBudgetString, out actionBudget); cityString = GetCellValue(worksheetPart, workbookPart, "A" + i); Gemeente city = gemeenteMgr.GetGemeente(cityString); if (actionBudget != 0) { if (city != null) { if (city.BegrotingsTypes == null) { city.BegrotingsTypes = new List <BegrotingsType>(); } int year = Int32.Parse(GetCellValue(worksheetPart, workbookPart, "M" + i)); BegrotingsType begrotingsType; if (year < DateTime.Now.Year) { begrotingsType = new Rekening(year); //Alle categorieinformaties aanmaken foreach (Categorie c in categories) { begrotingsType.CategorieInformaties.Add(new CategorieInformatie { Categorie = c, Bedrag = 0 }); } } else { begrotingsType = new Begroting(year); //Alle categorieinformaties aanmaken foreach (Categorie c in categories) { begrotingsType.CategorieInformaties.Add(new CategorieInformatie { Categorie = c, Bedrag = 0 }); } } if (!city.BegrotingsTypes.Exists(x => x.Jaartal.Equals(year))) { city.BegrotingsTypes.Add(begrotingsType); } else { begrotingsType = city.BegrotingsTypes.Find(x => x.Jaartal.Equals(year)); } // MAAK ACTIES if (begrotingsType != null) { //ACTIE string actionName = GetCellValue(worksheetPart, workbookPart, "D" + i); string actionDescription = GetCellValue(worksheetPart, workbookPart, "E" + i); Actie action = new Actie(actionName, actionDescription, actionBudget); if (begrotingsType.Acties == null) { begrotingsType.Acties = new List <Actie>(); } // BESTUUR string bestuurString = GetCellValue(worksheetPart, workbookPart, "B" + i); Bestuur bestuur; if (bestuurString.Contains("OCMW")) { bestuur = new Bestuur(bestuurString, BestuurType.OCMW); } else if (bestuurString.Equals(city.Naam)) { bestuur = new Bestuur(bestuurString, BestuurType.Gemeente); } else { bestuur = new Bestuur(bestuurString, BestuurType.AutonomeGemeentebedrijven); } if (GetAllBesturen().ToList().Exists(x => bestuurString.Equals(x.Naam))) { bestuur = GetAllBesturen().ToList().Find(x => bestuurString.Equals(x.Naam)); } action.Bestuur = bestuur; // CATEGORIE string categoryString = GetCellValue(worksheetPart, workbookPart, "H" + i); Categorie categorie = categories.Single(x => categoryString.Contains(x.Naam) && x.CategorieNiveau.Equals(CategorieNiveau.C)); action.Categorie = categorie; // ADD ACTIE BIJ BUDGET if (actionBudget > 0 && !begrotingsType.Acties.ToList().Exists(x => x.Naam.Equals(actionName))) { begrotingsType.Acties.Add(action); // CATEGORYINFO if (action.Categorie != null) { // C CategorieInformatie infoC; infoC = begrotingsType.CategorieInformaties.ToList().Find(x => x.Categorie.Naam.Equals(action.Categorie.Naam) && x.Categorie.CategorieNiveau == action.Categorie.CategorieNiveau); infoC.Bedrag += actionBudget; // B string catBString = GetCellValue(worksheetPart, workbookPart, "G" + i); Categorie catB = categories.Single(x => catBString.Contains(x.Naam) && x.CategorieNiveau == CategorieNiveau.B); if (catB == null) { throw new Exception(); } CategorieInformatie infoB; infoB = begrotingsType.CategorieInformaties.ToList().Find(x => x.Categorie.Naam.Equals(catB.Naam) && x.Categorie.CategorieNiveau == catB.CategorieNiveau); infoB.Bedrag += actionBudget; // A string catAString = GetCellValue(worksheetPart, workbookPart, "F" + i); Categorie catA = categories.Single(x => catAString.Contains(x.Naam) && x.CategorieNiveau == CategorieNiveau.A); if (catA == null) { throw new Exception(); } CategorieInformatie infoA; infoA = begrotingsType.CategorieInformaties.ToList().Find(x => x.Categorie.Naam.Equals(catA.Naam) && x.Categorie.CategorieNiveau == catA.CategorieNiveau); infoA.Bedrag += actionBudget; begrotingsType.Totaal += actionBudget; } } } // UPDATE gemeenteMgr.ChangeGemeente(city); } } Console.WriteLine("Rij " + i + "ingelezen."); i++; } while (cityString != null && !cityString.Equals("")); } uowMgr.Save(); }
//in between tables worden momenteel niet gebruikt. public async Task InitializeData() { _context.Database.EnsureDeleted(); if (_context.Database.EnsureCreated()) { //generate some exercises w/ modifiers //String name, String task, String result, String feedback, String goal, String category, int timeLimit, IEnumerable<int> modifier Modifier m1 = new Modifier() { Modifierint = 5 }; Modifier m2 = new Modifier() { Modifierint = 12 }; Modifier m3 = new Modifier() { Modifierint = 8 }; Modifier m4 = new Modifier() { Modifierint = 9 }; Modifier m5 = new Modifier() { Modifierint = 10 }; Modifier m11 = new Modifier() { Modifierint = 51 }; Modifier m21 = new Modifier() { Modifierint = 121 }; Modifier m31 = new Modifier() { Modifierint = 81 }; Modifier m41 = new Modifier() { Modifierint = 91 }; Modifier m51 = new Modifier() { Modifierint = 101 }; Modifier m12 = new Modifier() { Modifierint = 52 }; Modifier m22 = new Modifier() { Modifierint = 122 }; Modifier m32 = new Modifier() { Modifierint = 82 }; Modifier m42 = new Modifier() { Modifierint = 92 }; Modifier m52 = new Modifier() { Modifierint = 102 }; Modifier m13 = new Modifier() { Modifierint = 53 }; Modifier m23 = new Modifier() { Modifierint = 123 }; Modifier m33 = new Modifier() { Modifierint = 83 }; Modifier m43 = new Modifier() { Modifierint = 3 }; Modifier m53 = new Modifier() { Modifierint = 103 }; Modifier m14 = new Modifier() { Modifierint = 54 }; Modifier m24 = new Modifier() { Modifierint = 124 }; Modifier m34 = new Modifier() { Modifierint = 84 }; Modifier m44 = new Modifier() { Modifierint = 49 }; Modifier m54 = new Modifier() { Modifierint = 104 }; ICollection <Modifier> mfs = new List <Modifier>(); mfs.Add(m1); mfs.Add(m2); mfs.Add(m3); mfs.Add(m4); mfs.Add(m5); ICollection <Modifier> mfs1 = new List <Modifier>(); mfs1.Add(m11); mfs1.Add(m21); mfs1.Add(m31); mfs1.Add(m41); mfs1.Add(m51); ICollection <Modifier> mfs2 = new List <Modifier>(); mfs2.Add(m12); mfs2.Add(m22); mfs2.Add(m32); mfs2.Add(m42); mfs2.Add(m52); ICollection <Modifier> mfs3 = new List <Modifier>(); mfs3.Add(m13); mfs3.Add(m23); mfs3.Add(m33); mfs3.Add(m43); mfs3.Add(m53); ICollection <Modifier> mfs4 = new List <Modifier>(); mfs4.Add(m14); mfs4.Add(m24); mfs4.Add(m34); mfs4.Add(m44); mfs4.Add(m54); Exercise testE1 = new Exercise() { Name = "Krachthuis van de cel", Category = "Biologie", Task = "vraag1.pdf", Feedback = "hulp4.pdf", Result = "Mitochondrion", TimeLimit = 80, Goal = "Onderdelen van de cel begrijpen", Modifiers = mfs }; Exercise testE2 = new Exercise() { Name = "Translatie van beweging", Category = "Fysica", Task = "vergelijking3.pdf", Feedback = "Hulp3.pdf", Result = "Een getal", TimeLimit = 70, Goal = "Begrijpen van de gecompliceerde Fysica", Modifiers = mfs1 }; Exercise testE3 = new Exercise() { Name = "Matige vergelijking", Category = "Wiskunde", Task = "vergelijking2.pdf", Feedback = "Hulp2.pdf", Result = "4", TimeLimit = 60, Goal = "Vergelijkingen leren oplossen", Modifiers = mfs2 }; Exercise testE4 = new Exercise() { Name = "Gemakkelijke vergelijking", Category = "Wiskunde", Task = "vergelijking1.pdf", Feedback = "Hulp1.pdf", Result = "2", TimeLimit = 50, Goal = "Vergelijkingen leren opstellen", Modifiers = mfs3 }; Exercise testE5 = new Exercise() { Name = "Moelijke vergelijking", Category = "Wiskunde", Task = "vergelijking5.pdf", Feedback = "Hulp5.pdf", Result = "6", TimeLimit = 50, Goal = "Geavanceerde vergelijkingen verwerken", Modifiers = mfs4 }; ICollection <Exercise> exList1 = new List <Exercise>(); exList1.Add(testE1); exList1.Add(testE2); ICollection <Exercise> exList2 = new List <Exercise>(); exList2.Add(testE2); exList2.Add(testE3); ICollection <Exercise> exList3 = new List <Exercise>(); exList3.Add(testE3); exList3.Add(testE4); exList3.Add(testE5); ////generate some actions Actie testA1 = new Actie() { Name = "Connect the dots" }; Actie testA2 = new Actie() { Name = "Open the lunchbox" }; Actie testA3 = new Actie() { Name = "Find the enveloppe" }; Actie testA4 = new Actie() { Name = "Pop the balloon" }; ICollection <Actie> aList1 = new List <Actie>(); aList1.Add(testA1); ICollection <Actie> aList2 = new List <Actie>(); aList2.Add(testA2); ICollection <Actie> aList3 = new List <Actie>(); aList3.Add(testA3); aList3.Add(testA4); ////generate some accesscodes AccesCode testAc1 = new AccesCode() { Code = 1 }; AccesCode testAc2 = new AccesCode() { Code = 2 }; AccesCode testAc3 = new AccesCode() { Code = 3 }; AccesCode testAc4 = new AccesCode() { Code = 4 }; AccesCode testAc5 = new AccesCode() { Code = 5 }; ICollection <AccesCode> acList1 = new List <AccesCode>(); acList1.Add(testAc1); acList1.Add(testAc2); ICollection <AccesCode> acList2 = new List <AccesCode>(); acList2.Add(testAc2); acList2.Add(testAc3); ICollection <AccesCode> acList3 = new List <AccesCode>(); acList3.Add(testAc4); acList3.Add(testAc5); ////generate some bobs BoB testB1 = new BoB() { Name = "Biologie", Description = "Inhoud van de cel", AccesCodes = acList1, Actions = aList1, Exercises = exList1 }; BoB testB2 = new BoB() { Name = "Wiskunde", Description = "Vergelijkingen", AccesCodes = acList3, Actions = aList3, Exercises = exList3 }; //BoB testB3 = new BoB() { Name = "Fysica", Description = "Oefeningen", AccesCodes = acList2, Actions = aList2, Exercises = exList2 }; ////generate some pupils Pupil p1 = new Pupil() { Name = "Wannes" }; Pupil p2 = new Pupil() { Name = "Lorenz" }; Pupil p3 = new Pupil() { Name = "Arne" }; Pupil p4 = new Pupil() { Name = "Jef" }; Pupil p5 = new Pupil() { Name = "Bob" }; Pupil p6 = new Pupil() { Name = "josé" }; Pupil p7 = new Pupil() { Name = "Emma" }; Pupil p8 = new Pupil() { Name = "Maaike" }; Pupil p9 = new Pupil() { Name = "Merel" }; Pupil p10 = new Pupil() { Name = "Ang" }; Pupil p11 = new Pupil() { Name = "Kora" }; Pupil p12 = new Pupil() { Name = "Zuko" }; Pupil p13 = new Pupil() { Name = "Samyn" }; Pupil p14 = new Pupil() { Name = "Labijn" }; Pupil p15 = new Pupil() { Name = "Van Schoor" }; Pupil p16 = new Pupil() { Name = "Jesus" }; Pupil p17 = new Pupil() { Name = "Maria" }; Pupil p18 = new Pupil() { Name = "Jozef" }; Pupil p19 = new Pupil() { Name = "Boudicca" }; Pupil p20 = new Pupil() { Name = "Arthur" }; Pupil p21 = new Pupil() { Name = "Merlijn" }; ICollection <Pupil> pList1 = new List <Pupil>(); pList1.Add(p1); pList1.Add(p2); pList1.Add(p3); ICollection <Pupil> pList2 = new List <Pupil>(); pList2.Add(p4); pList2.Add(p5); pList2.Add(p6); ICollection <Pupil> pList3 = new List <Pupil>(); pList3.Add(p7); pList3.Add(p8); pList3.Add(p9); ICollection <Pupil> pList4 = new List <Pupil>(); pList4.Add(p10); pList4.Add(p11); pList4.Add(p12); ICollection <Pupil> pList5 = new List <Pupil>(); pList5.Add(p13); pList5.Add(p14); pList5.Add(p15); ICollection <Pupil> pList6 = new List <Pupil>(); pList6.Add(p16); pList6.Add(p17); pList6.Add(p18); ICollection <Pupil> pList7 = new List <Pupil>(); pList7.Add(p19); pList7.Add(p20); pList7.Add(p21); ////generate some groups Group testG1 = new Group() { Name = "Groep E1", Pupils = pList1, Selected = false, Blocked = false }; Group testG2 = new Group() { Name = "Groep E2", Pupils = pList2, Selected = false, Blocked = false }; Group testG3 = new Group() { Name = "Groep E3", Pupils = pList3, Selected = false, Blocked = false }; Group testG4 = new Group() { Name = "Groep E4", Pupils = pList4, Selected = false, Blocked = false }; Group testG5 = new Group() { Name = "Groep E5", Pupils = pList5, Selected = false, Blocked = false }; Group testG6 = new Group() { Name = "Groep E6", Pupils = pList6, Selected = false, Blocked = false }; Group testG7 = new Group() { Name = "Groep E7", Pupils = pList7, Selected = false, Blocked = false }; ICollection <Group> gList1 = new List <Group>(); gList1.Add(testG1); gList1.Add(testG2); gList1.Add(testG3); gList1.Add(testG4); ICollection <Group> gList2 = new List <Group>(); gList2.Add(testG5); gList2.Add(testG6); gList2.Add(testG7); //generate some sessions Sessie testS1 = new Sessie() { Name = "Wiskunde", Desc = "Dit is een Moeilijke Sessie waarin je Wiskunde beter leert beheersen.", DayStarted = new DateTime(2016, 12, 19), IsActive = true, HasStarted = false, HasFeedback = true, IsDayEducation = true, Box = testB1, Groups = gList1 }; Sessie testS2 = new Sessie() { Name = "Aardrijkskunde", Desc = "Dit is een makkelijke sessie om Aardrijkskunde onder de knie te krijgen.", DayStarted = new DateTime(2018, 04, 16), IsActive = false, HasStarted = false, HasFeedback = false, IsDayEducation = true, Box = testB2, Groups = gList2 }; ICollection <Sessie> sList = new List <Sessie>(); sList.Add(testS1); sList.Add(testS2); _context.Sessies.AddRange(sList); //generate a user Leerkracht jan = new Leerkracht() { Surname = "Peeters", UserName = "******", Email = "*****@*****.**" }; //Console.WriteLine(jan.Email); //Console.ReadKey(); _context.Leerkrachten.Add(jan); ApplicationUser user1 = new ApplicationUser { UserName = jan.Email, Email = jan.Email }; await _userManager.CreateAsync(user1, "P@ssword1"); await _userManager.AddClaimAsync(user1, new Claim(ClaimTypes.Role, "Leerkracht")); _context.SaveChanges(); } }
public override void VerwijderActie(Actie actie) { Groep.Acties().Remove(actie); }
public override void VoegActieToe(Actie actie) { Groep.Acties().Add(actie); }
public virtual void VerwijderActie(Actie actie) { throw new InvalidOperationException("U kan momenteel geen acties verwijderen"); }
public virtual void VoegActieToe(Actie actie) { throw new InvalidOperationException("Er kunnen geen acties toegevoegd worden"); }
public void VerwijderActie(Actie actie) { _acties.Remove(actie); }