Merge remote-tracking branch 'origin/DevMathieu' into DevFrits

This commit is contained in:
frits000000 2020-12-18 12:53:31 +01:00
commit 8982be3f10
244 changed files with 21636 additions and 12 deletions

25
.dockerignore Normal file
View File

@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

12
.gitignore vendored
View File

@ -1,13 +1 @@
node_modules/**/*
expo/*
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
# macOS
.DS_Store

Binary file not shown.

Binary file not shown.

Binary file not shown.

25
AlfaPrentice.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AlfaPrentice", "AlfaPrentice\AlfaPrentice.csproj", "{F1B31CC9-8926-432F-945E-6E47A30E276C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F1B31CC9-8926-432F-945E-6E47A30E276C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F1B31CC9-8926-432F-945E-6E47A30E276C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F1B31CC9-8926-432F-945E-6E47A30E276C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F1B31CC9-8926-432F-945E-6E47A30E276C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9923371F-BE95-4DF6-8B5E-6A66760F5A2C}
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@ -0,0 +1,9 @@
{
"ExpandedNodes": [
"",
"\\Data",
"\\Models"
],
"SelectedNode": "\\Models\\Gebruiker.cs",
"PreviewInSolutionExplorer": false
}

Binary file not shown.

View File

@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<UserSecretsId>7ad3dc27-95ec-4ea9-8715-97e5b90343e0</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.10" NoWarn="NU1605" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="3.1.10" NoWarn="NU1605" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.10" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.10" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.10" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.10" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.4" />
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.22" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
</ItemGroup>
<ItemGroup>
<Folder Include="Data\" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ActiveDebugProfile>AlfaPrentice</ActiveDebugProfile>
<Controller_SelectedScaffolderID>MvcControllerWithActionsScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,56 @@
using AlfaPrentice.Data;
using AlfaPrentice.Models;
using AlfaPrentice.Repositorys.Interfaces;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace AlfaPrentice.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class BedrijfController : ControllerBase
{
//constructor
public IBedrijfRepository bedrijfRepo;
public BedrijfController(IBedrijfRepository bedrijfRepo)
{
this.bedrijfRepo = bedrijfRepo;
}
[HttpGet]
public IEnumerable<Bedrijf> GetBedrijf()
{
var bedrijven =bedrijfRepo.GetBedrijven();
return bedrijven;
}
//get bedrijf by ID
[HttpGet("{Bedrijf_ID}")]
public Bedrijf GetBedrijf(int Bedrijf_ID)
{
var bedrijf = bedrijfRepo.GetBedrijf(Bedrijf_ID);
return bedrijf;
}
//add geheel bedrijf
[HttpPost]
public void AddBedrijf([FromBody] Bedrijf bedrijf)
{
bedrijfRepo.AddBedrijf(bedrijf);
}
//update een volledig bedrijf
[HttpPost]
public void UpdateBedrijf([FromBody] Bedrijf bedrijf)
{
bedrijfRepo.UpdateBedrijf(bedrijf);
}
}
}

View File

@ -0,0 +1,49 @@
using AlfaPrentice.Data;
using AlfaPrentice.Models;
using AlfaPrentice.Repositorys.Interfaces;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace AlfaPrentice.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class SollicitatieController : ControllerBase
{
//constructor
public ISollicitatieRepository sollicitatieRepo;
public SollicitatieController(ISollicitatieRepository sollicitatieRepo)
{
this.sollicitatieRepo = sollicitatieRepo;
}
//get list sollicitaties
[HttpGet]
public IEnumerable<Sollicitatie> GetSollicitaties()
{
var sollicitaties = sollicitatieRepo.GetSollicitaties();
return sollicitaties;
}
//get sollicitatie by student_ID
[HttpGet("{Student_ID}")]
public Sollicitatie GetSollicitatie(int Student_ID)
{
var sollicitatie = sollicitatieRepo.GetSollicitatie(Student_ID);
return sollicitatie;
}
// POST api/<SollicitatieController>
[HttpPost]
public void Post([FromBody] Sollicitatie sollicitatie)
{
sollicitatieRepo.AddSollicitatie(sollicitatie);
}
}
}

View File

@ -0,0 +1,39 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
}
}
}

View File

@ -0,0 +1,54 @@
using AlfaPrentice.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Data
{
public class AlfaPrenticeContext : DbContext
{
public AlfaPrenticeContext(DbContextOptions<AlfaPrenticeContext> options) : base(options)
{
}
//Gebruiker tabellen
public DbSet<Gebruiker> Gebruiker { get; set; }
public DbSet<Adres> Adres { get; set; }
public DbSet<Student> Student { get; set; }
public DbSet<Docent> Docent { get; set; }
public DbSet<Mentor> Mentor { get; set; }
public DbSet<BPVDocent> BPVDocent { get; set; }
public DbSet<Stagecoordinator> Stagecoordinator { get; set; }
//Bedrijf tabellen
public DbSet<Bedrijf> Bedrijf { get; set; }
public DbSet<Praktijkbegeleider> Praktijkbegeleider { get; set; }
public DbSet<Stageplek> Stageplek { get; set; }
public DbSet<Eisen> Eisen { get; set; }
//agenda en bericht tabellen
public DbSet<Bericht> Bericht { get; set; }
public DbSet<Agenda> Agenda { get; set; }
public DbSet<Afspraak> Afspraak { get; set; }
public DbSet<AgendaBlok> AgendaBlock { get; set; }
//School tabellen
public DbSet<Opleiding> Opleiding { get; set; }
public DbSet<Klas> Klas { get; set; }
//stageperiode tabellen
public DbSet<Sollicitatie> Sollicitatie { get; set; }
public DbSet<Traject> Traject { get; set; }
public DbSet<POK> POK { get; set; }
public DbSet<Weekstaten> Weekstaten { get; set; }
public DbSet<Evaluatie> Evaluatie { get; set; }
//system tabel
public DbSet<Session> Session { get; set; }
}
}

22
AlfaPrentice/Dockerfile Normal file
View File

@ -0,0 +1,22 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
WORKDIR /src
COPY ["AlfaPrentice/AlfaPrentice.csproj", "AlfaPrentice/"]
RUN dotnet restore "AlfaPrentice/AlfaPrentice.csproj"
COPY . .
WORKDIR "/src/AlfaPrentice"
RUN dotnet build "AlfaPrentice.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "AlfaPrentice.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "AlfaPrentice.dll"]

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Adres
{
[Key]
public int Adres_ID { get; set; }
public string Straat { get; set; }
public int Huisnummer { get; set; }
public string Toevoeging { get; set; }
public string Postcode { get; set; }
public string Plaats { get; set; }
public string Land { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Afspraak
{
[Key]
public int Afspraak_ID { get; set; }
public int Agenda_ID { get; set; }
public DateTime BeginDatumeTijd { get; set; }
public int EindDaatumTijd { get; set; }
public string Locatie { get; set; }
public string Omschrijving { get; set; }
public string Onderwerp { get; set; }
public int Gebruiker_ID { get; set; }
public int Docent_ID { get; set; }
public int Student_ID { get; set; }
public int Praktijkbegeleider_ID { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Agenda
{
[Key]
public int Agenda_ID { get; set; }
public int AgendaBlock_ID { get; set; }
public int Gebruiker_ID { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class AgendaBlok
{
[Key]
public int AgendaBlok_ID { get; set; }
public DateTime BeginDatumTijd { get; set; }
public DateTime EindDatumTijd { get; set; }
public int Agenda_ID { get; set; }
public int Gebruiker_ID { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class AppSettings
{
public string EmailSmtp { get; set; }
public string EmailUsername { get; set; }
public string EmailPassword { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class BPVDocent
{
[Key]
public int BPVdocent_ID { get; set; }
public int Docent_ID { get; set; }
public int Student_ID { get; set; }
public int Traject_ID { get; set; }
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Bedrijf
{
[Key]
public int Bedrijf_ID { get; set; }
public string Naam { get; set; }
public string Logo { get; set; }
public string Beschrijving { get; set; }
public string Email { get; set; }
public int Telefoon { get; set; }
public string Status { get; set; }
public int Adres_ID { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Bericht
{
[Key]
public int Bericht_ID { get; set; }
public string Onderwerp { get; set; }
public string Berichtt { get; set; }
public DateTime BerichtDatumTijd { get; set; }
public int Afzender { get; set; }
public int Gebruiker_ID { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Docent
{
[Key]
public int Docent_ID { get; set; }
public int Gebruiker_ID { get; set; }
public string DrieLetterCode { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Document
{
[Key]
public int Document_ID { get; set; }
public string Bestand { get; set; }
public DateTime UploadDatumTijd { get; set; }
public int Versie { get; set; }
public int Gebruiker_ID { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Eisen
{
[Key]
public int Eisen_ID { get; set; }
public string Omschrijving { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Evaluatie
{
[Key]
public int Evaluatie_ID { get; set; }
public string Beoordeling { get; set; }
public string Feedbakc { get; set; }
public int Student_ID { get; set; }
public int BPVdocent_ID { get; set; }
public int Praktijkbegeleider_ID { get; set; }
public int EvaluatieDatumTIjd { get; set; }
public bool Accodering { get; set; }
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Gebruiker
{
[Key]
public int Gebruiker_ID { get; set; }
public string Voornaam { get; set; }
public string Tussenvoegsel { get; set; }
public string Achternaam { get; set; }
public DateTime GeboorteDatum { get; set; }
public string Geslacht { get; set; }
public string Email { get; set; }
public int Telefoon { get; set; }
public string Wachtwoord { get; set; }
public string Profielfoto { get; set; }
public string Status { get; set; }
public int Adres_ID { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Klas
{
[Key]
public int Klas_ID { get; set; }
public string Klasnaam { get; set; }
public int Mentor_ID { get; set; }
public int Opeleiding { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Mentor
{
[Key]
public int Mentor_ID { get; set; }
public int Docent_ID { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Opleiding
{
[Key]
public int Opleiding_ID { get; set; }
public string Naam { get; set; }
public string Omschrijving { get; set; }
public string Status { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class POK
{
[Key]
public int POK_ID { get; set; }
public bool Accodering { get; set; }
public DateTime AccoderingDatum { get; set; }
public DateTime AnnmaakDatum { get; set; }
public int Student_ID { get; set; }
public int BPVdocent_ID { get; set; }
public int Praktijkbegeleider_ID { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Praktijkbegeleider
{
[Key]
public int Praktijkbegeleider_ID { get; set; }
public string Functie { get; set; }
public int Bedrijf_ID { get; set; }
public int Gebruiker_ID { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Session
{
[Key]
public int Session_ID { get; set; }
public string SessionToken { get; set; }
public DateTime SessionVervalDatumTijd { get; set; }
public int Gebruiker_ID { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Sollicitatie
{
[Key]
public int Sollicitatie_ID { get; set; }
public DateTime SolicitaieDatum { get; set; }
public string Status { get; set; }
public int Bedrijf_ID { get; set; }
public int Student_ID { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Stageplek
{
[Key]
public int StagePlek_ID { get; set; }
public int AantalPlekken { get; set; }
public int Bedrijf_ID { get; set; }
public int Eisen_ID { get; set; }
public int Opleiding_ID { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Stagecoordinator
{
[Key]
public int StageCoördinator_ID { get; set; }
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Student
{
[Key]
public int Student_ID { get; set; }
public DateTime BeginDatum { get; set; }
public int Leerjaar { get; set; }
public int Adres_ID { get; set; }
public string CV { get; set; }
public string Motivatiebrief { get; set; }
public string Programmeertalen { get; set; }
public string Weblinks { get; set; }
public int Gebruiker_ID { get; set; }
public int Klas_ID { get; set; }
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Traject
{
[Key]
public int Traject_ID { get; set; }
public int Student_ID { get; set; }
public int BPVdocent_ID { get; set; }
public int Praktijkbegelijder_ID { get; set; }
public DateTime BeginDatum { get; set; }
public DateTime EindDatum { get; set; }
public int Evaluatie_ID { get; set; }
public int Weekstaten_ID { get; set; }
public int POK_ID { get; set; }
public int Sollicitatie_ID { get; set; }
public int StageCoördinator_ID { get; set; }
public int Document_ID { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Models
{
public class Weekstaten
{
[Key]
public int Weekstaten_ID { get; set; }
public string Beschrijving { get; set; }
public DateTime BeginDatumTijd { get; set; }
public DateTime EindDatumTijd { get; set; }
public int Student_ID { get; set; }
public string Status { get; set; }
public int GewerkteUren { get; set; }
}
}

26
AlfaPrentice/Program.cs Normal file
View File

@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}

View File

@ -0,0 +1,38 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:30460",
"sslPort": 44358
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"AlfaPrentice": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": "true",
"applicationUrl": "https://localhost:5001;http://localhost:5000"
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
"publishAllPorts": true,
"useSSL": true
}
}
}

View File

@ -0,0 +1,16 @@
using AlfaPrentice.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Repositorys.Interfaces
{
public interface IBedrijfRepository
{
List<Bedrijf> GetBedrijven();
Bedrijf GetBedrijf(int Bedrijf_ID);
Bedrijf AddBedrijf(Bedrijf bedrijf);
Bedrijf UpdateBedrijf(Bedrijf bedrijf);
}
}

View File

@ -0,0 +1,15 @@
using AlfaPrentice.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Repositorys.Interfaces
{
public interface ISollicitatieRepository
{
List<Sollicitatie> GetSollicitaties();
Sollicitatie GetSollicitatie(int Student_ID);
Sollicitatie AddSollicitatie(Sollicitatie Sollicitatie);
}
}

View File

@ -0,0 +1,50 @@
using AlfaPrentice.Data;
using AlfaPrentice.Models;
using AlfaPrentice.Repositorys.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Repositorys.implementaties
{
public class BedrijfRepository : IBedrijfRepository
{
AlfaPrenticeContext db;
public BedrijfRepository(AlfaPrenticeContext db)
{
this.db = db;
}
//get list of bedrijfven
public List<Bedrijf> GetBedrijven()
{
return db.Bedrijf.ToList();
}
//get bedrijf by ID
public Bedrijf GetBedrijf(int Bedrijf_ID)
{
return db.Bedrijf.Where(B => B.Bedrijf_ID == Bedrijf_ID).FirstOrDefault();
}
//add geheel bedrijf
public Bedrijf AddBedrijf(Bedrijf bedrijf)
{
db.Bedrijf.Add(bedrijf);
db.SaveChanges();
return bedrijf;
}
//update a complete bedrijf
public Bedrijf UpdateBedrijf(Bedrijf bedrijf)
{
db.Bedrijf.Update(bedrijf);
db.SaveChanges();
return bedrijf;
}
}
}

View File

@ -0,0 +1,39 @@
using AlfaPrentice.Data;
using AlfaPrentice.Models;
using AlfaPrentice.Repositorys.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice.Repositorys.implementaties
{
public class SollicitatieRepository : ISollicitatieRepository
{
AlfaPrenticeContext db;
public SollicitatieRepository(AlfaPrenticeContext db)
{
this.db = db;
}
//get list of sollicitaties
public List<Sollicitatie> GetSollicitaties()
{
return db.Sollicitatie.ToList();
}
//get sollicitatie by Student_ID
public Sollicitatie GetSollicitatie(int Student_ID)
{
return db.Sollicitatie.Where(S => S.Student_ID == Student_ID).FirstOrDefault();
}
//Add complete sollicitatie
public Sollicitatie AddSollicitatie(Sollicitatie sollicitatie)
{
db.Sollicitatie.Add(sollicitatie);
db.SaveChanges();
return null;
}
}
}

69
AlfaPrentice/Startup.cs Normal file
View File

@ -0,0 +1,69 @@
using AlfaPrentice.Data;
using AlfaPrentice.Repositorys.implementaties;
using AlfaPrentice.Repositorys.Interfaces;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.OpenApi.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AlfaPrentice
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<Models.AppSettings>(Configuration);
services.AddDbContext<AlfaPrenticeContext>(options => options.UseMySQL(Configuration.GetConnectionString("AlfaPrentice")));
//depencies for interface and repos
services.AddTransient<IBedrijfRepository, BedrijfRepository>();
services.AddTransient<ISollicitatieRepository, SollicitatieRepository>();
services.AddControllers();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "AlfaPrentice", Version = "v1" });
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseSwagger();
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "AlfaPrentice v1"));
}
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
}
}

View File

@ -0,0 +1,15 @@
using System;
namespace AlfaPrentice
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string Summary { get; set; }
}
}

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

View File

@ -0,0 +1,17 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ConnectionStrings": {
"AlfaPrentice": "Server=localhost;User Id=root; Database=AlfaPrentice"
},
"emailsmtp": "mail.incapabel.com",
"emailusername": "info@incapabel.com",
"emailpassword": "@Alfa2019",
"AllowedHosts": "*"
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,8 @@
{
"runtimeOptions": {
"additionalProbingPaths": [
"C:\\Users\\mathieu\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\mathieu\\.nuget\\packages"
]
}
}

View File

@ -0,0 +1,13 @@
{
"runtimeOptions": {
"tfm": "net5.0",
"framework": {
"name": "Microsoft.AspNetCore.App",
"version": "5.0.0"
},
"configProperties": {
"System.GC.Server": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More