Resolved Merge Conflict
This commit is contained in:
parent
0c9c7584f8
commit
ff5dc64ec1
BIN
.vs/AlfaPrentice/DesignTimeBuild/.dtbcache.v2
Normal file
BIN
.vs/AlfaPrentice/DesignTimeBuild/.dtbcache.v2
Normal file
Binary file not shown.
BIN
.vs/AlfaPrentice/v16/.suo
Normal file
BIN
.vs/AlfaPrentice/v16/.suo
Normal file
Binary file not shown.
25
dotnet/AlfaPrentice.sln
Normal file
25
dotnet/AlfaPrentice.sln
Normal 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
|
||||
28
dotnet/AlfaPrentice/AlfaPrentice.csproj
Normal file
28
dotnet/AlfaPrentice/AlfaPrentice.csproj
Normal 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>
|
||||
12
dotnet/AlfaPrentice/AlfaPrentice.csproj.user
Normal file
12
dotnet/AlfaPrentice/AlfaPrentice.csproj.user
Normal 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>
|
||||
56
dotnet/AlfaPrentice/Controllers/BedrijfController.cs
Normal file
56
dotnet/AlfaPrentice/Controllers/BedrijfController.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
49
dotnet/AlfaPrentice/Controllers/SollicitatieController.cs
Normal file
49
dotnet/AlfaPrentice/Controllers/SollicitatieController.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
39
dotnet/AlfaPrentice/Controllers/WeatherForecastController.cs
Normal file
39
dotnet/AlfaPrentice/Controllers/WeatherForecastController.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
55
dotnet/AlfaPrentice/Data/AlfaPrenticeContext.cs
Normal file
55
dotnet/AlfaPrentice/Data/AlfaPrenticeContext.cs
Normal file
@ -0,0 +1,55 @@
|
||||
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; }
|
||||
public DbSet<Deelnemer> Deelnemer { 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
dotnet/AlfaPrentice/Dockerfile
Normal file
22
dotnet/AlfaPrentice/Dockerfile
Normal 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"]
|
||||
20
dotnet/AlfaPrentice/Models/Adres.cs
Normal file
20
dotnet/AlfaPrentice/Models/Adres.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
24
dotnet/AlfaPrentice/Models/Afspraak.cs
Normal file
24
dotnet/AlfaPrentice/Models/Afspraak.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
16
dotnet/AlfaPrentice/Models/Agenda.cs
Normal file
16
dotnet/AlfaPrentice/Models/Agenda.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
18
dotnet/AlfaPrentice/Models/AgendaBlok.cs
Normal file
18
dotnet/AlfaPrentice/Models/AgendaBlok.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
14
dotnet/AlfaPrentice/Models/AppSettings.cs
Normal file
14
dotnet/AlfaPrentice/Models/AppSettings.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
17
dotnet/AlfaPrentice/Models/BPVDocent.cs
Normal file
17
dotnet/AlfaPrentice/Models/BPVDocent.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
22
dotnet/AlfaPrentice/Models/Bedrijf.cs
Normal file
22
dotnet/AlfaPrentice/Models/Bedrijf.cs
Normal 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; }
|
||||
|
||||
}
|
||||
}
|
||||
20
dotnet/AlfaPrentice/Models/Bericht.cs
Normal file
20
dotnet/AlfaPrentice/Models/Bericht.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
19
dotnet/AlfaPrentice/Models/Deelnemer.cs
Normal file
19
dotnet/AlfaPrentice/Models/Deelnemer.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AlfaPrentice.Models
|
||||
{
|
||||
public class Deelnemer
|
||||
{
|
||||
[Key]
|
||||
public int Deelnemer_ID { get; set; }
|
||||
public int Afspraak_ID { get; set; }
|
||||
public int Student_ID { get; st; }
|
||||
public int BPVdocent_ID { get; set; }
|
||||
public int Docent_ID { get; set; }
|
||||
public int Praktijkbegeleider_ID { get; set; }
|
||||
}
|
||||
}
|
||||
16
dotnet/AlfaPrentice/Models/Docent.cs
Normal file
16
dotnet/AlfaPrentice/Models/Docent.cs
Normal 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 : Gebruiker
|
||||
{
|
||||
[Key]
|
||||
public int Docent_ID { get; set; }
|
||||
public int Gebruiker_ID { get; set; }
|
||||
public string DrieLetterCode { get; set; }
|
||||
}
|
||||
}
|
||||
18
dotnet/AlfaPrentice/Models/Document.cs
Normal file
18
dotnet/AlfaPrentice/Models/Document.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
15
dotnet/AlfaPrentice/Models/Eisen.cs
Normal file
15
dotnet/AlfaPrentice/Models/Eisen.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
21
dotnet/AlfaPrentice/Models/Evaluatie.cs
Normal file
21
dotnet/AlfaPrentice/Models/Evaluatie.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
25
dotnet/AlfaPrentice/Models/Gebruiker.cs
Normal file
25
dotnet/AlfaPrentice/Models/Gebruiker.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
17
dotnet/AlfaPrentice/Models/Klas.cs
Normal file
17
dotnet/AlfaPrentice/Models/Klas.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
15
dotnet/AlfaPrentice/Models/Mentor.cs
Normal file
15
dotnet/AlfaPrentice/Models/Mentor.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
17
dotnet/AlfaPrentice/Models/Opleiding.cs
Normal file
17
dotnet/AlfaPrentice/Models/Opleiding.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
20
dotnet/AlfaPrentice/Models/POK.cs
Normal file
20
dotnet/AlfaPrentice/Models/POK.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
18
dotnet/AlfaPrentice/Models/Praktijkbegeleider.cs
Normal file
18
dotnet/AlfaPrentice/Models/Praktijkbegeleider.cs
Normal 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 : Gebruiker
|
||||
{
|
||||
[Key]
|
||||
|
||||
public int Praktijkbegeleider_ID { get; set; }
|
||||
public string Functie { get; set; }
|
||||
public int Bedrijf_ID { get; set; }
|
||||
public int Gebruiker_ID { get; set; }
|
||||
}
|
||||
}
|
||||
17
dotnet/AlfaPrentice/Models/Session.cs
Normal file
17
dotnet/AlfaPrentice/Models/Session.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
18
dotnet/AlfaPrentice/Models/Sollicitatie.cs
Normal file
18
dotnet/AlfaPrentice/Models/Sollicitatie.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
18
dotnet/AlfaPrentice/Models/StagePlek.cs
Normal file
18
dotnet/AlfaPrentice/Models/StagePlek.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
14
dotnet/AlfaPrentice/Models/Stagecoordinator.cs
Normal file
14
dotnet/AlfaPrentice/Models/Stagecoordinator.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
23
dotnet/AlfaPrentice/Models/Student.cs
Normal file
23
dotnet/AlfaPrentice/Models/Student.cs
Normal 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 : Gebruiker
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
}
|
||||
25
dotnet/AlfaPrentice/Models/Traject.cs
Normal file
25
dotnet/AlfaPrentice/Models/Traject.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
20
dotnet/AlfaPrentice/Models/Weekstaten.cs
Normal file
20
dotnet/AlfaPrentice/Models/Weekstaten.cs
Normal 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
dotnet/AlfaPrentice/Program.cs
Normal file
26
dotnet/AlfaPrentice/Program.cs
Normal 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>();
|
||||
});
|
||||
}
|
||||
}
|
||||
38
dotnet/AlfaPrentice/Properties/launchSettings.json
Normal file
38
dotnet/AlfaPrentice/Properties/launchSettings.json
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AlfaPrentice.Repositorys.Interfaces
|
||||
{
|
||||
public interface IAfspraakRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
using AlfaPrentice.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AlfaPrentice.Repositorys.Interfaces
|
||||
{
|
||||
public interface IAgendaRepository
|
||||
{
|
||||
//agenda functions
|
||||
List<Agenda> GetAgendas();
|
||||
Agenda GetAgenda(int Gebruiker_ID);
|
||||
Agenda AddAgenda(Agenda agenda);
|
||||
|
||||
//agendablock functions
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,133 @@
|
||||
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 AfspraakRepository : IAfspraakRepository
|
||||
{
|
||||
AlfaPrenticeContext db;
|
||||
public AfspraakRepository(AlfaPrenticeContext db)
|
||||
{
|
||||
this.db = db;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get afspraken by ID of Gebruiker
|
||||
/// </summary>
|
||||
/// <param name="Gebruiker_ID"></param>
|
||||
/// <returns>GetAfspraken</returns>
|
||||
public List<Afspraak> GetAfspraken(int Gebruiker_ID)
|
||||
{
|
||||
return db.Afspraak.Where(G => G.Gebruiker_ID == Gebruiker_ID).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get 1 afspraak by Afspraak_ID and Gebruiker_ID
|
||||
/// </summary>
|
||||
/// <param name="Afspraak_ID"></param>
|
||||
/// <param name="Gebruiker_ID"></param>
|
||||
/// <returns>GetAfspraak</returns>
|
||||
public Afspraak GetAfspraak(int Afspraak_ID, int Gebruiker_ID)
|
||||
{
|
||||
return db.Afspraak.Where(A => A.Afspraak_ID == Afspraak_ID && A.Gebruiker_ID == Gebruiker_ID).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a afspraak
|
||||
/// </summary>
|
||||
/// <param name="afspraak"></param>
|
||||
/// <returns>AddAfspraak</returns>
|
||||
public Afspraak AddAfspraak(Afspraak afspraak)
|
||||
{
|
||||
db.Afspraak.Add(afspraak);
|
||||
db.SaveChanges();
|
||||
|
||||
return afspraak;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Upodate afspraak
|
||||
/// </summary>
|
||||
/// <param name="afspraak"></param>
|
||||
/// <returns>UpdateAfspraak</returns>
|
||||
public Afspraak UpdateAfspraak(Afspraak afspraak)
|
||||
{
|
||||
db.Afspraak.Update(afspraak);
|
||||
db.SaveChanges();
|
||||
|
||||
return afspraak;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete a afspraak
|
||||
/// </summary>
|
||||
/// <param name="afspraak"></param>
|
||||
/// <returns>DeleteAfspraak</returns>
|
||||
public Afspraak DeleteAfspraak(Afspraak afspraak)
|
||||
{
|
||||
db.Afspraak.Remove(afspraak);
|
||||
db.SaveChanges();
|
||||
|
||||
return afspraak;
|
||||
}
|
||||
|
||||
/*
|
||||
Querys for deelnemers of Afpraak
|
||||
*/
|
||||
/*
|
||||
/// <summary>
|
||||
/// Get list of afspraak by Afspraak_ID
|
||||
/// </summary>
|
||||
/// <param name="Aspraak_ID"></param>
|
||||
/// <returns>GetDeelnemers</returns>
|
||||
public List<Deelnemer> GetDeelnemers(int Aspraak_ID)
|
||||
{
|
||||
return db.Deelnemer.Where(D => D.Afspraak_ID == Afspraak_ID).ToList();
|
||||
}*/
|
||||
|
||||
/// <summary>
|
||||
/// Add deelnemer to afspraak
|
||||
/// </summary>
|
||||
/// <param name="deelnemer"></param>
|
||||
/// <returns>AddDeelnemer</returns>
|
||||
public Deelnemer AddDeelnemer(Deelnemer deelnemer)
|
||||
{
|
||||
db.Deelnemer.Add(deelnemer);
|
||||
db.SaveChanges();
|
||||
|
||||
return deelnemer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update deelnemer of a afspraak
|
||||
/// </summary>
|
||||
/// <param name="deelnemer"></param>
|
||||
/// <returns>UpdateDeelnemer</returns>
|
||||
public Deelnemer UpdateDeelnemer(Deelnemer deelnemer)
|
||||
{
|
||||
db.Deelnemer.Update(deelnemer);
|
||||
db.SaveChanges();
|
||||
|
||||
return deelnemer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete deelnemer from a Afspraak
|
||||
/// </summary>
|
||||
/// <param name="deelnermer"></param>
|
||||
/// <returns>DeleteDeelnemer</returns>
|
||||
public Deelnemer Deletedeelnemer(Deelnemer deelnermer)
|
||||
{
|
||||
db.Deelnemer.Remove(deelnermer);
|
||||
db.SaveChanges();
|
||||
|
||||
return deelnermer;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,115 @@
|
||||
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 AgendaRepository : IAgendaRepository
|
||||
{
|
||||
AlfaPrenticeContext db;
|
||||
public AgendaRepository(AlfaPrenticeContext db)
|
||||
{
|
||||
this.db = db;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get list of all agendas
|
||||
/// </summary>
|
||||
/// <returns>ListAgenda</returns>
|
||||
public List<Agenda> GetAggendas()
|
||||
{
|
||||
return db.Agenda.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Agenda by Gebruiker_ID
|
||||
/// </summary>
|
||||
/// <param name="Gebruiker_ID"></param>
|
||||
/// <returns>Agenda</returns>
|
||||
public Agenda GetAgenda(int Gebruiker_ID)
|
||||
{
|
||||
return db.Agenda.Where(A => A.Gebruiker_ID == Gebruiker_ID).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add agenda for a Gebruiker
|
||||
/// </summary>
|
||||
/// <param name="agenda"></param>
|
||||
/// <returns>agenda</returns>
|
||||
public Agenda AddAgenda(Agenda agenda)
|
||||
{
|
||||
db.Agenda.Add(agenda);
|
||||
db.SaveChanges();
|
||||
|
||||
return agenda;
|
||||
}
|
||||
|
||||
/*
|
||||
querys for agendablock
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// Get Agendablock by Gebruiker_ID
|
||||
/// </summary>
|
||||
/// <param name="Gebruierk_ID"></param>
|
||||
/// <returns>GetBlokken</returns>
|
||||
public List<AgendaBlok> GetBlokken(int Gebruierk_ID)
|
||||
{
|
||||
return db.AgendaBlock.Where(G => G.Gebruiker_ID == Gebruierk_ID).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get 1 Agendablock on Gebruiker_ID
|
||||
/// </summary>
|
||||
/// <param name="Gebruiker_ID"></param>
|
||||
/// <returns>GetBlok</returns>
|
||||
public AgendaBlok GetBlok(int Gebruiker_ID)
|
||||
{
|
||||
return db.AgendaBlock.Where(G => G.Gebruiker_ID == Gebruiker_ID).FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add Agendablock for a gebruiker
|
||||
/// </summary>
|
||||
/// <param name="agendablok"></param>
|
||||
/// <returns>AddBlok</returns>
|
||||
public AgendaBlok AddBlok(AgendaBlok agendablok)
|
||||
{
|
||||
db.AgendaBlock.Add(agendablok);
|
||||
db.SaveChanges();
|
||||
|
||||
return agendablok;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update agendablok of a gebruiker
|
||||
/// </summary>
|
||||
/// <param name="agendablok"></param>
|
||||
/// <returns>UpdateBlok</returns>
|
||||
public AgendaBlok UpdateBlok(AgendaBlok agendablok)
|
||||
{
|
||||
db.AgendaBlock.Update(agendablok);
|
||||
db.SaveChanges();
|
||||
|
||||
return agendablok;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete AgendaBlok of a Gebruiker
|
||||
/// </summary>
|
||||
/// <param name="Agendablok_ID"></param>
|
||||
/// <param name="Gebruiker_ID"></param>
|
||||
/// <returns>DeleteBlok</returns>
|
||||
public AgendaBlok DeleteBlok(int Agendablok_ID, int Gebruiker_ID, AgendaBlok agendablok)
|
||||
{
|
||||
db.AgendaBlock.Remove(agendablok); //.Where(A => A.AgendaBlok_ID == Agendablok_ID && A.Gebruiker_ID == Gebruiker_ID);
|
||||
db.SaveChanges();
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -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 sollicitatie;
|
||||
}
|
||||
}
|
||||
}
|
||||
71
dotnet/AlfaPrentice/Startup.cs
Normal file
71
dotnet/AlfaPrentice/Startup.cs
Normal file
@ -0,0 +1,71 @@
|
||||
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<IAgendaRepository, AgendaRepository>();
|
||||
services.AddTransient<IAfspraakRepository, AfspraakRepository>();
|
||||
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();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
15
dotnet/AlfaPrentice/WeatherForecast.cs
Normal file
15
dotnet/AlfaPrentice/WeatherForecast.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
9
dotnet/AlfaPrentice/appsettings.Development.json
Normal file
9
dotnet/AlfaPrentice/appsettings.Development.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
17
dotnet/AlfaPrentice/appsettings.json
Normal file
17
dotnet/AlfaPrentice/appsettings.json
Normal 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": "*"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user