Implémentation des modèles EP et Formation

master
lchandellier 5 years ago
parent 729764aacf
commit 0e6965c3dc
  1. 14
      Modele/EpModele/EP.cs
  2. 70
      Modele/FormationModele/Formation.cs

@ -8,4 +8,18 @@ namespace EPAServeur.Modele.EpModele
public class EP public class EP
{ {
} }
public class evaluation
{
public string libelle { get; set; }
public int note { get; set; }
public string commentaire { get; set; }
public evaluation(string libelle, int note, string commentaire)
{
this.libelle = libelle;
this.note = note;
this.commentaire = commentaire;
}
}
} }

@ -1,4 +1,5 @@
using System; using EPAServeur.Commun;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -7,5 +8,72 @@ namespace EPAServeur.Modele.FormationModele
{ {
public class Formation public class Formation
{ {
public int idFormation { set; get; }
public string intitule { set; get; }
public DateTime dateDebut { set; get; }
public DateTime dateFin { set; get; }
int _statut;
public string statut
{
set { this._statut = int.Parse(value); }
get
{
string returnValue;
switch (this._statut)
{
case 0:
returnValue = "En Cours";
break;
default:
returnValue = "";
break;
};
return returnValue;
}
}
public string lieu { set; get; }
public string duree { set; get; }
public string organisme { set; get; }
public string nomFormateur { set; get; }
public Formation(int idFormation, string intitule, DateTime dateDebut, DateTime dateFin, string statut, string lieu, string duree, string organisme, string nomFormateur)
{
this.idFormation = idFormation;
this.intitule = intitule;
this.dateDebut = dateDebut;
this.dateFin = dateFin;
this.statut = statut;
this.lieu = lieu;
this.duree = duree;
this.organisme = organisme;
this.nomFormateur = nomFormateur;
}
public string generateInsertStatement()
{
string query = "INSERT INTO formation " +
" (Intitulé, DateDebut, DateFin, Statut, Lieu, Duree, Organisme, NomFormateur)" +
" VALUES" +
$" ('{this.intitule}','{Function.TransformNetDateTimeToSqlDate(this.dateDebut)}'," +
$"'{Function.TransformNetDateTimeToSqlDate(this.dateFin)}',{this._statut},'{this.lieu}'," +
$"'{this.duree}','{this.organisme}','{this.nomFormateur}');";
return query;
}
public string generateUpdateStatement()
{
string query = "UPDATE formation " +
"SET " +
$"Intitulé = {this.intitule}, " +
$"DateDebut = {Function.TransformNetDateTimeToSqlDate(this.dateDebut)}, " +
$"DateFin = {Function.TransformNetDateTimeToSqlDate(this.dateFin)}, " +
$"Statut = {this._statut}, " +
$"Lieu = {this.lieu}, " +
$"Duree = {this.duree}, " +
$"Organisme = {this.organisme}, " +
$"NomFormateur = {this.nomFormateur} " +
$"WHERE IdFormation = {this.idFormation};";
return query;
}
} }
} }

Loading…
Cancel
Save