Kaynağa Gözat

NEW Ajout de la Restauration avec l'index des collèges et l'administration des enquêtes #44 et # 47

marjorie.sourdot 7 yıl önce
ebeveyn
işleme
ab0916dd42
71 değiştirilmiş dosya ile 2586 ekleme ve 998 silme
  1. 7 0
      CD67.FicheCollege.BDD/ActionEduActeurRoles.sql
  2. 22 0
      CD67.FicheCollege.BDD/ActionEduActeurs.sql
  3. 0 0
      CD67.FicheCollege.BDD/ActionEduAxes.sql
  4. 0 0
      CD67.FicheCollege.BDD/ActionEduMissions.sql
  5. 6 0
      CD67.FicheCollege.BDD/ActionEduStatuts.sql
  6. 0 0
      CD67.FicheCollege.BDD/ActionEduThematiques.sql
  7. 35 0
      CD67.FicheCollege.BDD/ActionsEdu.sql
  8. 9 14
      CD67.FicheCollege.BDD/ActionsEduColleges.sql
  9. 7 0
      CD67.FicheCollege.BDD/Annees.sql
  10. 19 18
      CD67.FicheCollege.BDD/CD67.FicheCollege.BDD.sqlproj
  11. 45 0
      CD67.FicheCollege.BDD/Colleges.sql
  12. 16 0
      CD67.FicheCollege.BDD/RestaurationParametres.sql
  13. 8 0
      CD67.FicheCollege.BDD/RestaurationParametresRepas.sql
  14. 7 0
      CD67.FicheCollege.BDD/RestaurationTypeRepas.sql
  15. 7 0
      CD67.FicheCollege.BDD/RestaurationTypes.sql
  16. 0 0
      CD67.FicheCollege.BDD/Territoires.sql
  17. 0 0
      CD67.FicheCollege.BDD/TypesCollege.sql
  18. 0 25
      CD67.FicheCollege.BDD/dbo/Tables/ActionsEdu.sql
  19. 0 6
      CD67.FicheCollege.BDD/dbo/Tables/Annees.sql
  20. 0 42
      CD67.FicheCollege.BDD/dbo/Tables/Colleges.sql
  21. 0 34
      CD67.FicheCollege.BDD/dbo/Tables/Identites.sql
  22. 3 0
      CD67.FicheCollege.Entity/Annee.cs
  23. 12 2
      CD67.FicheCollege.Entity/CD67.FicheCollege.Entity.csproj
  24. 2 0
      CD67.FicheCollege.Entity/College.cs
  25. 3 0
      CD67.FicheCollege.Entity/EntityModel.Context.cs
  26. 1 1
      CD67.FicheCollege.Entity/EntityModel.Designer.cs
  27. 230 1
      CD67.FicheCollege.Entity/EntityModel.edmx
  28. 14 8
      CD67.FicheCollege.Entity/EntityModel.edmx.diagram
  29. 0 446
      CD67.FicheCollege.Entity/EntityModel.edmx.sql
  30. 5 1
      CD67.FicheCollege.Entity/Extend/College.cs
  31. 43 0
      CD67.FicheCollege.Entity/Extend/RestaurationParametre.cs
  32. 32 0
      CD67.FicheCollege.Entity/Extend/RestaurationType.cs
  33. 32 0
      CD67.FicheCollege.Entity/Extend/RestaurationTypeRepa.cs
  34. 0 136
      CD67.FicheCollege.Entity/Model_initial_inserts.sql
  35. 35 0
      CD67.FicheCollege.Entity/RestaurationParametre.cs
  36. 31 0
      CD67.FicheCollege.Entity/RestaurationType.cs
  37. 31 0
      CD67.FicheCollege.Entity/RestaurationTypeRepa.cs
  38. 12 0
      CD67.FicheCollege.Factory/CD67.FicheCollege.Factory.csproj
  39. 1 0
      CD67.FicheCollege.Factory/CollegeFactory.cs
  40. 21 0
      CD67.FicheCollege.Factory/Internal/RestaurationParametreFactory.cs
  41. 21 0
      CD67.FicheCollege.Factory/Internal/RestaurationTypeFactory.cs
  42. 21 0
      CD67.FicheCollege.Factory/Internal/RestaurationTypeRepaFactory.cs
  43. 47 0
      CD67.FicheCollege.Factory/RestaurationParametreFactory.cs
  44. 73 0
      CD67.FicheCollege.Factory/RestaurationTypeFactory.cs
  45. 81 0
      CD67.FicheCollege.Factory/RestaurationTypeRepaFactory.cs
  46. 20 0
      CD67.FicheCollege.MVC/CD67.FicheCollege.MVC.csproj
  47. 40 0
      CD67.FicheCollege.MVC/Controllers/CollegesController.cs
  48. 45 0
      CD67.FicheCollege.MVC/Controllers/RestaurationController.cs
  49. 168 0
      CD67.FicheCollege.MVC/Controllers/RestaurationParametresController.cs
  50. 143 0
      CD67.FicheCollege.MVC/Controllers/RestaurationTypeRepasController.cs
  51. 143 0
      CD67.FicheCollege.MVC/Controllers/RestaurationTypesController.cs
  52. 14 0
      CD67.FicheCollege.MVC/Models/CheckBoxListItem.cs
  53. 4 0
      CD67.FicheCollege.MVC/Models/CollegeViewModel.cs
  54. 19 0
      CD67.FicheCollege.MVC/Models/RestaurationParametreViewModel.cs
  55. 29 0
      CD67.FicheCollege.MVC/Models/RestaurationTypeRepaViewModel.cs
  56. 29 0
      CD67.FicheCollege.MVC/Models/RestaurationTypeViewModel.cs
  57. 6 0
      CD67.FicheCollege.MVC/Mvc.sitemap
  58. 264 264
      CD67.FicheCollege.MVC/Views/Colleges/Edit.cshtml
  59. 79 0
      CD67.FicheCollege.MVC/Views/Colleges/Type.cshtml
  60. 79 0
      CD67.FicheCollege.MVC/Views/Restauration/Index.cshtml
  61. 98 0
      CD67.FicheCollege.MVC/Views/RestaurationParametres/Edit.cshtml
  62. 52 0
      CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Create.cshtml
  63. 42 0
      CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Delete.cshtml
  64. 54 0
      CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Edit.cshtml
  65. 77 0
      CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Index.cshtml
  66. 52 0
      CD67.FicheCollege.MVC/Views/RestaurationTypes/Create.cshtml
  67. 42 0
      CD67.FicheCollege.MVC/Views/RestaurationTypes/Delete.cshtml
  68. 54 0
      CD67.FicheCollege.MVC/Views/RestaurationTypes/Edit.cshtml
  69. 77 0
      CD67.FicheCollege.MVC/Views/RestaurationTypes/Index.cshtml
  70. 7 0
      CD67.FicheCollege.MVC/Views/Shared/_Layout.cshtml
  71. 10 0
      CD67.FicheCollege.sln

+ 7 - 0
CD67.FicheCollege.BDD/ActionEduActeurRoles.sql

@@ -0,0 +1,7 @@
+CREATE TABLE [dbo].[ActionEduActeurRoles] (
+    [Id]      INT          IDENTITY (1, 1) NOT NULL,
+    [Libelle] VARCHAR (50) NOT NULL,
+    [Ordre]   INT          NOT NULL,
+    CONSTRAINT [PK_ActionEduActeurRoles] PRIMARY KEY CLUSTERED ([Id] ASC)
+);
+

+ 22 - 0
CD67.FicheCollege.BDD/ActionEduActeurs.sql

@@ -0,0 +1,22 @@
+CREATE TABLE [dbo].[ActionEduActeurs] (
+    [Id]          INT           IDENTITY (1, 1) NOT NULL,
+    [Nom]         VARCHAR (MAX) NOT NULL,
+    [Sid]         NVARCHAR (7)  NULL,
+    [RoleId]      INT           NOT NULL,
+    [Commentaire] VARCHAR (MAX) NULL,
+    [ActionEduId] INT           NOT NULL,
+    CONSTRAINT [PK_ActionsEduActeursExt] PRIMARY KEY CLUSTERED ([Id] ASC),
+    CONSTRAINT [FK_ActionEduActeurs_ActionEduActeurRoles] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[ActionEduActeurRoles] ([Id]),
+    CONSTRAINT [FK_ActionEduActionEduActeur] FOREIGN KEY ([ActionEduId]) REFERENCES [dbo].[ActionsEdu] ([Id])
+);
+
+
+GO
+CREATE NONCLUSTERED INDEX [IX_FK_ActionEduActeursRoles]
+    ON [dbo].[ActionEduActeurs]([RoleId] ASC);
+
+
+GO
+CREATE NONCLUSTERED INDEX [IX_FK_ActionEduActionEduActeurs]
+    ON [dbo].[ActionEduActeurs]([ActionEduId] ASC);
+

+ 0 - 0
CD67.FicheCollege.BDD/dbo/Tables/ActionEduAxes.sql → CD67.FicheCollege.BDD/ActionEduAxes.sql


+ 0 - 0
CD67.FicheCollege.BDD/dbo/Tables/ActionEduMissions.sql → CD67.FicheCollege.BDD/ActionEduMissions.sql


+ 6 - 0
CD67.FicheCollege.BDD/ActionEduStatuts.sql

@@ -0,0 +1,6 @@
+CREATE TABLE [dbo].[ActionEduStatuts] (
+    [Id]  INT          NOT NULL,
+    [Nom] VARCHAR (50) NOT NULL,
+    CONSTRAINT [PK_ActionsEduStatuts] PRIMARY KEY CLUSTERED ([Id] ASC)
+);
+

+ 0 - 0
CD67.FicheCollege.BDD/dbo/Tables/ActionEduThematiques.sql → CD67.FicheCollege.BDD/ActionEduThematiques.sql


+ 35 - 0
CD67.FicheCollege.BDD/ActionsEdu.sql

@@ -0,0 +1,35 @@
+CREATE TABLE [dbo].[ActionsEdu] (
+    [Id]                    INT              IDENTITY (1, 1) NOT NULL,
+    [Numero]                NVARCHAR (MAX)   NOT NULL,
+    [Nom]                   NVARCHAR (MAX)   NOT NULL,
+    [Montant]               DECIMAL (18)     NULL,
+    [Description]           NVARCHAR (MAX)   NULL,
+    [CommentaireInterne]    NVARCHAR (MAX)   NULL,
+    [CommentairePublic]     NVARCHAR (MAX)   NULL,
+    [Neutralise]            BIT              NOT NULL,
+    [Ordre]                 INT              NOT NULL,
+    [ActionEduThematiqueId] INT              NOT NULL,
+    [StatutId]              INT              CONSTRAINT [DF_ActionsEdu_StatutId] DEFAULT ((0)) NOT NULL,
+    [AnneeId]               INT              NOT NULL,
+    [TokenId]               UNIQUEIDENTIFIER NOT NULL,
+    CONSTRAINT [PK_ActionsEdu] PRIMARY KEY CLUSTERED ([Id] ASC),
+    CONSTRAINT [FK_ActionEduAnnee] FOREIGN KEY ([AnneeId]) REFERENCES [dbo].[Annees] ([Id]),
+    CONSTRAINT [FK_ActionEduThematiqueActionEdu] FOREIGN KEY ([ActionEduThematiqueId]) REFERENCES [dbo].[ActionEduThematiques] ([Id]),
+    CONSTRAINT [FK_ActionsEdu_ActionEduStatuts] FOREIGN KEY ([StatutId]) REFERENCES [dbo].[ActionEduStatuts] ([Id])
+);
+
+
+GO
+CREATE NONCLUSTERED INDEX [IX_FK_ActionEdu_ActionEduStatuts]
+    ON [dbo].[ActionsEdu]([StatutId] ASC);
+
+
+GO
+CREATE NONCLUSTERED INDEX [IX_FK_ActionEduAnnee]
+    ON [dbo].[ActionsEdu]([AnneeId] ASC);
+
+
+GO
+CREATE NONCLUSTERED INDEX [IX_FK_ActionEduThematiqueActionEdu]
+    ON [dbo].[ActionsEdu]([ActionEduThematiqueId] ASC);
+

+ 9 - 14
CD67.FicheCollege.BDD/dbo/Tables/ActionsEduColleges.sql → CD67.FicheCollege.BDD/ActionsEduColleges.sql

@@ -1,14 +1,9 @@
 CREATE TABLE [dbo].[ActionsEduColleges] (
-    [Id]                     INT            IDENTITY (1, 1) NOT NULL,
-    [CommentaireInterne]     NVARCHAR (MAX) NULL,
-    [CommentairePublic]      NVARCHAR (MAX) NULL,
-    [NbEleves]               BIGINT         NOT NULL,
-    [TiersAstre_Code]        NVARCHAR (MAX) NULL,
-    [TiersAstre_Nom]         NVARCHAR (MAX) NULL,
-    [TiersAstre_CodeFamille] NVARCHAR (MAX) NULL,
-    [TiersAstre_Description] NVARCHAR (MAX) NULL,
-    [CollegeId]              INT            NOT NULL,
-    [ActionEduId]            INT            NOT NULL,
+    [Id]          INT            IDENTITY (1, 1) NOT NULL,
+    [Commentaire] NVARCHAR (MAX) NULL,
+    [NbEleves]    BIGINT         NULL,
+    [CollegeId]   INT            NOT NULL,
+    [ActionEduId] INT            NOT NULL,
     CONSTRAINT [PK_ActionsEduColleges] PRIMARY KEY CLUSTERED ([Id] ASC),
     CONSTRAINT [FK_ActionEduCollegeActionEdu] FOREIGN KEY ([ActionEduId]) REFERENCES [dbo].[ActionsEdu] ([Id]),
     CONSTRAINT [FK_ActionEduCollegeCollege] FOREIGN KEY ([CollegeId]) REFERENCES [dbo].[Colleges] ([Id])
@@ -16,11 +11,11 @@
 
 
 GO
-CREATE NONCLUSTERED INDEX [IX_FK_ActionEduCollegeCollege]
-    ON [dbo].[ActionsEduColleges]([CollegeId] ASC);
+CREATE NONCLUSTERED INDEX [IX_FK_ActionEduCollegeActionEdu]
+    ON [dbo].[ActionsEduColleges]([ActionEduId] ASC);
 
 
 GO
-CREATE NONCLUSTERED INDEX [IX_FK_ActionEduCollegeActionEdu]
-    ON [dbo].[ActionsEduColleges]([ActionEduId] ASC);
+CREATE NONCLUSTERED INDEX [IX_FK_ActionEduCollegeCollege]
+    ON [dbo].[ActionsEduColleges]([CollegeId] ASC);
 

+ 7 - 0
CD67.FicheCollege.BDD/Annees.sql

@@ -0,0 +1,7 @@
+CREATE TABLE [dbo].[Annees] (
+    [Id]           INT           IDENTITY (1, 1) NOT NULL,
+    [Libelle]      NVARCHAR (12) NOT NULL,
+    [AnneeRentree] INT           NOT NULL,
+    CONSTRAINT [PK_Annees] PRIMARY KEY CLUSTERED ([Id] ASC)
+);
+

+ 19 - 18
CD67.FicheCollege.BDD/CD67.FicheCollege.BDD.sqlproj

@@ -7,14 +7,14 @@
     <Name>CD67.FicheCollege.BDD</Name>
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectVersion>4.1</ProjectVersion>
-    <ProjectGuid>{104fc704-5a60-4f2b-b52b-4a95fbb7a4ab}</ProjectGuid>
-    <DSP>Microsoft.Data.Tools.Schema.Sql.Sql120DatabaseSchemaProvider</DSP>
+    <ProjectGuid>{714893fb-6e06-433f-94d2-2ceaa355d4dc}</ProjectGuid>
+    <DSP>Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider</DSP>
     <OutputType>Database</OutputType>
     <RootPath>
     </RootPath>
     <RootNamespace>CD67.FicheCollege.BDD</RootNamespace>
     <AssemblyName>CD67.FicheCollege.BDD</AssemblyName>
-    <ModelCollation>1033,CI</ModelCollation>
+    <ModelCollation>1033, CI</ModelCollation>
     <DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
     <DeployToDatabase>True</DeployToDatabase>
     <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
@@ -23,9 +23,6 @@
     <SqlServerVerification>False</SqlServerVerification>
     <IncludeCompositeObjects>True</IncludeCompositeObjects>
     <TargetDatabaseSet>True</TargetDatabaseSet>
-    <TargetFrameworkProfile />
-    <DefaultCollation>Latin1_General_CI_AS_KS_WS</DefaultCollation>
-    <DefaultFilegroup>PRIMARY</DefaultFilegroup>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <OutputPath>bin\Release\</OutputPath>
@@ -60,19 +57,23 @@
   <Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
   <ItemGroup>
     <Folder Include="Properties" />
-    <Folder Include="dbo\" />
-    <Folder Include="dbo\Tables\" />
   </ItemGroup>
   <ItemGroup>
-    <Build Include="dbo\Tables\ActionsEdu.sql" />
-    <Build Include="dbo\Tables\TypesCollege.sql" />
-    <Build Include="dbo\Tables\Territoires.sql" />
-    <Build Include="dbo\Tables\Identites.sql" />
-    <Build Include="dbo\Tables\Annees.sql" />
-    <Build Include="dbo\Tables\ActionEduAxes.sql" />
-    <Build Include="dbo\Tables\ActionEduThematiques.sql" />
-    <Build Include="dbo\Tables\ActionsEduColleges.sql" />
-    <Build Include="dbo\Tables\ActionEduMissions.sql" />
-    <Build Include="dbo\Tables\Colleges.sql" />
+    <Build Include="ActionEduActeurRoles.sql" />
+    <Build Include="ActionEduActeurs.sql" />
+    <Build Include="ActionEduAxes.sql" />
+    <Build Include="ActionEduMissions.sql" />
+    <Build Include="ActionEduStatuts.sql" />
+    <Build Include="ActionEduThematiques.sql" />
+    <Build Include="ActionsEdu.sql" />
+    <Build Include="ActionsEduColleges.sql" />
+    <Build Include="Annees.sql" />
+    <Build Include="Colleges.sql" />
+    <Build Include="Territoires.sql" />
+    <Build Include="TypesCollege.sql" />
+    <Build Include="RestaurationTypes.sql" />
+    <Build Include="RestaurationParametres.sql" />
+    <Build Include="RestaurationTypeRepas.sql" />
+    <Build Include="RestaurationParametresRepas.sql" />
   </ItemGroup>
 </Project>

+ 45 - 0
CD67.FicheCollege.BDD/Colleges.sql

@@ -0,0 +1,45 @@
+CREATE TABLE [dbo].[Colleges] (
+    [Id]					INT              IDENTITY (1, 1) NOT NULL,
+    [Annee_Id]				INT              NOT NULL,
+    [CodeRne]				NVARCHAR (10)    NOT NULL,
+    [Libelle]				NVARCHAR (255)   NOT NULL,
+    [Adresse]				NVARCHAR (255)   NULL,
+    [Code_Postal]			NVARCHAR (5)     NULL,
+    [TypeCollege_Id]		INT              NOT NULL,
+    [Commune_Insee]			NVARCHAR (5)     NULL,
+    [Commune]				NVARCHAR (255)   NOT NULL,
+    [Canton]				NVARCHAR (255)   NULL,
+    [Territoire_Id]			NVARCHAR (10)    NULL,
+    [TAD]					NVARCHAR (255)   NULL,
+    [CDC]					NVARCHAR (255)   NULL,
+    [Tel]					NVARCHAR (255)   NULL,
+    [Fax]					NVARCHAR (255)   NULL,
+    [Email]					NVARCHAR (255)   NULL,
+    [PrincipalSid]			NVARCHAR (64)    NULL,
+    [AdjointSid]			NVARCHAR (64)    NULL,
+    [Gestionnaire1Sid]		NVARCHAR (64)    NULL,
+    [Gestionnaire2Sid]		NVARCHAR (64)    NULL,
+    [TokenId]				UNIQUEIDENTIFIER NOT NULL,
+	[RestaurationType_Id]   INT              NULL,
+    CONSTRAINT [PK_Colleges] PRIMARY KEY CLUSTERED ([Id] ASC),
+    CONSTRAINT [FK_AnneeCollege] FOREIGN KEY ([Annee_Id]) REFERENCES [dbo].[Annees] ([Id]),
+    CONSTRAINT [FK_Colleges_Territoires] FOREIGN KEY ([Territoire_Id]) REFERENCES [dbo].[Territoires] ([Id]),
+    CONSTRAINT [FK_Colleges_TypesCollege] FOREIGN KEY ([TypeCollege_Id]) REFERENCES [dbo].[TypesCollege] ([Id]),
+	CONSTRAINT [FK_Colleges_RestaurationTypes] FOREIGN KEY ([RestaurationType_Id]) REFERENCES [dbo].[RestaurationTypes] ([Id])
+);
+
+
+GO
+CREATE NONCLUSTERED INDEX [IX_FK_AnneeCollege]
+    ON [dbo].[Colleges]([Annee_Id] ASC);
+
+
+GO
+CREATE NONCLUSTERED INDEX [IX_FK_Colleges_TypesCollege]
+    ON [dbo].[Colleges]([TypeCollege_Id] ASC);
+
+
+GO
+CREATE NONCLUSTERED INDEX [IX_FK_Colleges_Territoires]
+    ON [dbo].[Colleges]([Territoire_Id] ASC);
+

+ 16 - 0
CD67.FicheCollege.BDD/RestaurationParametres.sql

@@ -0,0 +1,16 @@
+CREATE TABLE [dbo].[RestaurationParametres]
+(
+    [Id]						INT				IDENTITY (1, 1) NOT NULL,
+	[Annee_Id]					INT				NOT NULL,
+	[Campagne]					BIT				NOT NULL,
+	[Prix_Mini]					DECIMAL (18,2)    NULL,
+	[Prix_ATC]					DECIMAL (18,2)    NULL,
+	[Prix_AgentC]				DECIMAL (18,2)    NULL,
+	[Prix_MiniAutres]			DECIMAL (18,2)    NULL,
+	CONSTRAINT [PK_RestaurationParametres] PRIMARY KEY CLUSTERED ([Id] ASC),
+	CONSTRAINT [FK_RestaurationParametresAnnee] FOREIGN KEY ([Annee_Id]) REFERENCES [dbo].[Annees] ([Id])
+)
+
+GO
+CREATE NONCLUSTERED INDEX [IX_FK_AnneeCollege]
+    ON [dbo].[RestaurationParametres]([Annee_Id] ASC);

+ 8 - 0
CD67.FicheCollege.BDD/RestaurationParametresRepas.sql

@@ -0,0 +1,8 @@
+CREATE TABLE [dbo].[RestaurationParametresRepas]
+(
+    [RestaurationParametres_Id]	INT NOT NULL, 
+	[RestaurationTypeRepas_Id]	INT NOT NULL, 
+    PRIMARY KEY ([RestaurationParametres_Id], [RestaurationTypeRepas_Id]), 
+    CONSTRAINT [FK_RestaurationParametresRepas_Param] FOREIGN KEY ([RestaurationParametres_Id]) REFERENCES [RestaurationParametres]([Id]),
+    CONSTRAINT [FK_RestaurationParametresRepas_Repas] FOREIGN KEY ([RestaurationTypeRepas_Id]) REFERENCES [RestaurationTypeRepas]([Id])
+)

+ 7 - 0
CD67.FicheCollege.BDD/RestaurationTypeRepas.sql

@@ -0,0 +1,7 @@
+CREATE TABLE [dbo].[RestaurationTypeRepas]
+(
+	[Id] INT NOT NULL PRIMARY KEY IDENTITY, 
+    [Libelle] NVARCHAR(255) NOT NULL, 
+	[Valid] BIT NOT NULL, 
+    [Ordre] INT NOT NULL
+)

+ 7 - 0
CD67.FicheCollege.BDD/RestaurationTypes.sql

@@ -0,0 +1,7 @@
+CREATE TABLE [dbo].[RestaurationTypes]
+(
+	[Id] INT NOT NULL PRIMARY KEY IDENTITY, 
+    [Libelle] NVARCHAR(255) NOT NULL, 
+    [Valid] BIT NOT NULL, 
+    [Ordre] INT NOT NULL
+)

+ 0 - 0
CD67.FicheCollege.BDD/dbo/Tables/Territoires.sql → CD67.FicheCollege.BDD/Territoires.sql


+ 0 - 0
CD67.FicheCollege.BDD/dbo/Tables/TypesCollege.sql → CD67.FicheCollege.BDD/TypesCollege.sql


+ 0 - 25
CD67.FicheCollege.BDD/dbo/Tables/ActionsEdu.sql

@@ -1,25 +0,0 @@
-CREATE TABLE [dbo].[ActionsEdu] (
-    [Id]                    INT            IDENTITY (1, 1) NOT NULL,
-    [Numero]                NVARCHAR (MAX) NOT NULL,
-    [Nom]                   NVARCHAR (MAX) NOT NULL,
-    [Montant]               DECIMAL (18)   CONSTRAINT [DF_ActionsEdu_Montant] DEFAULT ((0)) NOT NULL,
-    [Description]           NVARCHAR (MAX) NULL,
-    [Neutralise]            BIT            NOT NULL,
-    [Ordre]                 INT            NOT NULL,
-    [ActionEduThematiqueId] INT            NOT NULL,
-    [AnneeId]               INT            NOT NULL,
-    CONSTRAINT [PK_ActionsEdu] PRIMARY KEY CLUSTERED ([Id] ASC),
-    CONSTRAINT [FK_ActionEduAnnee] FOREIGN KEY ([AnneeId]) REFERENCES [dbo].[Annees] ([Id]),
-    CONSTRAINT [FK_ActionEduThematiqueActionEdu] FOREIGN KEY ([ActionEduThematiqueId]) REFERENCES [dbo].[ActionEduThematiques] ([Id])
-);
-
-
-GO
-CREATE NONCLUSTERED INDEX [IX_FK_ActionEduThematiqueActionEdu]
-    ON [dbo].[ActionsEdu]([ActionEduThematiqueId] ASC);
-
-
-GO
-CREATE NONCLUSTERED INDEX [IX_FK_ActionEduAnnee]
-    ON [dbo].[ActionsEdu]([AnneeId] ASC);
-

+ 0 - 6
CD67.FicheCollege.BDD/dbo/Tables/Annees.sql

@@ -1,6 +0,0 @@
-CREATE TABLE [dbo].[Annees] (
-    [Id]      INT           IDENTITY (1, 1) NOT NULL,
-    [Libelle] NVARCHAR (12) NOT NULL,
-    CONSTRAINT [PK_Annees] PRIMARY KEY CLUSTERED ([Id] ASC)
-);
-

+ 0 - 42
CD67.FicheCollege.BDD/dbo/Tables/Colleges.sql

@@ -1,42 +0,0 @@
-CREATE TABLE [dbo].[Colleges] (
-    [Id]               INT            IDENTITY (1, 1) NOT NULL,
-    [Annee_Id]         INT            NOT NULL,
-    [CodeRne]          NVARCHAR (10)  NOT NULL,
-    [Libelle]          NVARCHAR (255) NOT NULL,
-    [Adresse]          NVARCHAR (255) NULL,
-    [Code_Postal]      NVARCHAR (5)   NULL,
-    [TypeCollege_Id]   INT            NOT NULL,
-    [Commune_Insee]    NVARCHAR (5)   NULL,
-    [Commune]          NVARCHAR (255) NOT NULL,
-    [Canton]           NVARCHAR (255) NULL,
-    [Territoire_Id]    NVARCHAR (10)  NULL,
-    [TAD]              NVARCHAR (255) NULL,
-    [CDC]              NVARCHAR (255) NULL,
-    [Tel]              NVARCHAR (255) NULL,
-    [Fax]              NVARCHAR (255) NULL,
-    [Email]            NVARCHAR (255) NULL,
-    [PrincipalSid]     NVARCHAR (64)  NULL,
-    [AdjointSid]       NVARCHAR (64)  NULL,
-    [Gestionnaire1Sid] NVARCHAR (64)  NULL,
-    [Gestionnaire2Sid] NVARCHAR (64)  NULL,
-    CONSTRAINT [PK_Colleges] PRIMARY KEY CLUSTERED ([Id] ASC),
-    CONSTRAINT [FK_AnneeCollege] FOREIGN KEY ([Annee_Id]) REFERENCES [dbo].[Annees] ([Id]),
-    CONSTRAINT [FK_Colleges_Territoires] FOREIGN KEY ([Territoire_Id]) REFERENCES [dbo].[Territoires] ([Id]),
-    CONSTRAINT [FK_Colleges_TypesCollege] FOREIGN KEY ([TypeCollege_Id]) REFERENCES [dbo].[TypesCollege] ([Id])
-);
-
-
-GO
-CREATE NONCLUSTERED INDEX [IX_FK_Colleges_Territoires]
-    ON [dbo].[Colleges]([Territoire_Id] ASC);
-
-
-GO
-CREATE NONCLUSTERED INDEX [IX_FK_Colleges_TypesCollege]
-    ON [dbo].[Colleges]([TypeCollege_Id] ASC);
-
-
-GO
-CREATE NONCLUSTERED INDEX [IX_FK_AnneeCollege]
-    ON [dbo].[Colleges]([Annee_Id] ASC);
-

+ 0 - 34
CD67.FicheCollege.BDD/dbo/Tables/Identites.sql

@@ -1,34 +0,0 @@
-CREATE TABLE [dbo].[Identites] (
-    [College_Id]              INT            NOT NULL,
-    [Principal_SID]           NVARCHAR (64)  NULL,
-    [Principal_Login]         NVARCHAR (255) NULL,
-    [Principal_Nom]           NVARCHAR (255) NULL,
-    [Principal_Prenom]        NVARCHAR (255) NULL,
-    [Principal_Email]         NVARCHAR (255) NULL,
-    [Principal_Tel]           NVARCHAR (255) NULL,
-    [Principal_Structure]     NVARCHAR (255) NULL,
-    [Adjoint_SID]             NVARCHAR (64)  NULL,
-    [Adjoint_Login]           NVARCHAR (255) NULL,
-    [Adjoint_Nom]             NVARCHAR (255) NULL,
-    [Adjoint_Prenom]          NVARCHAR (255) NULL,
-    [Adjoint_Email]           NVARCHAR (255) NULL,
-    [Adjoint_Tel]             NVARCHAR (255) NULL,
-    [Adjoint_Structure]       NVARCHAR (255) NULL,
-    [Gestionnaire_SID]        NVARCHAR (64)  NULL,
-    [Gestionnaire_Login]      NVARCHAR (255) NULL,
-    [Gestionnaire_Nom]        NVARCHAR (255) NULL,
-    [Gestionnaire_Prenom]     NVARCHAR (255) NULL,
-    [Gestionnaire_Email]      NVARCHAR (255) NULL,
-    [Gestionnaire_Tel]        NVARCHAR (255) NULL,
-    [Gestionnaire_Structure]  NVARCHAR (255) NULL,
-    [Gestionnaire2_SID]       NVARCHAR (64)  NULL,
-    [Gestionnaire2_Login]     NVARCHAR (255) NULL,
-    [Gestionnaire2_Nom]       NVARCHAR (255) NULL,
-    [Gestionnaire2_Prenom]    NVARCHAR (255) NULL,
-    [Gestionnaire2_Email]     NVARCHAR (255) NULL,
-    [Gestionnaire2_Tel]       NVARCHAR (255) NULL,
-    [Gestionnaire2_Structure] NVARCHAR (255) NULL,
-    CONSTRAINT [PK_Identites] PRIMARY KEY CLUSTERED ([College_Id] ASC),
-    CONSTRAINT [FK_FicheIdentite_College] FOREIGN KEY ([College_Id]) REFERENCES [dbo].[Colleges] ([Id])
-);
-

+ 3 - 0
CD67.FicheCollege.Entity/Annee.cs

@@ -19,6 +19,7 @@ namespace CD67.FicheCollege.Entity
         {
             this.Colleges = new HashSet<College>();
             this.ActionsEdu = new HashSet<ActionEdu>();
+            this.RestaurationParametres = new HashSet<RestaurationParametre>();
         }
     
         public int Id { get; set; }
@@ -29,5 +30,7 @@ namespace CD67.FicheCollege.Entity
         public virtual ICollection<College> Colleges { get; set; }
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
         public virtual ICollection<ActionEdu> ActionsEdu { get; set; }
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<RestaurationParametre> RestaurationParametres { get; set; }
     }
 }

+ 12 - 2
CD67.FicheCollege.Entity/CD67.FicheCollege.Entity.csproj

@@ -163,11 +163,14 @@
     <Compile Include="Extend\Annee.cs" />
     <Compile Include="Extend\College.cs" />
     <Compile Include="Extend\ActionEduStatut.cs" />
+    <Compile Include="Extend\RestaurationParametre.cs" />
+    <Compile Include="Extend\RestaurationTypeRepa.cs" />
     <Compile Include="Extend\Territoire.cs" />
     <Compile Include="Extend\ActionEduAxe.cs" />
     <Compile Include="Extend\ActionEduThematique.cs" />
     <Compile Include="Extend\ActionEdu.cs" />
     <Compile Include="Extend\ActionEduActeur.cs" />
+    <Compile Include="Extend\RestaurationType.cs" />
     <Compile Include="Extend\TypeCollege.cs" />
     <Compile Include="filiere.cs">
       <DependentUpon>EducfModel.tt</DependentUpon>
@@ -189,6 +192,15 @@
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
       <DependentUpon>Settings.settings</DependentUpon>
     </Compile>
+    <Compile Include="RestaurationParametre.cs">
+      <DependentUpon>EntityModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="RestaurationType.cs">
+      <DependentUpon>EntityModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="RestaurationTypeRepa.cs">
+      <DependentUpon>EntityModel.tt</DependentUpon>
+    </Compile>
     <Compile Include="rue.cs">
       <DependentUpon>EducfModel.tt</DependentUpon>
     </Compile>
@@ -283,13 +295,11 @@
       <DependentUpon>EntityModel.edmx</DependentUpon>
       <LastGenOutput>EntityModel.Context.cs</LastGenOutput>
     </Content>
-    <Content Include="EntityModel.edmx.sql" />
     <Content Include="EntityModel.tt">
       <Generator>TextTemplatingFileGenerator</Generator>
       <DependentUpon>EntityModel.edmx</DependentUpon>
       <LastGenOutput>EntityModel.cs</LastGenOutput>
     </Content>
-    <Content Include="Model_initial_inserts.sql" />
     <None Include="Web References\WsExternes\WsExternes.disco" />
     <None Include="Web References\WsTiers\WsTiers.disco" />
     <None Include="Web References\WsAgents\WsAgents.disco" />

+ 2 - 0
CD67.FicheCollege.Entity/College.cs

@@ -41,11 +41,13 @@ namespace CD67.FicheCollege.Entity
         public string Gestionnaire1Sid { get; set; }
         public string Gestionnaire2Sid { get; set; }
         public System.Guid TokenId { get; set; }
+        public Nullable<int> RestaurationType_Id { get; set; }
     
         public virtual Territoire Territoire { get; set; }
         public virtual TypeCollege TypeCollege { get; set; }
         public virtual Annee Annee { get; set; }
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
         public virtual ICollection<ActionEduCollege> ActionsEduColleges { get; set; }
+        public virtual RestaurationType RestaurationType { get; set; }
     }
 }

+ 3 - 0
CD67.FicheCollege.Entity/EntityModel.Context.cs

@@ -37,5 +37,8 @@ namespace CD67.FicheCollege.Entity
         public virtual DbSet<ActionEduActeur> ActionEduActeurs { get; set; }
         public virtual DbSet<ActionEduStatut> ActionEduStatuts { get; set; }
         public virtual DbSet<ActionEduActeurRole> ActionEduActeurRoles { get; set; }
+        public virtual DbSet<RestaurationType> RestaurationTypes { get; set; }
+        public virtual DbSet<RestaurationTypeRepa> RestaurationTypeRepas { get; set; }
+        public virtual DbSet<RestaurationParametre> RestaurationParametres { get; set; }
     }
 }

+ 1 - 1
CD67.FicheCollege.Entity/EntityModel.Designer.cs

@@ -1,4 +1,4 @@
-// La génération de code T4 est activée pour le modèle 'C:\dev\dotnet\FicheCollege\CD67.FicheCollege.Entity\EntityModel.edmx'. 
+// La génération de code T4 est activée pour le modèle 'C:\Users\marjorie.sourdot\Documents\Mes projets en développement\FicheCollege\CD67.FicheCollege.Entity\EntityModel.edmx'. 
 // Pour activer la génération de code héritée, définissez la valeur de la propriété
 // du concepteur 'Stratégie de génération de code' sur 'ObjectContext hérité'. Cette propriété est disponible dans la fenêtre Propriétés lorsque le modèle
 //  est ouvert dans le concepteur.

+ 230 - 1
CD67.FicheCollege.Entity/EntityModel.edmx

@@ -121,6 +121,45 @@
           <Property Name="Gestionnaire1Sid" Type="nvarchar" MaxLength="64" />
           <Property Name="Gestionnaire2Sid" Type="nvarchar" MaxLength="64" />
           <Property Name="TokenId" Type="uniqueidentifier" Nullable="false" />
+          <Property Name="RestaurationType_Id" Type="int" />
+        </EntityType>
+        <EntityType Name="RestaurationParametres">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="Annee_Id" Type="int" Nullable="false" />
+          <Property Name="Campagne" Type="bit" Nullable="false" />
+          <Property Name="Prix_Mini" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="Prix_ATC" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="Prix_AgentC" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="Prix_MiniAutres" Type="decimal" Precision="18" Scale="2" />
+        </EntityType>
+        <EntityType Name="RestaurationParametresRepas">
+          <Key>
+            <PropertyRef Name="RestaurationParametres_Id" />
+            <PropertyRef Name="RestaurationTypeRepas_Id" />
+          </Key>
+          <Property Name="RestaurationParametres_Id" Type="int" Nullable="false" />
+          <Property Name="RestaurationTypeRepas_Id" Type="int" Nullable="false" />
+        </EntityType>
+        <EntityType Name="RestaurationTypeRepas">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="Libelle" Type="nvarchar" MaxLength="255" Nullable="false" />
+          <Property Name="Valid" Type="bit" Nullable="false" />
+          <Property Name="Ordre" Type="int" Nullable="false" />
+        </EntityType>
+        <EntityType Name="RestaurationTypes">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="Libelle" Type="nvarchar" MaxLength="255" Nullable="false" />
+          <Property Name="Valid" Type="bit" Nullable="false" />
+          <Property Name="Ordre" Type="int" Nullable="false" />
         </EntityType>
         <EntityType Name="Territoires">
           <Key>
@@ -264,6 +303,18 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <Association Name="FK_Colleges_RestaurationTypes">
+          <End Role="RestaurationTypes" Type="Self.RestaurationTypes" Multiplicity="0..1" />
+          <End Role="Colleges" Type="Self.Colleges" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="RestaurationTypes">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="Colleges">
+              <PropertyRef Name="RestaurationType_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <Association Name="FK_Colleges_Territoires">
           <End Role="Territoires" Type="Self.Territoires" Multiplicity="0..1" />
           <End Role="Colleges" Type="Self.Colleges" Multiplicity="*" />
@@ -288,6 +339,42 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <Association Name="FK_RestaurationParametresAnnee">
+          <End Role="Annees" Type="Self.Annees" Multiplicity="1" />
+          <End Role="RestaurationParametres" Type="Self.RestaurationParametres" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Annees">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="RestaurationParametres">
+              <PropertyRef Name="Annee_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_RestaurationParametresRepas_Param">
+          <End Role="RestaurationParametres" Type="Self.RestaurationParametres" Multiplicity="1" />
+          <End Role="RestaurationParametresRepas" Type="Self.RestaurationParametresRepas" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="RestaurationParametres">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="RestaurationParametresRepas">
+              <PropertyRef Name="RestaurationParametres_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_RestaurationParametresRepas_Repas">
+          <End Role="RestaurationTypeRepas" Type="Self.RestaurationTypeRepas" Multiplicity="1" />
+          <End Role="RestaurationParametresRepas" Type="Self.RestaurationParametresRepas" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="RestaurationTypeRepas">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="RestaurationParametresRepas">
+              <PropertyRef Name="RestaurationTypeRepas_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <EntityContainer Name="CD67FicheCollegeStoreContainer">
           <EntitySet Name="ActionEduActeurRoles" EntityType="Self.ActionEduActeurRoles" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="ActionEduActeurs" EntityType="Self.ActionEduActeurs" Schema="dbo" store:Type="Tables" />
@@ -299,6 +386,10 @@
           <EntitySet Name="ActionsEduColleges" EntityType="Self.ActionsEduColleges" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Annees" EntityType="Self.Annees" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Colleges" EntityType="Self.Colleges" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="RestaurationParametres" EntityType="Self.RestaurationParametres" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="RestaurationParametresRepas" EntityType="Self.RestaurationParametresRepas" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="RestaurationTypeRepas" EntityType="Self.RestaurationTypeRepas" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="RestaurationTypes" EntityType="Self.RestaurationTypes" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="Territoires" EntityType="Self.Territoires" Schema="dbo" store:Type="Tables" />
           <EntitySet Name="TypesCollege" EntityType="Self.TypesCollege" Schema="dbo" store:Type="Tables" />
           <AssociationSet Name="FK_ActionEduActeurs_ActionEduActeurRoles" Association="Self.FK_ActionEduActeurs_ActionEduActeurRoles">
@@ -341,6 +432,10 @@
             <End Role="Annees" EntitySet="Annees" />
             <End Role="Colleges" EntitySet="Colleges" />
           </AssociationSet>
+          <AssociationSet Name="FK_Colleges_RestaurationTypes" Association="Self.FK_Colleges_RestaurationTypes">
+            <End Role="RestaurationTypes" EntitySet="RestaurationTypes" />
+            <End Role="Colleges" EntitySet="Colleges" />
+          </AssociationSet>
           <AssociationSet Name="FK_Colleges_Territoires" Association="Self.FK_Colleges_Territoires">
             <End Role="Territoires" EntitySet="Territoires" />
             <End Role="Colleges" EntitySet="Colleges" />
@@ -349,6 +444,18 @@
             <End Role="TypesCollege" EntitySet="TypesCollege" />
             <End Role="Colleges" EntitySet="Colleges" />
           </AssociationSet>
+          <AssociationSet Name="FK_RestaurationParametresAnnee" Association="Self.FK_RestaurationParametresAnnee">
+            <End Role="Annees" EntitySet="Annees" />
+            <End Role="RestaurationParametres" EntitySet="RestaurationParametres" />
+          </AssociationSet>
+          <AssociationSet Name="FK_RestaurationParametresRepas_Param" Association="Self.FK_RestaurationParametresRepas_Param">
+            <End Role="RestaurationParametres" EntitySet="RestaurationParametres" />
+            <End Role="RestaurationParametresRepas" EntitySet="RestaurationParametresRepas" />
+          </AssociationSet>
+          <AssociationSet Name="FK_RestaurationParametresRepas_Repas" Association="Self.FK_RestaurationParametresRepas_Repas">
+            <End Role="RestaurationTypeRepas" EntitySet="RestaurationTypeRepas" />
+            <End Role="RestaurationParametresRepas" EntitySet="RestaurationParametresRepas" />
+          </AssociationSet>
         </EntityContainer>
       </Schema></edmx:StorageModels>
     <!-- CSDL content -->
@@ -415,6 +522,21 @@
             <End Role="ActionEduActeurRole" EntitySet="ActionEduActeurRoles" />
             <End Role="ActionEduActeur" EntitySet="ActionEduActeurs" />
           </AssociationSet>
+          <EntitySet Name="RestaurationTypes" EntityType="CD67.FicheCollege.RestaurationType" />
+          <AssociationSet Name="FK_Colleges_RestaurationTypes" Association="CD67.FicheCollege.FK_Colleges_RestaurationTypes">
+            <End Role="RestaurationType" EntitySet="RestaurationTypes" />
+            <End Role="College" EntitySet="Colleges" />
+          </AssociationSet>
+          <EntitySet Name="RestaurationTypeRepas" EntityType="CD67.FicheCollege.RestaurationTypeRepa" />
+          <EntitySet Name="RestaurationParametres" EntityType="CD67.FicheCollege.RestaurationParametre" />
+          <AssociationSet Name="FK_RestaurationParametresAnnee" Association="CD67.FicheCollege.FK_RestaurationParametresAnnee">
+            <End Role="Annee" EntitySet="Annees" />
+            <End Role="RestaurationParametre" EntitySet="RestaurationParametres" />
+          </AssociationSet>
+          <AssociationSet Name="RestaurationParametresRepas" Association="CD67.FicheCollege.RestaurationParametresRepas">
+            <End Role="RestaurationParametre" EntitySet="RestaurationParametres" />
+            <End Role="RestaurationTypeRepa" EntitySet="RestaurationTypeRepas" />
+          </AssociationSet>
           </EntityContainer>
         <EntityType Name="TypeCollege">
           <Key>
@@ -469,6 +591,8 @@
           <Property Name="Gestionnaire1Sid" Type="String" MaxLength="64" FixedLength="false" Unicode="true" />
           <Property Name="Gestionnaire2Sid" Type="String" MaxLength="64" FixedLength="false" Unicode="true" />
           <Property Name="TokenId" Type="Guid" Nullable="false" />
+          <Property Name="RestaurationType_Id" Type="Int32" />
+          <NavigationProperty Name="RestaurationType" Relationship="CD67.FicheCollege.FK_Colleges_RestaurationTypes" FromRole="College" ToRole="RestaurationType" />
         </EntityType>
         <Association Name="FK_Colleges_Territoires">
           <End Type="CD67.FicheCollege.Territoire" Role="Territoire" Multiplicity="0..1" />
@@ -503,6 +627,7 @@
           <Property Name="Libelle" Type="String" Nullable="false" MaxLength="12" FixedLength="false" Unicode="true" />
           <NavigationProperty Name="ActionsEdu" Relationship="CD67.FicheCollege.ActionEduAnnee" FromRole="Annee" ToRole="ActionEdu" />
           <Property Name="AnneeRentree" Type="Int32" Nullable="false" />
+          <NavigationProperty Name="RestaurationParametres" Relationship="CD67.FicheCollege.FK_RestaurationParametresAnnee" FromRole="Annee" ToRole="RestaurationParametre" />
         </EntityType>
         <Association Name="AnneeCollege">
           <End Type="CD67.FicheCollege.Annee" Role="Annee" Multiplicity="1" />
@@ -723,6 +848,68 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <EntityType Name="RestaurationType">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="Libelle" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="true" />
+          <Property Name="Valid" Type="Boolean" Nullable="false" />
+          <Property Name="Ordre" Type="Int32" Nullable="false" />
+          <NavigationProperty Name="Colleges" Relationship="CD67.FicheCollege.FK_Colleges_RestaurationTypes" FromRole="RestaurationType" ToRole="College" />
+        </EntityType>
+        <Association Name="FK_Colleges_RestaurationTypes">
+          <End Type="CD67.FicheCollege.RestaurationType" Role="RestaurationType" Multiplicity="0..1" />
+          <End Type="CD67.FicheCollege.College" Role="College" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="RestaurationType">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="College">
+              <PropertyRef Name="RestaurationType_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <EntityType Name="RestaurationTypeRepa">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="Libelle" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="true" />
+          <Property Name="Valid" Type="Boolean" Nullable="false" />
+          <Property Name="Ordre" Type="Int32" Nullable="false" />
+          <NavigationProperty Name="RestaurationParametres" Relationship="CD67.FicheCollege.RestaurationParametresRepas" FromRole="RestaurationTypeRepa" ToRole="RestaurationParametre" />
+        </EntityType>
+        <EntityType Name="RestaurationParametre">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="Annee_Id" Type="Int32" Nullable="false" />
+          <Property Name="Campagne" Type="Boolean" Nullable="false" />
+          <Property Name="Prix_Mini" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="Prix_ATC" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="Prix_AgentC" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="Prix_MiniAutres" Type="Decimal" Precision="18" Scale="2" />
+          <NavigationProperty Name="Annee" Relationship="CD67.FicheCollege.FK_RestaurationParametresAnnee" FromRole="RestaurationParametre" ToRole="Annee" />
+          <NavigationProperty Name="RestaurationTypeRepas" Relationship="CD67.FicheCollege.RestaurationParametresRepas" FromRole="RestaurationParametre" ToRole="RestaurationTypeRepa" />
+        </EntityType>
+        <Association Name="FK_RestaurationParametresAnnee">
+          <End Type="CD67.FicheCollege.Annee" Role="Annee" Multiplicity="1" />
+          <End Type="CD67.FicheCollege.RestaurationParametre" Role="RestaurationParametre" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Annee">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="RestaurationParametre">
+              <PropertyRef Name="Annee_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="RestaurationParametresRepas">
+          <End Type="CD67.FicheCollege.RestaurationParametre" Role="RestaurationParametre" Multiplicity="*" />
+          <End Type="CD67.FicheCollege.RestaurationTypeRepa" Role="RestaurationTypeRepa" Multiplicity="*" />
+        </Association>
         </Schema>
     </edmx:ConceptualModels>
     <!-- C-S mapping content -->
@@ -756,7 +943,8 @@
     <EntitySetMapping Name="Colleges">
       <EntityTypeMapping TypeName="IsTypeOf(CD67.FicheCollege.College)">
         <MappingFragment StoreEntitySet="Colleges">
-          <ScalarProperty Name="TokenId" ColumnName="TokenId" />
+          <ScalarProperty Name="RestaurationType_Id" ColumnName="RestaurationType_Id" />
+                <ScalarProperty Name="TokenId" ColumnName="TokenId" />
                 <ScalarProperty Name="Gestionnaire2Sid" ColumnName="Gestionnaire2Sid" />
                 <ScalarProperty Name="Gestionnaire1Sid" ColumnName="Gestionnaire1Sid" />
                 <ScalarProperty Name="AdjointSid" ColumnName="AdjointSid" />
@@ -880,6 +1068,47 @@
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
+          <EntitySetMapping Name="RestaurationTypes">
+            <EntityTypeMapping TypeName="CD67.FicheCollege.RestaurationType">
+              <MappingFragment StoreEntitySet="RestaurationTypes">
+                <ScalarProperty Name="Ordre" ColumnName="Ordre" />
+                <ScalarProperty Name="Valid" ColumnName="Valid" />
+                <ScalarProperty Name="Libelle" ColumnName="Libelle" />
+                <ScalarProperty Name="Id" ColumnName="Id" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <EntitySetMapping Name="RestaurationTypeRepas">
+            <EntityTypeMapping TypeName="CD67.FicheCollege.RestaurationTypeRepa">
+              <MappingFragment StoreEntitySet="RestaurationTypeRepas">
+                <ScalarProperty Name="Ordre" ColumnName="Ordre" />
+                <ScalarProperty Name="Valid" ColumnName="Valid" />
+                <ScalarProperty Name="Libelle" ColumnName="Libelle" />
+                <ScalarProperty Name="Id" ColumnName="Id" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <EntitySetMapping Name="RestaurationParametres">
+            <EntityTypeMapping TypeName="CD67.FicheCollege.RestaurationParametre">
+              <MappingFragment StoreEntitySet="RestaurationParametres">
+                <ScalarProperty Name="Prix_MiniAutres" ColumnName="Prix_MiniAutres" />
+                <ScalarProperty Name="Prix_AgentC" ColumnName="Prix_AgentC" />
+                <ScalarProperty Name="Prix_ATC" ColumnName="Prix_ATC" />
+                <ScalarProperty Name="Prix_Mini" ColumnName="Prix_Mini" />
+                <ScalarProperty Name="Campagne" ColumnName="Campagne" />
+                <ScalarProperty Name="Annee_Id" ColumnName="Annee_Id" />
+                <ScalarProperty Name="Id" ColumnName="Id" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <AssociationSetMapping Name="RestaurationParametresRepas" TypeName="CD67.FicheCollege.RestaurationParametresRepas" StoreEntitySet="RestaurationParametresRepas">
+            <EndProperty Name="RestaurationTypeRepa">
+              <ScalarProperty Name="Id" ColumnName="RestaurationTypeRepas_Id" />
+            </EndProperty>
+            <EndProperty Name="RestaurationParametre">
+              <ScalarProperty Name="Id" ColumnName="RestaurationParametres_Id" />
+            </EndProperty>
+          </AssociationSetMapping>
           </EntityContainerMapping>
 </Mapping></edmx:Mappings>
   </edmx:Runtime>

+ 14 - 8
CD67.FicheCollege.Entity/EntityModel.edmx.diagram

@@ -10,25 +10,31 @@
         <EntityTypeShape EntityType="CD67.FicheCollege.College" Width="1.75" PointX="3" PointY="2.625" />
         <AssociationConnector Association="CD67.FicheCollege.FK_Colleges_Territoires" />
         <AssociationConnector Association="CD67.FicheCollege.FK_Colleges_TypesCollege" />
-        <EntityTypeShape EntityType="CD67.FicheCollege.Annee" Width="1.5" PointX="3.125" PointY="0.5" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.Annee" Width="1.5" PointX="5.5" PointY="0.5" />
         <AssociationConnector Association="CD67.FicheCollege.AnneeCollege" />
-        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduAxe" Width="1.5" PointX="13.125" PointY="2.25" />
-        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduThematique" Width="1.875" PointX="10.875" PointY="2.25" />
-        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEdu" Width="2.125" PointX="8" PointY="3.125" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduAxe" Width="1.5" PointX="12.5" PointY="9.375" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduThematique" Width="1.875" PointX="9.5" PointY="9.125" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEdu" Width="2.125" PointX="8" PointY="3.625" />
         <AssociationConnector Association="CD67.FicheCollege.ActionEduAxeActionEduThematique" />
         <AssociationConnector Association="CD67.FicheCollege.ActionEduThematiqueActionEdu" />
         <AssociationConnector Association="CD67.FicheCollege.ActionEduAnnee" />
-        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduCollege" Width="2.125" PointX="5.25" PointY="3" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduCollege" Width="2.125" PointX="5.25" PointY="3.375" />
         <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduMission" Width="2.25" PointX="5.25" PointY="6.625" />
         <AssociationConnector Association="CD67.FicheCollege.ActionEduCollegeActionEduMission" />
         <AssociationConnector Association="CD67.FicheCollege.ActionEduCollegeCollege" />
         <AssociationConnector Association="CD67.FicheCollege.ActionEduCollegeActionEdu" />
-        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduActeur" Width="3.125" PointX="11.25" PointY="6.75" />
-        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduStatut" Width="2.5" PointX="11.25" PointY="4.875" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduActeur" Width="3.125" PointX="11" PointY="5.75" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduStatut" Width="2.5" PointX="11.25" PointY="3.75" />
         <AssociationConnector Association="CD67.FicheCollege.FK_ActionEduActionEduActeur" />
         <AssociationConnector Association="CD67.FicheCollege.FK_ActionsEdu_ActionEduStatuts" />
-        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduActeurRole" Width="2.625" PointX="14.875" PointY="6.75" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.ActionEduActeurRole" Width="2.625" PointX="14.875" PointY="8.25" />
         <AssociationConnector Association="CD67.FicheCollege.FK_ActionEduActeurs_ActionEduActeurRoles" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.RestaurationType" Width="1.5" PointX="0.625" PointY="9" />
+        <AssociationConnector Association="CD67.FicheCollege.FK_Colleges_RestaurationTypes" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.RestaurationTypeRepa" Width="2.625" PointX="12" PointY="1.625" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.RestaurationParametre" Width="1.5" PointX="9.375" PointY="0.5" />
+        <AssociationConnector Association="CD67.FicheCollege.FK_RestaurationParametresAnnee" />
+        <AssociationConnector Association="CD67.FicheCollege.RestaurationParametresRepas" />
         </Diagram>
     </edmx:Diagrams>
   </edmx:Designer>

+ 0 - 446
CD67.FicheCollege.Entity/EntityModel.edmx.sql

@@ -1,446 +0,0 @@
-
--- --------------------------------------------------
--- Entity Designer DDL Script for SQL Server 2005, 2008, 2012 and Azure
--- --------------------------------------------------
--- Date Created: 03/01/2018 17:07:11
--- Generated from EDMX file: C:\dev\dotnet\FicheCollege\CD67.FicheCollege.Entity\EntityModel.edmx
--- --------------------------------------------------
-
-SET QUOTED_IDENTIFIER OFF;
-GO
-USE [FicheCollege];
-GO
-IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
-GO
-
--- --------------------------------------------------
--- Dropping existing FOREIGN KEY constraints
--- --------------------------------------------------
-
-IF OBJECT_ID(N'[dbo].[FK_Colleges_Territoires]', 'F') IS NOT NULL
-    ALTER TABLE [dbo].[Colleges] DROP CONSTRAINT [FK_Colleges_Territoires];
-GO
-IF OBJECT_ID(N'[dbo].[FK_Colleges_TypesCollege]', 'F') IS NOT NULL
-    ALTER TABLE [dbo].[Colleges] DROP CONSTRAINT [FK_Colleges_TypesCollege];
-GO
-IF OBJECT_ID(N'[dbo].[FK_FicheIdentite_College]', 'F') IS NOT NULL
-    ALTER TABLE [dbo].[Identites] DROP CONSTRAINT [FK_FicheIdentite_College];
-GO
-IF OBJECT_ID(N'[dbo].[FK_AnneeCollege]', 'F') IS NOT NULL
-    ALTER TABLE [dbo].[Colleges] DROP CONSTRAINT [FK_AnneeCollege];
-GO
-IF OBJECT_ID(N'[dbo].[FK_ActionEduAxeActionEduThematique]', 'F') IS NOT NULL
-    ALTER TABLE [dbo].[ActionEduThematiques] DROP CONSTRAINT [FK_ActionEduAxeActionEduThematique];
-GO
-IF OBJECT_ID(N'[dbo].[FK_ActionEduThematiqueActionEdu]', 'F') IS NOT NULL
-    ALTER TABLE [dbo].[ActionsEdu] DROP CONSTRAINT [FK_ActionEduThematiqueActionEdu];
-GO
-IF OBJECT_ID(N'[dbo].[FK_ActionEduAnnee]', 'F') IS NOT NULL
-    ALTER TABLE [dbo].[ActionsEdu] DROP CONSTRAINT [FK_ActionEduAnnee];
-GO
-IF OBJECT_ID(N'[dbo].[FK_ActionEduCollegeActionEduMission]', 'F') IS NOT NULL
-    ALTER TABLE [dbo].[ActionEduMissions] DROP CONSTRAINT [FK_ActionEduCollegeActionEduMission];
-GO
-IF OBJECT_ID(N'[dbo].[FK_ActionEduCollegeCollege]', 'F') IS NOT NULL
-    ALTER TABLE [dbo].[ActionsEduColleges] DROP CONSTRAINT [FK_ActionEduCollegeCollege];
-GO
-IF OBJECT_ID(N'[dbo].[FK_ActionEduCollegeActionEdu]', 'F') IS NOT NULL
-    ALTER TABLE [dbo].[ActionsEduColleges] DROP CONSTRAINT [FK_ActionEduCollegeActionEdu];
-GO
-
--- --------------------------------------------------
--- Dropping existing tables
--- --------------------------------------------------
-
-IF OBJECT_ID(N'[dbo].[TypesCollege]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[TypesCollege];
-GO
-IF OBJECT_ID(N'[dbo].[Territoires]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[Territoires];
-GO
-IF OBJECT_ID(N'[dbo].[Colleges]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[Colleges];
-GO
-IF OBJECT_ID(N'[dbo].[Identites]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[Identites];
-GO
-IF OBJECT_ID(N'[dbo].[Annees]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[Annees];
-GO
-IF OBJECT_ID(N'[dbo].[ActionEduAxes]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[ActionEduAxes];
-GO
-IF OBJECT_ID(N'[dbo].[ActionEduThematiques]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[ActionEduThematiques];
-GO
-IF OBJECT_ID(N'[dbo].[ActionsEdu]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[ActionsEdu];
-GO
-IF OBJECT_ID(N'[dbo].[ActionsEduColleges]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[ActionsEduColleges];
-GO
-IF OBJECT_ID(N'[dbo].[ActionEduMissions]', 'U') IS NOT NULL
-    DROP TABLE [dbo].[ActionEduMissions];
-GO
-
--- --------------------------------------------------
--- Creating all tables
--- --------------------------------------------------
-
--- Creating table 'TypesCollege'
-CREATE TABLE [dbo].[TypesCollege] (
-    [Id] int IDENTITY(1,1) NOT NULL,
-    [Libelle] nvarchar(255)  NOT NULL,
-    [Ordre] int  NOT NULL
-);
-GO
-
--- Creating table 'Territoires'
-CREATE TABLE [dbo].[Territoires] (
-    [Id] nvarchar(10)  NOT NULL,
-    [Libelle] nvarchar(255)  NOT NULL,
-    [Referent_SID] nvarchar(64)  NULL,
-    [Referent_Nom] nvarchar(255)  NULL,
-    [Referent_Prenom] nvarchar(255)  NULL,
-    [Referent_Structure] nvarchar(255)  NULL,
-    [Referent_Login] nvarchar(255)  NULL,
-    [Referent_Email] nvarchar(255)  NULL,
-    [Ordre] int  NOT NULL
-);
-GO
-
--- Creating table 'Colleges'
-CREATE TABLE [dbo].[Colleges] (
-    [Id] int  NOT NULL,
-    [Annee_Id] int  NOT NULL,
-    [CodeRne] nvarchar(10)  NOT NULL,
-    [Libelle] nvarchar(255)  NOT NULL,
-    [Adresse] nvarchar(255)  NULL,
-    [Code_Postal] nvarchar(5)  NULL,
-    [TypeCollege_Id] int  NOT NULL,
-    [Commune_Insee] nvarchar(5)  NULL,
-    [Commune] nvarchar(255)  NOT NULL,
-    [Canton] nvarchar(255)  NULL,
-    [Territoire_Id] nvarchar(10)  NULL,
-    [TAD] nvarchar(255)  NULL,
-    [CDC] nvarchar(255)  NULL,
-    [Tel] nvarchar(255)  NULL,
-    [Fax] nvarchar(255)  NULL,
-    [Email] nvarchar(255)  NULL
-);
-GO
-
--- Creating table 'Identites'
-CREATE TABLE [dbo].[Identites] (
-    [College_Id] int  NOT NULL,
-    [Principal_SID] nvarchar(64)  NULL,
-    [Principal_Login] nvarchar(255)  NULL,
-    [Principal_Nom] nvarchar(255)  NULL,
-    [Principal_Prenom] nvarchar(255)  NULL,
-    [Principal_Email] nvarchar(255)  NULL,
-    [Principal_Tel] nvarchar(255)  NULL,
-    [Principal_Structure] nvarchar(255)  NULL,
-    [Adjoint_SID] nvarchar(64)  NULL,
-    [Adjoint_Login] nvarchar(255)  NULL,
-    [Adjoint_Nom] nvarchar(255)  NULL,
-    [Adjoint_Prenom] nvarchar(255)  NULL,
-    [Adjoint_Email] nvarchar(255)  NULL,
-    [Adjoint_Tel] nvarchar(255)  NULL,
-    [Adjoint_Structure] nvarchar(255)  NULL,
-    [Gestionnaire_SID] nvarchar(64)  NULL,
-    [Gestionnaire_Login] nvarchar(255)  NULL,
-    [Gestionnaire_Nom] nvarchar(255)  NULL,
-    [Gestionnaire_Prenom] nvarchar(255)  NULL,
-    [Gestionnaire_Email] nvarchar(255)  NULL,
-    [Gestionnaire_Tel] nvarchar(255)  NULL,
-    [Gestionnaire_Structure] nvarchar(255)  NULL,
-    [Gestionnaire2_SID] nvarchar(64)  NULL,
-    [Gestionnaire2_Login] nvarchar(255)  NULL,
-    [Gestionnaire2_Nom] nvarchar(255)  NULL,
-    [Gestionnaire2_Prenom] nvarchar(255)  NULL,
-    [Gestionnaire2_Email] nvarchar(255)  NULL,
-    [Gestionnaire2_Tel] nvarchar(255)  NULL,
-    [Gestionnaire2_Structure] nvarchar(255)  NULL
-);
-GO
-
--- Creating table 'Annees'
-CREATE TABLE [dbo].[Annees] (
-    [Id] int IDENTITY(1,1) NOT NULL,
-    [Libelle] nvarchar(12)  NOT NULL
-);
-GO
-
--- Creating table 'ActionEduAxes'
-CREATE TABLE [dbo].[ActionEduAxes] (
-    [Id] int IDENTITY(1,1) NOT NULL,
-    [Nom] nvarchar(max)  NOT NULL,
-    [Neutralise] bit  NOT NULL,
-    [Ordre] int  NOT NULL
-);
-GO
-
--- Creating table 'ActionEduThematiques'
-CREATE TABLE [dbo].[ActionEduThematiques] (
-    [Id] int IDENTITY(1,1) NOT NULL,
-    [Nom] nvarchar(max)  NOT NULL,
-    [Neutralise] bit  NOT NULL,
-    [Ordre] int  NOT NULL,
-    [ActionEduAxeId] int  NOT NULL
-);
-GO
-
--- Creating table 'ActionsEdu'
-CREATE TABLE [dbo].[ActionsEdu] (
-    [Id] int IDENTITY(1,1) NOT NULL,
-    [Numero] nvarchar(max)  NOT NULL,
-    [Nom] nvarchar(max)  NOT NULL,
-    [Description] nvarchar(max)  NOT NULL,
-    [Neutralise] bit  NOT NULL,
-    [Ordre] int  NOT NULL,
-    [ActionEduThematiqueId] int  NOT NULL,
-    [AnneeId] int  NOT NULL
-);
-GO
-
--- Creating table 'ActionsEduColleges'
-CREATE TABLE [dbo].[ActionsEduColleges] (
-    [Id] int IDENTITY(1,1) NOT NULL,
-    [CommentaireInterne] nvarchar(max)  NOT NULL,
-    [CommentairePublic] nvarchar(max)  NOT NULL,
-    [NbEleves] bigint  NOT NULL,
-    [Montant] bigint  NOT NULL,
-    [TiersAstre_Code] nvarchar(max)  NOT NULL,
-    [TiersAstre_Nom] nvarchar(max)  NOT NULL,
-    [TiersAstre_CodeFamille] nvarchar(max)  NOT NULL,
-    [TiersAstre_Description] nvarchar(max)  NOT NULL,
-    [CollegeId] int  NOT NULL,
-    [ActionEduId] int  NOT NULL
-);
-GO
-
--- Creating table 'ActionEduMissions'
-CREATE TABLE [dbo].[ActionEduMissions] (
-    [Id] int IDENTITY(1,1) NOT NULL,
-    [Code] nvarchar(max)  NOT NULL,
-    [Nom] nvarchar(max)  NOT NULL,
-    [Description] nvarchar(max)  NOT NULL,
-    [ActionEduCollegeId] int  NOT NULL
-);
-GO
-
--- --------------------------------------------------
--- Creating all PRIMARY KEY constraints
--- --------------------------------------------------
-
--- Creating primary key on [Id] in table 'TypesCollege'
-ALTER TABLE [dbo].[TypesCollege]
-ADD CONSTRAINT [PK_TypesCollege]
-    PRIMARY KEY CLUSTERED ([Id] ASC);
-GO
-
--- Creating primary key on [Id] in table 'Territoires'
-ALTER TABLE [dbo].[Territoires]
-ADD CONSTRAINT [PK_Territoires]
-    PRIMARY KEY CLUSTERED ([Id] ASC);
-GO
-
--- Creating primary key on [Id] in table 'Colleges'
-ALTER TABLE [dbo].[Colleges]
-ADD CONSTRAINT [PK_Colleges]
-    PRIMARY KEY CLUSTERED ([Id] ASC);
-GO
-
--- Creating primary key on [College_Id] in table 'Identites'
-ALTER TABLE [dbo].[Identites]
-ADD CONSTRAINT [PK_Identites]
-    PRIMARY KEY CLUSTERED ([College_Id] ASC);
-GO
-
--- Creating primary key on [Id] in table 'Annees'
-ALTER TABLE [dbo].[Annees]
-ADD CONSTRAINT [PK_Annees]
-    PRIMARY KEY CLUSTERED ([Id] ASC);
-GO
-
--- Creating primary key on [Id] in table 'ActionEduAxes'
-ALTER TABLE [dbo].[ActionEduAxes]
-ADD CONSTRAINT [PK_ActionEduAxes]
-    PRIMARY KEY CLUSTERED ([Id] ASC);
-GO
-
--- Creating primary key on [Id] in table 'ActionEduThematiques'
-ALTER TABLE [dbo].[ActionEduThematiques]
-ADD CONSTRAINT [PK_ActionEduThematiques]
-    PRIMARY KEY CLUSTERED ([Id] ASC);
-GO
-
--- Creating primary key on [Id] in table 'ActionsEdu'
-ALTER TABLE [dbo].[ActionsEdu]
-ADD CONSTRAINT [PK_ActionsEdu]
-    PRIMARY KEY CLUSTERED ([Id] ASC);
-GO
-
--- Creating primary key on [Id] in table 'ActionsEduColleges'
-ALTER TABLE [dbo].[ActionsEduColleges]
-ADD CONSTRAINT [PK_ActionsEduColleges]
-    PRIMARY KEY CLUSTERED ([Id] ASC);
-GO
-
--- Creating primary key on [Id] in table 'ActionEduMissions'
-ALTER TABLE [dbo].[ActionEduMissions]
-ADD CONSTRAINT [PK_ActionEduMissions]
-    PRIMARY KEY CLUSTERED ([Id] ASC);
-GO
-
--- --------------------------------------------------
--- Creating all FOREIGN KEY constraints
--- --------------------------------------------------
-
--- Creating foreign key on [Territoire_Id] in table 'Colleges'
-ALTER TABLE [dbo].[Colleges]
-ADD CONSTRAINT [FK_Colleges_Territoires]
-    FOREIGN KEY ([Territoire_Id])
-    REFERENCES [dbo].[Territoires]
-        ([Id])
-    ON DELETE NO ACTION ON UPDATE NO ACTION;
-GO
-
--- Creating non-clustered index for FOREIGN KEY 'FK_Colleges_Territoires'
-CREATE INDEX [IX_FK_Colleges_Territoires]
-ON [dbo].[Colleges]
-    ([Territoire_Id]);
-GO
-
--- Creating foreign key on [TypeCollege_Id] in table 'Colleges'
-ALTER TABLE [dbo].[Colleges]
-ADD CONSTRAINT [FK_Colleges_TypesCollege]
-    FOREIGN KEY ([TypeCollege_Id])
-    REFERENCES [dbo].[TypesCollege]
-        ([Id])
-    ON DELETE NO ACTION ON UPDATE NO ACTION;
-GO
-
--- Creating non-clustered index for FOREIGN KEY 'FK_Colleges_TypesCollege'
-CREATE INDEX [IX_FK_Colleges_TypesCollege]
-ON [dbo].[Colleges]
-    ([TypeCollege_Id]);
-GO
-
--- Creating foreign key on [College_Id] in table 'Identites'
-ALTER TABLE [dbo].[Identites]
-ADD CONSTRAINT [FK_FicheIdentite_College]
-    FOREIGN KEY ([College_Id])
-    REFERENCES [dbo].[Colleges]
-        ([Id])
-    ON DELETE NO ACTION ON UPDATE NO ACTION;
-GO
-
--- Creating foreign key on [Annee_Id] in table 'Colleges'
-ALTER TABLE [dbo].[Colleges]
-ADD CONSTRAINT [FK_AnneeCollege]
-    FOREIGN KEY ([Annee_Id])
-    REFERENCES [dbo].[Annees]
-        ([Id])
-    ON DELETE NO ACTION ON UPDATE NO ACTION;
-GO
-
--- Creating non-clustered index for FOREIGN KEY 'FK_AnneeCollege'
-CREATE INDEX [IX_FK_AnneeCollege]
-ON [dbo].[Colleges]
-    ([Annee_Id]);
-GO
-
--- Creating foreign key on [ActionEduAxeId] in table 'ActionEduThematiques'
-ALTER TABLE [dbo].[ActionEduThematiques]
-ADD CONSTRAINT [FK_ActionEduAxeActionEduThematique]
-    FOREIGN KEY ([ActionEduAxeId])
-    REFERENCES [dbo].[ActionEduAxes]
-        ([Id])
-    ON DELETE NO ACTION ON UPDATE NO ACTION;
-GO
-
--- Creating non-clustered index for FOREIGN KEY 'FK_ActionEduAxeActionEduThematique'
-CREATE INDEX [IX_FK_ActionEduAxeActionEduThematique]
-ON [dbo].[ActionEduThematiques]
-    ([ActionEduAxeId]);
-GO
-
--- Creating foreign key on [ActionEduThematiqueId] in table 'ActionsEdu'
-ALTER TABLE [dbo].[ActionsEdu]
-ADD CONSTRAINT [FK_ActionEduThematiqueActionEdu]
-    FOREIGN KEY ([ActionEduThematiqueId])
-    REFERENCES [dbo].[ActionEduThematiques]
-        ([Id])
-    ON DELETE NO ACTION ON UPDATE NO ACTION;
-GO
-
--- Creating non-clustered index for FOREIGN KEY 'FK_ActionEduThematiqueActionEdu'
-CREATE INDEX [IX_FK_ActionEduThematiqueActionEdu]
-ON [dbo].[ActionsEdu]
-    ([ActionEduThematiqueId]);
-GO
-
--- Creating foreign key on [AnneeId] in table 'ActionsEdu'
-ALTER TABLE [dbo].[ActionsEdu]
-ADD CONSTRAINT [FK_ActionEduAnnee]
-    FOREIGN KEY ([AnneeId])
-    REFERENCES [dbo].[Annees]
-        ([Id])
-    ON DELETE NO ACTION ON UPDATE NO ACTION;
-GO
-
--- Creating non-clustered index for FOREIGN KEY 'FK_ActionEduAnnee'
-CREATE INDEX [IX_FK_ActionEduAnnee]
-ON [dbo].[ActionsEdu]
-    ([AnneeId]);
-GO
-
--- Creating foreign key on [ActionEduCollegeId] in table 'ActionEduMissions'
-ALTER TABLE [dbo].[ActionEduMissions]
-ADD CONSTRAINT [FK_ActionEduCollegeActionEduMission]
-    FOREIGN KEY ([ActionEduCollegeId])
-    REFERENCES [dbo].[ActionsEduColleges]
-        ([Id])
-    ON DELETE NO ACTION ON UPDATE NO ACTION;
-GO
-
--- Creating non-clustered index for FOREIGN KEY 'FK_ActionEduCollegeActionEduMission'
-CREATE INDEX [IX_FK_ActionEduCollegeActionEduMission]
-ON [dbo].[ActionEduMissions]
-    ([ActionEduCollegeId]);
-GO
-
--- Creating foreign key on [CollegeId] in table 'ActionsEduColleges'
-ALTER TABLE [dbo].[ActionsEduColleges]
-ADD CONSTRAINT [FK_ActionEduCollegeCollege]
-    FOREIGN KEY ([CollegeId])
-    REFERENCES [dbo].[Colleges]
-        ([Id])
-    ON DELETE NO ACTION ON UPDATE NO ACTION;
-GO
-
--- Creating non-clustered index for FOREIGN KEY 'FK_ActionEduCollegeCollege'
-CREATE INDEX [IX_FK_ActionEduCollegeCollege]
-ON [dbo].[ActionsEduColleges]
-    ([CollegeId]);
-GO
-
--- Creating foreign key on [ActionEduId] in table 'ActionsEduColleges'
-ALTER TABLE [dbo].[ActionsEduColleges]
-ADD CONSTRAINT [FK_ActionEduCollegeActionEdu]
-    FOREIGN KEY ([ActionEduId])
-    REFERENCES [dbo].[ActionsEdu]
-        ([Id])
-    ON DELETE NO ACTION ON UPDATE NO ACTION;
-GO
-
--- Creating non-clustered index for FOREIGN KEY 'FK_ActionEduCollegeActionEdu'
-CREATE INDEX [IX_FK_ActionEduCollegeActionEdu]
-ON [dbo].[ActionsEduColleges]
-    ([ActionEduId]);
-GO
-
--- --------------------------------------------------
--- Script has ended
--- --------------------------------------------------

+ 5 - 1
CD67.FicheCollege.Entity/Extend/College.cs

@@ -73,7 +73,8 @@ namespace CD67.FicheCollege.Entity
                 Gestionnaire1Sid = Gestionnaire1Sid,
                 Gestionnaire2Sid = Gestionnaire2Sid,
                 TokenId = TokenId,
-        };
+                RestaurationType_Id = RestaurationType_Id
+            };
     }
 
 }
@@ -148,5 +149,8 @@ namespace CD67.FicheCollege.Entity
         public string Gestionnaire2Sid { get; set; }
 
         public Guid TokenId { get; set; }
+        [Display(Name = "Type de restauration")]
+        public int RestaurationType_Id { get; set; }
+
     }
 }

+ 43 - 0
CD67.FicheCollege.Entity/Extend/RestaurationParametre.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CD67.FicheCollege.Entity
+{
+    /// <summary>
+    /// Classe d'extension de celle d'Entity, nécessaire pour y associer les Metadata
+    /// </summary>
+    [MetadataType(typeof(RestaurationParametre_Metadata))]
+    public partial class RestaurationParametre
+    {
+    }
+
+    /// <summary>
+    /// Classe contenant les DataAnnotations pour chaque champ
+    /// </summary>
+    public class RestaurationParametre_Metadata
+    {
+        [Required(ErrorMessage = "Obligatoire")]
+        public int Id { get; set; }
+        [Required(ErrorMessage = "Obligatoire")]
+        [Display(Name = "Année scolaire")]
+        public string Annee_Id { get; set; }
+        [Required(ErrorMessage = "Obligatoire")]
+        [Display(Name = "Ouverture de la campagne de saisie")]
+        public bool? Campagne { get; set; }
+        [Display(Name = "Prix unitaire minimum")]
+        public Nullable<decimal> Prix_Mini { get; set; }
+        [Display(Name = "Prix ticket ATC")]
+        public Nullable<decimal> Prix_ATC { get; set; }
+        [Display(Name = "Prix ticket agent de catégorie C et assimilés")]
+        public Nullable<decimal> Prix_AgentC { get; set; }
+        [Display(Name = "Prix ticket autres commensaux")]
+        public Nullable<decimal> Prix_MiniAutres { get; set; }
+
+        [Display(Name = "Types de repas")]
+        public virtual ICollection<RestaurationTypeRepa> RestaurationTypeRepas { get; set; }
+    }
+}

+ 32 - 0
CD67.FicheCollege.Entity/Extend/RestaurationType.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CD67.FicheCollege.Entity
+{
+    /// <summary>
+    /// Classe d'extension de celle d'Entity, nécessaire pour y associer les Metadata
+    /// </summary>
+    [MetadataType(typeof(RestaurationType_Metadata))]
+    public partial class RestaurationType
+    {
+    }
+
+    /// <summary>
+    /// Classe contenant les DataAnnotations pour chaque champ
+    /// </summary>
+    public class RestaurationType_Metadata
+    {
+        [Required(ErrorMessage = "Obligatoire")]
+        public int Id { get; set; }
+        [Required(ErrorMessage = "Obligatoire")]
+        [Display(Name = "Type de restauration")]
+        public string Libelle { get; set; }
+        [Display(Name = "Est Valide (oui/non)")]
+        public bool? Valid { get; set; }
+        public int Ordre { get; set; }
+    }
+}

+ 32 - 0
CD67.FicheCollege.Entity/Extend/RestaurationTypeRepa.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CD67.FicheCollege.Entity
+{
+    /// <summary>
+    /// Classe d'extension de celle d'Entity, nécessaire pour y associer les Metadata
+    /// </summary>
+    [MetadataType(typeof(RestaurationTypeRepa_Metadata))]
+    public partial class RestaurationTypeRepa
+    {
+    }
+
+    /// <summary>
+    /// Classe contenant les DataAnnotations pour chaque champ
+    /// </summary>
+    public class RestaurationTypeRepa_Metadata
+    {
+        [Required(ErrorMessage = "Obligatoire")]
+        public int Id { get; set; }
+        [Required(ErrorMessage = "Obligatoire")]
+        [Display(Name = "Type de repas")]
+        public string Libelle { get; set; }
+        [Display(Name = "Est Valide (oui/non)")]
+        public bool? Valid { get; set; }
+        public int Ordre { get; set; }
+    }
+}

+ 0 - 136
CD67.FicheCollege.Entity/Model_initial_inserts.sql

@@ -1,136 +0,0 @@
-USE [FicheCollege]
-
-DELETE FROM Identites;
-DELETE FROM Colleges;
-
-DELETE FROM Annees;
-DELETE FROM Territoires;
-DELETE FROM TypesCollege;
-
-IF EXISTS (SELECT * FROM sys.identity_columns WHERE OBJECT_NAME(OBJECT_ID) = 'Colleges' AND last_value IS NOT NULL) 
-	DBCC CHECKIDENT(Colleges, RESEED,-1)
-ELSE
-	DBCC CHECKIDENT(Colleges, RESEED,0)
-
-IF EXISTS (SELECT * FROM sys.identity_columns WHERE OBJECT_NAME(OBJECT_ID) = 'Annees' AND last_value IS NOT NULL) 
-	DBCC CHECKIDENT(Annees, RESEED,-1)
-ELSE
-	DBCC CHECKIDENT(Annees, RESEED,0)
-
-IF EXISTS (SELECT * FROM sys.identity_columns WHERE OBJECT_NAME(OBJECT_ID) = 'TypesCollege' AND last_value IS NOT NULL) 
-	DBCC CHECKIDENT(TypesCollege, RESEED,-1)
-ELSE
-	DBCC CHECKIDENT(TypesCollege, RESEED,0)
-
-
-INSERT INTO TypesCollege(Libelle, Ordre)
-VALUES  ('Collège Publique',1), 
-		('Collège Privé',2),
-		('Cité Scolaire',3);
-
-INSERT INTO Territoires(Id, Libelle, Ordre)
-VALUES	('TE', 'Territoire Eurométropole',1),
-		('TO', 'Territoire Ouest',2), 
-		('TS', 'Territoire Sud',3), 
-		('TN', 'Territoire Nord',4);
-
-INSERT INTO Annees(Libelle) 
-VALUES ('2000-2001'),
-		('2001-2002'),
-		('2002-2003'),
-		('2003-2004'),
-		('2004-2005'),
-		('2005-2006'),
-		('2006-2007'),
-		('2007-2008'),
-		('2008-2009'),
-		('2009-2010'),
-		('2010-2011'),
-		('2011-2012'),
-		('2012-2013'),
-		('2013-2014'),
-		('2014-2015'),
-		('2015-2016'),
-		('2016-2017'),
-		('2017-2018'),
-		('2018-2019'),
-		('2019-2020'),
-		('2020-2021'),
-		('2021-2022'),
-		('2022-2023'),
-		('2023-2024'),
-		('2024-2025'),
-		('2025-2026'),
-		('2026-2027'),
-		('2027-2028'),
-		('2028-2029'),
-		('2029-2030'),
-		('2030-2031'),
-		('2031-2032'),
-		('2032-2033'),
-		('2033-2034'),
-		('2034-2035'),
-		('2035-2036'),
-		('2036-2037'),
-		('2037-2038'),
-		('2038-2039'),
-		('2039-2040'),
-		('2040-2041'),
-		('2041-2042'),
-		('2042-2043'),
-		('2043-2044'),
-		('2044-2045'),
-		('2045-2046'),
-		('2046-2047'),
-		('2047-2048'),
-		('2048-2049'),
-		('2049-2050'),
-		('2050-2051'),
-		('2051-2052'),
-		('2052-2053'),
-		('2053-2054'),
-		('2054-2055'),
-		('2055-2056'),
-		('2056-2057'),
-		('2057-2058'),
-		('2058-2059'),
-		('2059-2060'),
-		('2060-2061'),
-		('2061-2062'),
-		('2062-2063'),
-		('2063-2064'),
-		('2064-2065'),
-		('2065-2066'),
-		('2066-2067'),
-		('2067-2068'),
-		('2068-2069'),
-		('2069-2070'),
-		('2070-2071'),
-		('2071-2072'),
-		('2072-2073'),
-		('2073-2074'),
-		('2074-2075'),
-		('2075-2076'),
-		('2076-2077'),
-		('2077-2078'),
-		('2078-2079'),
-		('2079-2080'),
-		('2080-2081'),
-		('2081-2082'),
-		('2082-2083'),
-		('2083-2084'),
-		('2084-2085'),
-		('2085-2086'),
-		('2086-2087'),
-		('2087-2088'),
-		('2088-2089'),
-		('2089-2090'),
-		('2090-2091'),
-		('2091-2092'),
-		('2092-2093'),
-		('2093-2094'),
-		('2094-2095'),
-		('2095-2096'),
-		('2096-2097'),
-		('2097-2098'),
-		('2098-2099');

+ 35 - 0
CD67.FicheCollege.Entity/RestaurationParametre.cs

@@ -0,0 +1,35 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Ce code a été généré à partir d'un modèle.
+//
+//     Des modifications manuelles apportées à ce fichier peuvent conduire à un comportement inattendu de votre application.
+//     Les modifications manuelles apportées à ce fichier sont remplacées si le code est régénéré.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CD67.FicheCollege.Entity
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class RestaurationParametre
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public RestaurationParametre()
+        {
+            this.RestaurationTypeRepas = new HashSet<RestaurationTypeRepa>();
+        }
+    
+        public int Id { get; set; }
+        public int Annee_Id { get; set; }
+        public bool Campagne { get; set; }
+        public Nullable<decimal> Prix_Mini { get; set; }
+        public Nullable<decimal> Prix_ATC { get; set; }
+        public Nullable<decimal> Prix_AgentC { get; set; }
+        public Nullable<decimal> Prix_MiniAutres { get; set; }
+    
+        public virtual Annee Annee { get; set; }
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<RestaurationTypeRepa> RestaurationTypeRepas { get; set; }
+    }
+}

+ 31 - 0
CD67.FicheCollege.Entity/RestaurationType.cs

@@ -0,0 +1,31 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Ce code a été généré à partir d'un modèle.
+//
+//     Des modifications manuelles apportées à ce fichier peuvent conduire à un comportement inattendu de votre application.
+//     Les modifications manuelles apportées à ce fichier sont remplacées si le code est régénéré.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CD67.FicheCollege.Entity
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class RestaurationType
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public RestaurationType()
+        {
+            this.Colleges = new HashSet<College>();
+        }
+    
+        public int Id { get; set; }
+        public string Libelle { get; set; }
+        public bool Valid { get; set; }
+        public int Ordre { get; set; }
+    
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<College> Colleges { get; set; }
+    }
+}

+ 31 - 0
CD67.FicheCollege.Entity/RestaurationTypeRepa.cs

@@ -0,0 +1,31 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     Ce code a été généré à partir d'un modèle.
+//
+//     Des modifications manuelles apportées à ce fichier peuvent conduire à un comportement inattendu de votre application.
+//     Les modifications manuelles apportées à ce fichier sont remplacées si le code est régénéré.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CD67.FicheCollege.Entity
+{
+    using System;
+    using System.Collections.Generic;
+    
+    public partial class RestaurationTypeRepa
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public RestaurationTypeRepa()
+        {
+            this.RestaurationParametres = new HashSet<RestaurationParametre>();
+        }
+    
+        public int Id { get; set; }
+        public string Libelle { get; set; }
+        public bool Valid { get; set; }
+        public int Ordre { get; set; }
+    
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<RestaurationParametre> RestaurationParametres { get; set; }
+    }
+}

+ 12 - 0
CD67.FicheCollege.Factory/CD67.FicheCollege.Factory.csproj

@@ -117,6 +117,15 @@
       <DependentUpon>GenericFactories.tt</DependentUpon>
     </Compile>
     <Compile Include="Internal\BaseFactory.cs" />
+    <Compile Include="Internal\RestaurationParametreFactory.cs">
+      <DependentUpon>GenericFactories.tt</DependentUpon>
+    </Compile>
+    <Compile Include="Internal\RestaurationTypeFactory.cs">
+      <DependentUpon>GenericFactories.tt</DependentUpon>
+    </Compile>
+    <Compile Include="Internal\RestaurationTypeRepaFactory.cs">
+      <DependentUpon>GenericFactories.tt</DependentUpon>
+    </Compile>
     <Compile Include="Internal\TerritoireFactory.cs">
       <DependentUpon>GenericFactories.tt</DependentUpon>
     </Compile>
@@ -129,8 +138,11 @@
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
       <DependentUpon>Settings.settings</DependentUpon>
     </Compile>
+    <Compile Include="RestaurationParametreFactory.cs" />
+    <Compile Include="RestaurationTypeRepaFactory.cs" />
     <Compile Include="TerritoireFactory.cs" />
     <Compile Include="ActionEduAxeFactory.cs" />
+    <Compile Include="RestaurationTypeFactory.cs" />
     <Compile Include="TypeCollegeFactory.cs" />
   </ItemGroup>
   <ItemGroup>

+ 1 - 0
CD67.FicheCollege.Factory/CollegeFactory.cs

@@ -40,6 +40,7 @@ namespace CD67.FicheCollege.Factory
             clone.Gestionnaire1Sid = college.Gestionnaire1Sid;
             clone.Gestionnaire2Sid = college.Gestionnaire2Sid;
             clone.TokenId = college.TokenId;
+            clone.RestaurationType_Id = college.RestaurationType_Id;
 
             // enregistre le clone en base
             base.add(ref clone);

+ 21 - 0
CD67.FicheCollege.Factory/Internal/RestaurationParametreFactory.cs

@@ -0,0 +1,21 @@
+using CD67.FicheCollege.Entity;
+using System.Linq;
+
+namespace CD67.FicheCollege.Factory
+{
+	/// <summary>
+    /// NE PAS MODIFIER
+    /// C'est une classe partielle, elle peut être complétée avec une classe partielle du même nom
+    /// Factory générée automatiquement à l'aide du fichier GenericFactories.tt
+    /// pour toutes les entités du fichier entity : /CD67.FicheCollege.Entity/EntityModel.edmx
+    /// </summary>
+	public partial class RestaurationParametreFactory : Internal.BaseFactory<Entity.RestaurationParametre>
+	{
+		/// <summary>
+        /// Constructeur public lié au constructeur de base
+        /// </summary>
+        /// <param name="dbContext">Context Entity Framework utilisé dans la classe</param>
+		public RestaurationParametreFactory(Entities dbContext) : base(dbContext) { }
+	}
+}
+	

+ 21 - 0
CD67.FicheCollege.Factory/Internal/RestaurationTypeFactory.cs

@@ -0,0 +1,21 @@
+using CD67.FicheCollege.Entity;
+using System.Linq;
+
+namespace CD67.FicheCollege.Factory
+{
+	/// <summary>
+    /// NE PAS MODIFIER
+    /// C'est une classe partielle, elle peut être complétée avec une classe partielle du même nom
+    /// Factory générée automatiquement à l'aide du fichier GenericFactories.tt
+    /// pour toutes les entités du fichier entity : /CD67.FicheCollege.Entity/EntityModel.edmx
+    /// </summary>
+	public partial class RestaurationTypeFactory : Internal.BaseFactory<Entity.RestaurationType>
+	{
+		/// <summary>
+        /// Constructeur public lié au constructeur de base
+        /// </summary>
+        /// <param name="dbContext">Context Entity Framework utilisé dans la classe</param>
+		public RestaurationTypeFactory(Entities dbContext) : base(dbContext) { }
+	}
+}
+	

+ 21 - 0
CD67.FicheCollege.Factory/Internal/RestaurationTypeRepaFactory.cs

@@ -0,0 +1,21 @@
+using CD67.FicheCollege.Entity;
+using System.Linq;
+
+namespace CD67.FicheCollege.Factory
+{
+	/// <summary>
+    /// NE PAS MODIFIER
+    /// C'est une classe partielle, elle peut être complétée avec une classe partielle du même nom
+    /// Factory générée automatiquement à l'aide du fichier GenericFactories.tt
+    /// pour toutes les entités du fichier entity : /CD67.FicheCollege.Entity/EntityModel.edmx
+    /// </summary>
+	public partial class RestaurationTypeRepaFactory : Internal.BaseFactory<Entity.RestaurationTypeRepa>
+	{
+		/// <summary>
+        /// Constructeur public lié au constructeur de base
+        /// </summary>
+        /// <param name="dbContext">Context Entity Framework utilisé dans la classe</param>
+		public RestaurationTypeRepaFactory(Entities dbContext) : base(dbContext) { }
+	}
+}
+	

+ 47 - 0
CD67.FicheCollege.Factory/RestaurationParametreFactory.cs

@@ -0,0 +1,47 @@
+using CD67.FicheCollege.Entity;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Data.Entity;
+
+namespace CD67.FicheCollege.Factory
+{
+    public partial class RestaurationParametreFactory : Internal.BaseFactory<Entity.RestaurationParametre>
+    {
+        public override IQueryable<Entity.RestaurationParametre> getAll()
+        {
+            return base.getAll();
+        }
+
+        public override void add(ref Entity.RestaurationParametre entity)
+        {
+            base.add(ref entity);
+        }
+
+        public override void update(ref Entity.RestaurationParametre entity)
+        {
+            base.update(ref entity);
+        }
+
+        public void addTypeRepas(ref Entity.RestaurationTypeRepa typeRepas, RestaurationParametre param)
+        {
+            param.RestaurationTypeRepas.Add(typeRepas);
+            base.update(ref param);
+        }
+
+        public void removeTypeRepas(ref Entity.RestaurationTypeRepa typeRepas, RestaurationParametre param)
+        {
+            param.RestaurationTypeRepas.Remove(typeRepas);
+            base.update(ref param);
+        }
+
+        public override void delete(ref Entity.RestaurationParametre entity)
+        {
+            base.delete(ref entity);
+            //On supprime les types de repas liés
+            entity.RestaurationTypeRepas.Clear();
+            this.update(ref entity);
+        }
+    }
+}

+ 73 - 0
CD67.FicheCollege.Factory/RestaurationTypeFactory.cs

@@ -0,0 +1,73 @@
+using CD67.FicheCollege.Entity;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Data.Entity;
+
+namespace CD67.FicheCollege.Factory
+{
+    public partial class RestaurationTypeFactory : Internal.BaseFactory<Entity.RestaurationType>
+    {
+        public override IQueryable<Entity.RestaurationType> getAll()
+        {
+            return base.getAll("Ordre");
+        }
+
+        public IQueryable<Entity.RestaurationType> getAllValid()
+        {
+            return base.getAll("Ordre").Where(i => i.Valid == true);
+        }
+
+        public void Up(ref Entity.RestaurationType item)
+        {
+            int ordre = item.Ordre;
+
+            //Cas de sortie immédiate
+            if (item.Ordre == 1) return;
+
+            Entity.RestaurationType itemToSubstitute = dbContext.RestaurationTypes.Where(i => i.Ordre == ordre - 1).First();
+            itemToSubstitute.Ordre += 1;
+            item.Ordre -= 1;
+            dbContext.SaveChanges();
+        }
+
+        public void Down(ref Entity.RestaurationType item)
+        {
+            int ordre = item.Ordre;
+
+            //Cas de sortie immédiate
+            if (item.Ordre == dbContext.RestaurationTypes.Max(i => i.Ordre)) return;
+
+            Entity.RestaurationType itemToSubstitute = dbContext.RestaurationTypes.Where(i => i.Ordre == ordre + 1).First();
+            itemToSubstitute.Ordre -= 1;
+            item.Ordre += 1;
+            dbContext.SaveChanges();
+        }
+
+        private void Sort()
+        {
+            int ordre = 1;
+            foreach (Entity.RestaurationType statut in dbContext.RestaurationTypes.OrderBy(i => i.Ordre))
+            {
+                statut.Ordre = ordre++;
+            }
+            dbContext.SaveChanges();
+        }
+
+        public override void add(ref Entity.RestaurationType entity)
+        {
+            //Initialisation de l'ordre
+            if (dbContext.RestaurationTypes.Count() == 0) entity.Ordre = 1;
+            else entity.Ordre = dbContext.RestaurationTypes.Max(i => i.Ordre) + 1;
+
+            base.add(ref entity);
+        }
+
+        public override void delete(ref Entity.RestaurationType entity)
+        {
+            base.delete(ref entity);
+            Sort();
+        }
+    }
+}

+ 81 - 0
CD67.FicheCollege.Factory/RestaurationTypeRepaFactory.cs

@@ -0,0 +1,81 @@
+using CD67.FicheCollege.Entity;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Data.Entity;
+
+namespace CD67.FicheCollege.Factory
+{
+    public partial class RestaurationTypeRepaFactory : Internal.BaseFactory<Entity.RestaurationTypeRepa>
+    {
+        public override IQueryable<Entity.RestaurationTypeRepa> getAll()
+        {
+            return base.getAll("Ordre");
+        }
+
+        public IQueryable<Entity.RestaurationTypeRepa> getAllValid()
+        {
+            return base.getAll("Ordre").Where(i => i.Valid == true);
+        }
+
+        public IQueryable<Entity.RestaurationTypeRepa> getAllValid(RestaurationParametre param)
+        {
+            if (param.RestaurationTypeRepas.Count == 0) this.dbContext.Entry(param).Collection(i => i.RestaurationTypeRepas).Load();
+            IQueryable<Entity.RestaurationTypeRepa> typeRepas = param.RestaurationTypeRepas.AsQueryable();
+
+            return typeRepas.Where(i => i.Valid == true).OrderBy(i => i.Ordre);
+        }
+
+        public void Up(ref Entity.RestaurationTypeRepa item)
+        {
+            int ordre = item.Ordre;
+
+            //Cas de sortie immédiate
+            if (item.Ordre == 1) return;
+
+            Entity.RestaurationTypeRepa itemToSubstitute = dbContext.RestaurationTypeRepas.Where(i => i.Ordre == ordre - 1).First();
+            itemToSubstitute.Ordre += 1;
+            item.Ordre -= 1;
+            dbContext.SaveChanges();
+        }
+
+        public void Down(ref Entity.RestaurationTypeRepa item)
+        {
+            int ordre = item.Ordre;
+
+            //Cas de sortie immédiate
+            if (item.Ordre == dbContext.RestaurationTypes.Max(i => i.Ordre)) return;
+
+            Entity.RestaurationTypeRepa itemToSubstitute = dbContext.RestaurationTypeRepas.Where(i => i.Ordre == ordre + 1).First();
+            itemToSubstitute.Ordre -= 1;
+            item.Ordre += 1;
+            dbContext.SaveChanges();
+        }
+
+        private void Sort()
+        {
+            int ordre = 1;
+            foreach (Entity.RestaurationTypeRepa statut in dbContext.RestaurationTypeRepas.OrderBy(i => i.Ordre))
+            {
+                statut.Ordre = ordre++;
+            }
+            dbContext.SaveChanges();
+        }
+
+        public override void add(ref Entity.RestaurationTypeRepa entity)
+        {
+            //Initialisation de l'ordre
+            if (dbContext.RestaurationTypeRepas.Count() == 0) entity.Ordre = 1;
+            else entity.Ordre = dbContext.RestaurationTypeRepas.Max(i => i.Ordre) + 1;
+
+            base.add(ref entity);
+        }
+
+        public override void delete(ref Entity.RestaurationTypeRepa entity)
+        {
+            base.delete(ref entity);
+            Sort();
+        }
+    }
+}

+ 20 - 0
CD67.FicheCollege.MVC/CD67.FicheCollege.MVC.csproj

@@ -22,6 +22,7 @@
     <IISExpressUseClassicPipelineMode />
     <UseGlobalApplicationHostFile />
     <TargetFrameworkProfile />
+    <Use64BitIISExpress />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -177,9 +178,13 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="App_Start\BundleConfig.cs" />
+    <Compile Include="Controllers\RestaurationParametresController.cs" />
+    <Compile Include="Controllers\RestaurationTypeRepasController.cs" />
+    <Compile Include="Controllers\RestaurationTypesController.cs" />
     <Compile Include="Controllers\ActionEduAxesController.cs" />
     <Compile Include="Controllers\ActionsEduActeursController.cs" />
     <Compile Include="Controllers\ActionsEduCollegeController.cs" />
+    <Compile Include="Controllers\RestaurationController.cs" />
     <Compile Include="Controllers\ActionsEduController.cs" />
     <Compile Include="Controllers\ActionEduThematiquesController.cs" />
     <Compile Include="Controllers\CollegesController.cs" />
@@ -201,9 +206,13 @@
     <Compile Include="Models\ActionEduCollegeViewModel.cs" />
     <Compile Include="Models\ActionEduAxeViewModel.cs" />
     <Compile Include="Models\ActionEduThematiqueViewModel.cs" />
+    <Compile Include="Models\CheckBoxListItem.cs" />
     <Compile Include="Models\ImportActionEduViewModel.cs" />
     <Compile Include="Models\ImportCollegeViewModel.cs" />
+    <Compile Include="Models\RestaurationParametreViewModel.cs" />
+    <Compile Include="Models\RestaurationTypeRepaViewModel.cs" />
     <Compile Include="Models\TerritoireViewModel.cs" />
+    <Compile Include="Models\RestaurationTypeViewModel.cs" />
     <Compile Include="Models\TypeCollegeViewModel.cs" />
     <Compile Include="Models\ActionEduViewModel.cs" />
     <Compile Include="Models\CollegeViewModel.cs" />
@@ -465,6 +474,17 @@
     <Content Include="Views\ActionsEduActeurs\Delete.cshtml" />
     <Content Include="Views\ActionsEduActeurs\Details.cshtml" />
     <Content Include="Views\ActionsEduActeurs\Edit.cshtml" />
+    <Content Include="Views\Restauration\Index.cshtml" />
+    <Content Include="Views\RestaurationTypes\Create.cshtml" />
+    <Content Include="Views\RestaurationTypes\Delete.cshtml" />
+    <Content Include="Views\RestaurationTypes\Edit.cshtml" />
+    <Content Include="Views\RestaurationTypes\Index.cshtml" />
+    <Content Include="Views\Colleges\Type.cshtml" />
+    <Content Include="Views\RestaurationTypeRepas\Create.cshtml" />
+    <Content Include="Views\RestaurationTypeRepas\Delete.cshtml" />
+    <Content Include="Views\RestaurationTypeRepas\Edit.cshtml" />
+    <Content Include="Views\RestaurationTypeRepas\Index.cshtml" />
+    <Content Include="Views\RestaurationParametres\Edit.cshtml" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="App_Data\" />

+ 40 - 0
CD67.FicheCollege.MVC/Controllers/CollegesController.cs

@@ -176,6 +176,46 @@ namespace CD67.FicheCollege.MVC.Controllers
             return View(model);
         }
 
+        // GET: College/Type/5
+        public ActionResult Type(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            CollegeFactory collegeFactory = new CollegeFactory(db);
+            College col = collegeFactory.getById(id.Value);
+
+            if (id == null)
+            {
+                return HttpNotFound();
+            }
+            col.hydrate();
+            CollegeViewModel model = new CollegeViewModel(col, db, ModeAcces.Modification);
+
+            return View(model);
+        }
+
+        // POST: College/Type/5
+        // Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour 
+        // plus de détails, voir  http://go.microsoft.com/fwlink/?LinkId=317598.
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Type(Entity.College college)
+        {
+            if (ModelState.IsValid)
+            {
+                CollegeFactory collegeFactory = new CollegeFactory(db);
+                collegeFactory.update(ref college);
+                return RedirectToAction("Index", "Restauration", new { annee_id = college.Annee_Id });
+            }
+            college.hydrate();
+            CollegeViewModel model = new CollegeViewModel(college, db, ModeAcces.Modification);
+
+            return View(model);
+        }
+
+
         // GET: College/Delete/5
         public ActionResult Delete(int? id)
         {

+ 45 - 0
CD67.FicheCollege.MVC/Controllers/RestaurationController.cs

@@ -0,0 +1,45 @@
+using CD67.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+using CD67.FicheCollege.MVC.Models;
+using System.Net;
+using System.Web.Mvc;
+
+namespace CD67.FicheCollege.MVC.Controllers
+{
+    public class RestaurationController : Controller
+    {
+        private Entities db = new Entities();
+
+        // GET: Actions
+        public ActionResult Index(int? annee_id)
+        {
+            if (annee_id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            AnneeFactory fact = new AnneeFactory(db);
+            Annee annee = fact.getById(annee_id);
+            AnneeViewModel model = new AnneeViewModel(annee, db, ModeAcces.Lecture);
+
+            RestaurationParametreFactory paramFactory = new RestaurationParametreFactory(db);
+            RestaurationParametre param = paramFactory.getBy(x => x.Annee_Id == annee_id.Value);
+
+            if (param == null)
+                ViewBag.Ouverture = false;
+            else
+                ViewBag.Ouverture = param.Campagne;
+
+            return View(model);
+        }
+
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                db.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+    }
+}

+ 168 - 0
CD67.FicheCollege.MVC/Controllers/RestaurationParametresController.cs

@@ -0,0 +1,168 @@
+using System.Net;
+using System.Web.Mvc;
+using CD67.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+using CD67.FicheCollege.MVC.Models;
+using System.Linq;
+using System.Collections.Generic;
+using System;
+
+namespace CD67.FicheCollege.MVC.Controllers
+{
+    public class RestaurationParametresController : Controller
+    {
+        private Entities db = new Entities();
+
+        // GET: RestaurationParametres/Edit/5
+        public ActionResult Edit(int? annee_id)
+        {
+            if (annee_id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+
+            AnneeFactory fact = new AnneeFactory(db);
+            Annee annee = fact.getById(annee_id);
+
+            RestaurationParametreFactory paramFactory = new RestaurationParametreFactory(db);
+            RestaurationParametre param = paramFactory.getBy(x => x.Annee_Id == annee_id.Value);
+
+            RestaurationParametreViewModel model;
+
+            if (param == null)
+            {
+                param = new RestaurationParametre();
+                param.Annee_Id = annee_id.Value;
+            }
+
+            RestaurationTypeRepaFactory typeRepasFactory = new RestaurationTypeRepaFactory(db);
+            List<CheckBoxListItem> repasCBList = new List<CheckBoxListItem>();
+            foreach (var item in typeRepasFactory.getAllValid().ToList())
+            {
+                repasCBList.Add(
+                    new CheckBoxListItem()
+                    {
+                        ID = item.Id.ToString(),
+                        Display = item.Libelle,
+                        IsChecked = param.RestaurationTypeRepas.Any(i => i.Id == item.Id) ? true : false
+                    }
+                    );
+            }
+            ViewBag.repasCBList = repasCBList;
+
+            param.Annee = annee;
+
+            if (param.Id == 0)
+                model = new RestaurationParametreViewModel(param, ModeAcces.Creation);
+            else
+                model = new RestaurationParametreViewModel(param, ModeAcces.Modification);
+
+            return View(model);
+        }
+
+        // POST: RestaurationParametres/Edit/5
+        // Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour 
+        // plus de détails, voir  http://go.microsoft.com/fwlink/?LinkId=317598.
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Edit(Entity.RestaurationParametre param, List<CheckBoxListItem> RepasCBList)
+        {
+            ModeAcces mode = new ModeAcces();
+            RestaurationTypeRepaFactory typeRepasFactory = new RestaurationTypeRepaFactory(db);
+
+            if (ModelState.IsValid)
+            {
+                db.RestaurationParametres.Attach(param);
+
+                //Récupération des types de repas cochés
+                db.Entry(param).Collection(i => i.RestaurationTypeRepas).Load();
+                for (int i = 0; i < RepasCBList.Count; i++)
+                {
+                    Models.CheckBoxListItem item = RepasCBList[i];
+                    if (item.IsChecked)
+                    {
+                        if (!param.RestaurationTypeRepas.Any(repas => repas.Id == int.Parse(item.ID)))
+                        {
+                            param.RestaurationTypeRepas.Add(typeRepasFactory.getById(int.Parse(item.ID)));
+                        }
+                    }
+                    else
+                    {
+                        if (param.RestaurationTypeRepas.Any(repas => repas.Id == int.Parse(item.ID)))
+                        {
+                            param.RestaurationTypeRepas.Remove(typeRepasFactory.getById(int.Parse(item.ID)));
+                        }
+                    }
+                }
+
+                RestaurationParametreFactory paramFactory = new RestaurationParametreFactory(db);
+
+                if (param.Id == 0)
+                {
+                    paramFactory.add(ref param);
+                    mode = ModeAcces.Creation;
+                }
+                else
+                {
+                    paramFactory.update(ref param);
+                    mode = ModeAcces.Modification;
+                }
+
+                return RedirectToAction("Index", "Restauration", new { annee_id = param.Annee_Id });
+            }
+
+            List<CheckBoxListItem> repasCBList = new List<CheckBoxListItem>();
+            foreach (var item in typeRepasFactory.getAllValid().ToList())
+            {
+                repasCBList.Add(
+                    new CheckBoxListItem()
+                    {
+                        ID = item.Id.ToString(),
+                        Display = item.Libelle,
+                        IsChecked = param.RestaurationTypeRepas.Any(i => i.Id == item.Id) ? true : false
+                    }
+                    );
+            }
+            ViewBag.repasCBList = repasCBList;
+            RestaurationParametreViewModel model = new RestaurationParametreViewModel(param, mode);
+
+            return View(model);
+        }
+
+        // GET: RestaurationParametres/EditCampagne/5
+        public ActionResult EditCampagne(int? annee_id, bool edit)
+        {
+            if (annee_id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+
+            RestaurationParametreFactory paramFactory = new RestaurationParametreFactory(db);
+            RestaurationParametre param = paramFactory.getBy(x => x.Annee_Id == annee_id.Value);
+
+            if (param == null)
+            {
+                param = new RestaurationParametre();
+                param.Annee_Id = annee_id.Value;
+                param.Campagne = edit;
+
+                paramFactory.add(ref param);
+            }
+            else
+            {
+                param.Campagne = edit;
+                paramFactory.update(ref param);
+            }
+            return RedirectToAction("Index", "Restauration", new { annee_id = param.Annee_Id });
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                db.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+    }
+}

+ 143 - 0
CD67.FicheCollege.MVC/Controllers/RestaurationTypeRepasController.cs

@@ -0,0 +1,143 @@
+using CD67.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+using CD67.FicheCollege.MVC.Models;
+using System.Net;
+using System.Web.Mvc;
+
+namespace CD67.FicheCollege.MVC.Controllers
+{
+    public class RestaurationTypeRepasController : Controller
+    {
+        private Entities db = new Entities();
+
+        // GET: RestaurationTypeRepas
+        public ActionResult Index()
+        {
+            RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
+            RestaurationTypeRepaIndexViewModel model = new RestaurationTypeRepaIndexViewModel(fact.getAll());
+            return View(model);
+        }
+
+        // GET: RestaurationTypeRepas/Create
+        public ActionResult Create()
+        {
+            RestaurationTypeRepa repas = new RestaurationTypeRepa();
+
+            RestaurationTypeRepaViewModel model = new RestaurationTypeRepaViewModel(repas, ModeAcces.Creation);
+            return View(model);
+        }
+
+        // POST: RestaurationTypeRepas/Create
+        // Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour 
+        // plus de détails, voir  http://go.microsoft.com/fwlink/?LinkId=317598.
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Create(RestaurationTypeRepa repas)
+        {
+            if (ModelState.IsValid)
+            {
+                RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
+                fact.add(ref repas);
+                return RedirectToAction("Index");
+            }
+
+            RestaurationTypeRepaViewModel model = new RestaurationTypeRepaViewModel(repas, ModeAcces.Creation);
+            return View(model);
+        }
+
+        // GET: RestaurationTypeRepas/Edit/5
+        public ActionResult Edit(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
+            RestaurationTypeRepa repas = fact.getById(id.Value);
+            if (repas == null)
+            {
+                return HttpNotFound();
+            }
+            RestaurationTypeRepaViewModel model = new RestaurationTypeRepaViewModel(repas, ModeAcces.Modification);
+            return View(model);
+        }
+
+        // POST: RestaurationTypeRepas/Edit/5
+        // Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour 
+        // plus de détails, voir  http://go.microsoft.com/fwlink/?LinkId=317598.
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Edit(RestaurationTypeRepa repas)
+        {
+            if (ModelState.IsValid)
+            {
+                RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
+                fact.update(ref repas);
+                return RedirectToAction("Index");
+            }
+            RestaurationTypeRepaViewModel model = new RestaurationTypeRepaViewModel(repas, ModeAcces.Modification);
+            return View(model);
+        }
+
+        // GET: RestaurationTypeRepas/Delete/5
+        public ActionResult Delete(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
+            RestaurationTypeRepa repas = fact.getById(id.Value);
+            if (repas == null)
+            {
+                return HttpNotFound();
+            }
+            RestaurationTypeRepaViewModel model = new RestaurationTypeRepaViewModel(repas);
+            return View(model);
+        }
+
+        // POST: RestaurationTypeRepas/Delete/5
+        [HttpPost, ActionName("Delete")]
+        [ValidateAntiForgeryToken]
+        public ActionResult DeleteConfirmed(int id)
+        {
+            RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
+            RestaurationTypeRepa repas = fact.getById(id);
+            fact.delete(ref repas);
+            return RedirectToAction("Index");
+        }
+
+        public ActionResult Up(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
+            RestaurationTypeRepa repas = fact.getById(id.Value);
+            fact.Up(ref repas);
+            return RedirectToAction("Index");
+        }
+
+        public ActionResult Down(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
+            RestaurationTypeRepa repas = fact.getById(id.Value);
+            fact.Down(ref repas);
+            return RedirectToAction("Index");
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                db.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+    }
+}

+ 143 - 0
CD67.FicheCollege.MVC/Controllers/RestaurationTypesController.cs

@@ -0,0 +1,143 @@
+using CD67.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+using CD67.FicheCollege.MVC.Models;
+using System.Net;
+using System.Web.Mvc;
+
+namespace CD67.FicheCollege.MVC.Controllers
+{
+    public class RestaurationTypesController : Controller
+    {
+        private Entities db = new Entities();
+
+        // GET: RestaurationTypes
+        public ActionResult Index()
+        {
+            RestaurationTypeFactory fact = new RestaurationTypeFactory(db);
+            RestaurationTypeIndexViewModel model = new RestaurationTypeIndexViewModel(fact.getAll());
+            return View(model);
+        }
+
+        // GET: RestaurationTypes/Create
+        public ActionResult Create()
+        {
+            RestaurationType type = new RestaurationType();
+
+            RestaurationTypeViewModel model = new RestaurationTypeViewModel(type, ModeAcces.Creation);
+            return View(model);
+        }
+
+        // POST: RestaurationTypes/Create
+        // Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour 
+        // plus de détails, voir  http://go.microsoft.com/fwlink/?LinkId=317598.
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Create(RestaurationType type)
+        {
+            if (ModelState.IsValid)
+            {
+                RestaurationTypeFactory fact = new RestaurationTypeFactory(db);
+                fact.add(ref type);
+                return RedirectToAction("Index");
+            }
+
+            RestaurationTypeViewModel model = new RestaurationTypeViewModel(type, ModeAcces.Creation);
+            return View(model);
+        }
+
+        // GET: RestaurationTypes/Edit/5
+        public ActionResult Edit(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            RestaurationTypeFactory fact = new RestaurationTypeFactory(db);
+            RestaurationType type = fact.getById(id.Value);
+            if (type == null)
+            {
+                return HttpNotFound();
+            }
+            RestaurationTypeViewModel model = new RestaurationTypeViewModel(type, ModeAcces.Modification);
+            return View(model);
+        }
+
+        // POST: RestaurationTypes/Edit/5
+        // Afin de déjouer les attaques par sur-validation, activez les propriétés spécifiques que vous voulez lier. Pour 
+        // plus de détails, voir  http://go.microsoft.com/fwlink/?LinkId=317598.
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Edit(RestaurationType type)
+        {
+            if (ModelState.IsValid)
+            {
+                RestaurationTypeFactory fact = new RestaurationTypeFactory(db);
+                fact.update(ref type);
+                return RedirectToAction("Index");
+            }
+            RestaurationTypeViewModel model = new RestaurationTypeViewModel(type, ModeAcces.Modification);
+            return View(model);
+        }
+
+        // GET: RestaurationTypes/Delete/5
+        public ActionResult Delete(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            RestaurationTypeFactory fact = new RestaurationTypeFactory(db);
+            RestaurationType type = fact.getById(id.Value);
+            if (type == null)
+            {
+                return HttpNotFound();
+            }
+            RestaurationTypeViewModel model = new RestaurationTypeViewModel(type);
+            return View(model);
+        }
+
+        // POST: RestaurationTypes/Delete/5
+        [HttpPost, ActionName("Delete")]
+        [ValidateAntiForgeryToken]
+        public ActionResult DeleteConfirmed(int id)
+        {
+            RestaurationTypeFactory fact = new RestaurationTypeFactory(db);
+            RestaurationType type = fact.getById(id);
+            fact.delete(ref type);
+            return RedirectToAction("Index");
+        }
+
+        public ActionResult Up(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            RestaurationTypeFactory fact = new RestaurationTypeFactory(db);
+            RestaurationType type = fact.getById(id.Value);
+            fact.Up(ref type);
+            return RedirectToAction("Index");
+        }
+
+        public ActionResult Down(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+            RestaurationTypeFactory fact = new RestaurationTypeFactory(db);
+            RestaurationType type = fact.getById(id.Value);
+            fact.Down(ref type);
+            return RedirectToAction("Index");
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                db.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+    }
+}

+ 14 - 0
CD67.FicheCollege.MVC/Models/CheckBoxListItem.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace CD67.FicheCollege.MVC.Models
+{
+    public class CheckBoxListItem
+    {
+        public string ID { get; set; }
+        public string Display { get; set; }
+        public bool IsChecked { get; set; }
+    }
+}

+ 4 - 0
CD67.FicheCollege.MVC/Models/CollegeViewModel.cs

@@ -11,6 +11,8 @@ namespace CD67.FicheCollege.MVC.Models
         public SelectList Sel_TypesCollege;
         public SelectList Sel_CodesPostaux;
         public SelectList Sel_Territoires;
+        public SelectList Sel_TypesRestauration;
+
 
         public CollegeViewModel(College model, Entities dbContext, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
         {
@@ -21,6 +23,8 @@ namespace CD67.FicheCollege.MVC.Models
                 TerritoireFactory fact_t = new TerritoireFactory(dbContext);
                 Sel_Territoires = new SelectList(fact_t.getAll(), "Id", "Libelle", Obj.Territoire_Id);
                 Sel_CodesPostaux = new SelectList(Referentiel.GetCodesPostaux(Obj.Commune_Insee), Obj.Code_Postal);
+                RestaurationTypeFactory type = new RestaurationTypeFactory(dbContext);
+                Sel_TypesRestauration = new SelectList(type.getAllValid(), "Id", "Libelle", Obj.RestaurationType_Id);
             }
         }
 

+ 19 - 0
CD67.FicheCollege.MVC/Models/RestaurationParametreViewModel.cs

@@ -0,0 +1,19 @@
+using CD67.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+using CD67.FicheCollege.MVC.Internal;
+using System.Collections.Generic;
+using System.Web.Mvc;
+
+namespace CD67.FicheCollege.MVC.Models
+{
+    public class RestaurationParametreViewModel : BaseViewModel<RestaurationParametre>
+    {
+
+        public RestaurationParametreViewModel(RestaurationParametre model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
+        {
+        }
+
+        public override int Annee_Id { get { return Obj.Annee.Id; } }
+        public override string Annee_Lib { get { return Obj.Annee.Libelle; } }
+    }
+}

+ 29 - 0
CD67.FicheCollege.MVC/Models/RestaurationTypeRepaViewModel.cs

@@ -0,0 +1,29 @@
+using CD67.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+using CD67.FicheCollege.MVC.Internal;
+using System.Collections.Generic;
+using System.Web.Mvc;
+
+namespace CD67.FicheCollege.MVC.Models
+{
+    public class RestaurationTypeRepaViewModel : BaseViewModel<RestaurationTypeRepa>
+    {
+        public RestaurationTypeRepaViewModel(RestaurationTypeRepa model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
+        {
+        }
+
+        public override int Annee_Id { get { return 0; } }
+        public override string Annee_Lib { get { return ""; } }
+    }
+
+    public class RestaurationTypeRepaIndexViewModel : BaseViewModel<IEnumerable<RestaurationTypeRepa>>
+    {
+        public RestaurationTypeRepaIndexViewModel(IEnumerable<RestaurationTypeRepa> model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
+        {
+        }
+
+        public override int Annee_Id { get { return 0; } }
+        public override string Annee_Lib { get { return ""; } }
+
+    }
+}

+ 29 - 0
CD67.FicheCollege.MVC/Models/RestaurationTypeViewModel.cs

@@ -0,0 +1,29 @@
+using CD67.FicheCollege.Entity;
+using CD67.FicheCollege.Factory;
+using CD67.FicheCollege.MVC.Internal;
+using System.Collections.Generic;
+using System.Web.Mvc;
+
+namespace CD67.FicheCollege.MVC.Models
+{
+    public class RestaurationTypeViewModel : BaseViewModel<RestaurationType>
+    {
+        public RestaurationTypeViewModel(RestaurationType model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
+        {
+        }
+
+        public override int Annee_Id { get { return 0; } }
+        public override string Annee_Lib { get { return ""; } }
+    }
+
+    public class RestaurationTypeIndexViewModel : BaseViewModel<IEnumerable<RestaurationType>>
+    {
+        public RestaurationTypeIndexViewModel(IEnumerable<RestaurationType> model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
+        {
+        }
+
+        public override int Annee_Id { get { return 0; } }
+        public override string Annee_Lib { get { return ""; } }
+
+    }
+}

+ 6 - 0
CD67.FicheCollege.MVC/Mvc.sitemap

@@ -30,6 +30,12 @@
         <mvcSiteMapNode title="Edition d'un territoire" controller="Territoire" action="Edit" preservedRouteParameters="id" />
         <mvcSiteMapNode title="Suppression d'un territoire" controller="Territoire" action="Delete" preservedRouteParameters="id" />
       </mvcSiteMapNode>
+
+      <mvcSiteMapNode title="Types de restauration" controller="RestaurationType" action="Index">
+        <mvcSiteMapNode title="Création d'un type de restauration" controller="RestaurationType" action="Create" />
+        <mvcSiteMapNode title="Edition d'un type de restauration" controller="RestaurationType" action="Edit" preservedRouteParameters="id" />
+        <mvcSiteMapNode title="Suppression d'un type de restauration" controller="RestaurationType" action="Delete" preservedRouteParameters="id" />
+      </mvcSiteMapNode>
     </mvcSiteMapNode>
   </mvcSiteMapNode>
 </mvcSiteMap>

+ 264 - 264
CD67.FicheCollege.MVC/Views/Colleges/Edit.cshtml

@@ -11,11 +11,11 @@
 <header>
     @if (Model.Acces == ModeAcces.Modification)
     {
-        <h2>@college.Libelle</h2>
+    <h2>@college.Libelle</h2>
     }
     else
     {
-        <h2>Nouveau collège</h2>
+    <h2>Nouveau collège</h2>
     }
 </header>
 
@@ -23,325 +23,325 @@
 {
     @Html.AntiForgeryToken()
 
-    <fieldset>
+<fieldset>
 
-        <legend>
-            Informations générales - @Model.Acces.ToString()
-        </legend>
+    <legend>
+        Informations générales - @Model.Acces.ToString()
+    </legend>
 
-        <div class="form-horizontal">
-            @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+    <div class="form-horizontal">
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
 
-            @if (Model.Acces == ModeAcces.Modification)
-            {
-                @Html.HiddenFor(model => college.Id)
-            }
-            @Html.HiddenFor(model => college.Annee_Id)
-            @Html.HiddenFor(model => college.TokenId)
+        @if (Model.Acces == ModeAcces.Modification)
+        {
+        @Html.HiddenFor(model => college.Id)
+        }
+        @Html.HiddenFor(model => college.Annee_Id)
+        @Html.HiddenFor(model => college.TokenId)
+        @Html.HiddenFor(model => college.RestaurationType_Id)
 
-            <div class="form-group">
-                @Html.LabelFor(model => college.CodeRne, htmlAttributes: new { @class = "control-label col-md-2" })
-                <div class="col-md-10">
-                    @Html.EditorFor(model => college.CodeRne, new { htmlAttributes = new { @class = "form-control" } })
-                    @Html.ValidationMessageFor(model => college.CodeRne, "", new { @class = "text-danger" })
-                </div>
+        <div class="form-group">
+            @Html.LabelFor(model => college.CodeRne, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => college.CodeRne, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => college.CodeRne, "", new { @class = "text-danger" })
             </div>
+        </div>
 
-            <div class="form-group">
-                @Html.LabelFor(model => college.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
-                <div class="col-md-10">
-                    @Html.EditorFor(model => college.Libelle, new { htmlAttributes = new { @class = "form-control" } })
-                    @Html.ValidationMessageFor(model => college.Libelle, "", new { @class = "text-danger" })
-                </div>
+        <div class="form-group">
+            @Html.LabelFor(model => college.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => college.Libelle, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => college.Libelle, "", new { @class = "text-danger" })
             </div>
+        </div>
 
-            <div class="form-group">
-                @Html.LabelFor(model => college.TypeCollege_Id, htmlAttributes: new { @class = "control-label col-md-2" })
-                <div class="col-md-10">
-                    @Html.DropDownListFor(model => college.TypeCollege_Id, Model.Sel_TypesCollege, htmlAttributes: new { @class = "form-control" })
-                    @Html.ValidationMessageFor(model => college.TypeCollege_Id, "", new { @class = "text-danger" })
-                </div>
+        <div class="form-group">
+            @Html.LabelFor(model => college.TypeCollege_Id, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.DropDownListFor(model => college.TypeCollege_Id, Model.Sel_TypesCollege, htmlAttributes: new { @class = "form-control" })
+                @Html.ValidationMessageFor(model => college.TypeCollege_Id, "", new { @class = "text-danger" })
             </div>
+        </div>
 
-            <div class="form-group">
-                @Html.LabelFor(model => college.Adresse, htmlAttributes: new { @class = "control-label col-md-2" })
-                <div class="col-md-10">
-                    @Html.EditorFor(model => college.Adresse, new { htmlAttributes = new { @class = "form-control" } })
-                    @Html.ValidationMessageFor(model => college.Adresse, "", new { @class = "text-danger" })
-                </div>
+        <div class="form-group">
+            @Html.LabelFor(model => college.Adresse, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => college.Adresse, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => college.Adresse, "", new { @class = "text-danger" })
             </div>
+        </div>
 
-            <div class="form-group">
-                @Html.LabelFor(model => college.Territoire_Id, htmlAttributes: new { @class = "control-label col-md-2" })
-                <div class="col-md-10">
-                    @Html.DropDownListFor(model => college.Territoire_Id, Model.Sel_Territoires, htmlAttributes: new { @class = "form-control" })
-                    @Html.ValidationMessageFor(model => college.Territoire_Id, "", new { @class = "text-danger" })
-                </div>
+        <div class="form-group">
+            @Html.LabelFor(model => college.Territoire_Id, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.DropDownListFor(model => college.Territoire_Id, Model.Sel_Territoires, htmlAttributes: new { @class = "form-control" })
+                @Html.ValidationMessageFor(model => college.Territoire_Id, "", new { @class = "text-danger" })
             </div>
+        </div>
 
-            @Html.HiddenFor(model => college.Commune_Insee, new { data_picker = "commune.insee" })
-            @Html.TextBoxFor(model => college.Commune, new { data_picker = "commune.nom", @class = "special_hidden" }) @*On est obligé d'utiliser cette méthode bizzare pour cacher le champ, sinon pas de validation coté user (pas de validation des données sur les champs cachés)*@ 
-            @Html.HiddenFor(model => college.Canton, new { data_picker = "commune.canton" })
-            @Html.HiddenFor(model => college.Territoire_Id, new { data_picker = "commune.code_tad" })
-            @Html.HiddenFor(model => college.TAD, new { data_picker = "commune.tad" })
-            @Html.HiddenFor(model => college.CDC, new { data_picker = "commune.cdc" })
-
-            <div class="form-group">
-                @Html.LabelFor(model => college.Commune, htmlAttributes: new { @class = "control-label col-md-2 required" })
-                <div class="col-md-4">
-                    <a class='modal-window-events' href="http://referentiel.bas-rhin.fr/picker/cd67/com67/" title="Selection commune (nouvelle fenetre)">Sélectionner une commune</a>
-                    <br />
-                    <div class="panel panel-default" id="Commune_Panel" name="Commune_Panel" style="@if (college.Commune_Insee == null) { <text>display: none;</text> }">
-                        <div class="panel-heading clearfix">
-                            <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
-                                <i class="fa fa-map-marker color1" aria-hidden="true"></i>
-                                Localisation (commune)
-                            </h4>
-                            <div class="pull-right">
-                                <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="commune"></span>
-                            </div>
-                        </div>
-                        <div class="panel-body" style="text-align: center;">
-                            <span>
-                                <b><span data-picker="commune.nom">@college.Commune</span ></b >
-                                <br />Canton : <span data-picker="commune.canton">@college.Canton</span >
-                                <br />TAD : <span data-picker="commune.tad">@college.TAD</span >
-                                <br />CDC : <span data-picker="commune.cdc">@college.CDC</span >
-                            </span>
+        @Html.HiddenFor(model => college.Commune_Insee, new { data_picker = "commune.insee" })
+        @Html.TextBoxFor(model => college.Commune, new { data_picker = "commune.nom", @class = "special_hidden" }) @*On est obligé d'utiliser cette méthode bizzare pour cacher le champ, sinon pas de validation coté user (pas de validation des données sur les champs cachés)*@
+        @Html.HiddenFor(model => college.Canton, new { data_picker = "commune.canton" })
+        @Html.HiddenFor(model => college.Territoire_Id, new { data_picker = "commune.code_tad" })
+        @Html.HiddenFor(model => college.TAD, new { data_picker = "commune.tad" })
+        @Html.HiddenFor(model => college.CDC, new { data_picker = "commune.cdc" })
+
+        <div class="form-group">
+            @Html.LabelFor(model => college.Commune, htmlAttributes: new { @class = "control-label col-md-2 required" })
+            <div class="col-md-4">
+                <a class='modal-window-events' href="http://referentiel.bas-rhin.fr/picker/cd67/com67/" title="Selection commune (nouvelle fenetre)">Sélectionner une commune</a>
+                <br />
+                <div class="panel panel-default" id="Commune_Panel" name="Commune_Panel" style="@if (college.Commune_Insee == null) { <text>display: none;</text> }">
+                    <div class="panel-heading clearfix">
+                        <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
+                            <i class="fa fa-map-marker color1" aria-hidden="true"></i>
+                            Localisation (commune)
+                        </h4>
+                        <div class="pull-right">
+                            <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="commune"></span>
                         </div>
                     </div>
-                    @Html.ValidationMessageFor(model => college.Commune, "", new { @class = "text-danger" })
+                    <div class="panel-body" style="text-align: center;">
+                        <span>
+                            <b><span data-picker="commune.nom">@college.Commune</span></b>
+                            <br />Canton : <span data-picker="commune.canton">@college.Canton</span>
+                            <br />TAD : <span data-picker="commune.tad">@college.TAD</span>
+                            <br />CDC : <span data-picker="commune.cdc">@college.CDC</span>
+                        </span>
+                    </div>
                 </div>
+                @Html.ValidationMessageFor(model => college.Commune, "", new { @class = "text-danger" })
             </div>
+        </div>
 
-            <div class="form-group">
-                @Html.LabelFor(model => college.Code_Postal, htmlAttributes: new { @class = "control-label col-md-2" })
-                <div class="col-md-10">
-                    Code(s) postal(aux) associé(s) à la commune 
-                    @if (Model.Sel_CodesPostaux.Count() > 1) {
-                        <span id="CP-warning" class="text-danger">(attention, plusieurs choix possibles)</span>
-                    }
-                     : <input id="code_postaux" data-picker="commune.code_postal" value="@String.Join(",", Model.Sel_CodesPostaux.Select(i => i.Text))" class="disabled-input-as-label" />
-                    <br />
-                    @Html.DropDownListFor(model => college.Code_Postal, Model.Sel_CodesPostaux, htmlAttributes: new { @class = "form-control" })
-                    @Html.ValidationMessageFor(model => college.Code_Postal, "", new { @class = "text-danger" })
-                </div>
+        <div class="form-group">
+            @Html.LabelFor(model => college.Code_Postal, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                Code(s) postal(aux) associé(s) à la commune
+                @if (Model.Sel_CodesPostaux.Count() > 1)
+                {
+                <span id="CP-warning" class="text-danger">(attention, plusieurs choix possibles)</span>
+                }
+                : <input id="code_postaux" data-picker="commune.code_postal" value="@String.Join(" ,", Model.Sel_CodesPostaux.Select(i=> i.Text))" class="disabled-input-as-label" />
+                <br />
+                @Html.DropDownListFor(model => college.Code_Postal, Model.Sel_CodesPostaux, htmlAttributes: new { @class = "form-control" })
+                @Html.ValidationMessageFor(model => college.Code_Postal, "", new { @class = "text-danger" })
             </div>
+        </div>
 
-            <div class="form-group">
-                @Html.LabelFor(model => college.Tel, htmlAttributes: new { @class = "control-label col-md-2" })
-                <div class="col-md-10">
-                    @Html.EditorFor(model => college.Tel, new { htmlAttributes = new { @class = "form-control" } })
-                    @Html.ValidationMessageFor(model => college.Tel, "", new { @class = "text-danger" })
-                </div>
+        <div class="form-group">
+            @Html.LabelFor(model => college.Tel, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => college.Tel, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => college.Tel, "", new { @class = "text-danger" })
             </div>
+        </div>
 
-            <div class="form-group">
-                @Html.LabelFor(model => college.Fax, htmlAttributes: new { @class = "control-label col-md-2" })
-                <div class="col-md-10">
-                    @Html.EditorFor(model => college.Fax, new { htmlAttributes = new { @class = "form-control" } })
-                    @Html.ValidationMessageFor(model => college.Fax, "", new { @class = "text-danger" })
-                </div>
+        <div class="form-group">
+            @Html.LabelFor(model => college.Fax, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => college.Fax, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => college.Fax, "", new { @class = "text-danger" })
             </div>
+        </div>
 
-            <div class="form-group">
-                @Html.LabelFor(model => college.Email, htmlAttributes: new { @class = "control-label col-md-2" })
-                <div class="col-md-10">
-                    @Html.EditorFor(model => college.Email, new { htmlAttributes = new { @class = "form-control" } })
-                    @Html.ValidationMessageFor(model => college.Email, "", new { @class = "text-danger" })
-                </div>
+        <div class="form-group">
+            @Html.LabelFor(model => college.Email, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => college.Email, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => college.Email, "", new { @class = "text-danger" })
             </div>
-
         </div>
 
-        <legend>
-            Personnel
-        </legend>
-        <div class="form-horizontal">
-
-            <div class="form-group">
-
-                <div class="col-md-offset-2 col-md-4" data-picker-type="principal">
-                    @Html.HiddenFor(model => college.PrincipalSid, new { data_picker = "agent.id" })
-                    <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/externes/?type=principal&query=organisation:%22Principaux%20de%20coll%C3%A8ges%22" title="Selection du principal (nouvelle fenetre)">Sélectionner un principal</a>
-                    <br />
-                    <div class="panel panel-default" id="Principal_Panel" name="Principal_Panel" style="@if (college.PrincipalSid == null) { <text>display: none;</text> }">
-                        <div class="panel-heading clearfix">
-                            <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
-                                <i class="fa fa-user color1" aria-hidden="true"></i>
-                                @Html.LabelFor(model => college.PrincipalSid)
-                            </h4>
-                            <div class="pull-right">
-                                <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="principal"></span>
-                            </div>
-                        </div>
-                        <div class="panel-body" style="text-align: center;">
-                            <b><span data-picker="agent.prenom">@Html.DisplayFor(model => college.principal.Prenom)</span> <span data-picker="agent.nom">@Html.DisplayFor(model => college.principal.Nom)</span></b><br />
-                            <span data-picker="agent.chemin">@Html.DisplayFor(model => college.principal.Organisation)</span><br />
-                            <span data-picker="agent.mail">@Html.DisplayFor(model => college.principal.Mail)</span><br />
-                            <span data-picker="agent.telephone">@Html.DisplayFor(model => college.principal.Telephone)</span>
+    </div>
+
+    <legend>
+        Personnel
+    </legend>
+    <div class="form-horizontal">
+
+        <div class="form-group">
+
+            <div class="col-md-offset-2 col-md-4" data-picker-type="principal">
+                @Html.HiddenFor(model => college.PrincipalSid, new { data_picker = "agent.id" })
+                <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/externes/?type=principal&query=organisation:%22Principaux%20de%20coll%C3%A8ges%22" title="Selection du principal (nouvelle fenetre)">Sélectionner un principal</a>
+                <br />
+                <div class="panel panel-default" id="Principal_Panel" name="Principal_Panel" style="@if (college.PrincipalSid == null) { <text>display: none;</text> }">
+                    <div class="panel-heading clearfix">
+                        <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
+                            <i class="fa fa-user color1" aria-hidden="true"></i>
+                            @Html.LabelFor(model => college.PrincipalSid)
+                        </h4>
+                        <div class="pull-right">
+                            <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="principal"></span>
                         </div>
                     </div>
+                    <div class="panel-body" style="text-align: center;">
+                        <b><span data-picker="agent.prenom">@Html.DisplayFor(model => college.principal.Prenom)</span> <span data-picker="agent.nom">@Html.DisplayFor(model => college.principal.Nom)</span></b><br />
+                        <span data-picker="agent.chemin">@Html.DisplayFor(model => college.principal.Organisation)</span><br />
+                        <span data-picker="agent.mail">@Html.DisplayFor(model => college.principal.Mail)</span><br />
+                        <span data-picker="agent.telephone">@Html.DisplayFor(model => college.principal.Telephone)</span>
+                    </div>
                 </div>
+            </div>
 
-                <div class="col-md-4" data-picker-type="adjoint">
-                    @Html.HiddenFor(model => college.AdjointSid, new { data_picker = "agent.id" })
-                    <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/externes/?type=adjoint&query=organisation:%22Principaux%20de%20coll%C3%A8ges%22" title="Selection du principal adjoint (nouvelle fenetre)">Sélectionner un principal adjoint</a>
-                    <br />
-                    <div class="panel panel-default" id="Adjoint_Panel" name="Adjoint_Panel" style="@if (college.AdjointSid == null) { <text>display: none;</text> }">
-                        <div class="panel-heading clearfix">
-                            <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
-                                <i class="fa fa-user color1" aria-hidden="true"></i>
-                                @Html.LabelFor(model => college.AdjointSid)
-                            </h4>
-                            <div class="pull-right">
-                                <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="adjoint"></span>
-                            </div>
-                        </div>
-                        <div class="panel-body" style="text-align: center;">
-                            <b><span data-picker="agent.prenom">@Html.DisplayFor(model => college.adjoint.Prenom)</span> <span data-picker="agent.nom">@Html.DisplayFor(model => college.adjoint.Nom)</span></b><br />
-                            <span data-picker="agent.chemin">@Html.DisplayFor(model => college.adjoint.Organisation)</span><br />
-                            <span data-picker="agent.mail">@Html.DisplayFor(model => college.adjoint.Mail)</span><br />
-                            <span data-picker="agent.telephone">@Html.DisplayFor(model => college.adjoint.Telephone)</span>
+            <div class="col-md-4" data-picker-type="adjoint">
+                @Html.HiddenFor(model => college.AdjointSid, new { data_picker = "agent.id" })
+                <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/externes/?type=adjoint&query=organisation:%22Principaux%20de%20coll%C3%A8ges%22" title="Selection du principal adjoint (nouvelle fenetre)">Sélectionner un principal adjoint</a>
+                <br />
+                <div class="panel panel-default" id="Adjoint_Panel" name="Adjoint_Panel" style="@if (college.AdjointSid == null) { <text>display: none;</text> }">
+                    <div class="panel-heading clearfix">
+                        <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
+                            <i class="fa fa-user color1" aria-hidden="true"></i>
+                            @Html.LabelFor(model => college.AdjointSid)
+                        </h4>
+                        <div class="pull-right">
+                            <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="adjoint"></span>
                         </div>
                     </div>
+                    <div class="panel-body" style="text-align: center;">
+                        <b><span data-picker="agent.prenom">@Html.DisplayFor(model => college.adjoint.Prenom)</span> <span data-picker="agent.nom">@Html.DisplayFor(model => college.adjoint.Nom)</span></b><br />
+                        <span data-picker="agent.chemin">@Html.DisplayFor(model => college.adjoint.Organisation)</span><br />
+                        <span data-picker="agent.mail">@Html.DisplayFor(model => college.adjoint.Mail)</span><br />
+                        <span data-picker="agent.telephone">@Html.DisplayFor(model => college.adjoint.Telephone)</span>
+                    </div>
                 </div>
             </div>
+        </div>
 
 
-            <div class="form-group">
-                <div class="col-md-offset-2 col-md-4" data-picker-type="gestionnaire">
-                    @Html.HiddenFor(model => college.Gestionnaire1Sid, new { data_picker = "agent.id" })
-                    <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/ad67/?type=gestionnaire" title="Selection du gestionnaire (nouvelle fenetre)">Sélectionner un gestionnaire</a>
-                    <br />
-                    <div class="panel panel-default" id="Gestionnaire_Panel" name="Gestionnaire_Panel" style="@if (college.Gestionnaire1Sid == null) { <text>display: none;</text> }">
-                        <div class="panel-heading clearfix">
-                            <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
-                                <i class="fa fa-user color1" aria-hidden="true"></i>
-                                @Html.LabelFor(model => college.Gestionnaire1Sid)
-                            </h4>
-                            <div class="pull-right">
-                                <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="gestionnaire"></span>
-                            </div>
-                        </div>
-                        <div class="panel-body" style="text-align: center;">
-                            <b><span data-picker="agent.prenom">@Html.DisplayFor(model => college.gestionnaire1.Prenom)</span> <span data-picker="agent.nom">@Html.DisplayFor(model => college.gestionnaire1.Nom)</span></b><br />
-                            <span data-picker="agent.chemin">@Html.DisplayFor(model => college.gestionnaire1.Organisation)</span><br />
-                            <span data-picker="agent.mail">@Html.DisplayFor(model => college.gestionnaire1.Mail)</span><br />
-                            <span data-picker="agent.telephone">@Html.DisplayFor(model => college.gestionnaire1.Telephone)</span>
+        <div class="form-group">
+            <div class="col-md-offset-2 col-md-4" data-picker-type="gestionnaire">
+                @Html.HiddenFor(model => college.Gestionnaire1Sid, new { data_picker = "agent.id" })
+                <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/ad67/?type=gestionnaire" title="Selection du gestionnaire (nouvelle fenetre)">Sélectionner un gestionnaire</a>
+                <br />
+                <div class="panel panel-default" id="Gestionnaire_Panel" name="Gestionnaire_Panel" style="@if (college.Gestionnaire1Sid == null) { <text>display: none;</text> }">
+                    <div class="panel-heading clearfix">
+                        <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
+                            <i class="fa fa-user color1" aria-hidden="true"></i>
+                            @Html.LabelFor(model => college.Gestionnaire1Sid)
+                        </h4>
+                        <div class="pull-right">
+                            <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="gestionnaire"></span>
                         </div>
                     </div>
+                    <div class="panel-body" style="text-align: center;">
+                        <b><span data-picker="agent.prenom">@Html.DisplayFor(model => college.gestionnaire1.Prenom)</span> <span data-picker="agent.nom">@Html.DisplayFor(model => college.gestionnaire1.Nom)</span></b><br />
+                        <span data-picker="agent.chemin">@Html.DisplayFor(model => college.gestionnaire1.Organisation)</span><br />
+                        <span data-picker="agent.mail">@Html.DisplayFor(model => college.gestionnaire1.Mail)</span><br />
+                        <span data-picker="agent.telephone">@Html.DisplayFor(model => college.gestionnaire1.Telephone)</span>
+                    </div>
                 </div>
+            </div>
 
-                <div class="col-md-4" data-picker-type="gestionnaire2">
-                    @Html.HiddenFor(model => college.Gestionnaire2Sid, new { data_picker = "agent.id" })
-                    <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/ad67/?type=gestionnaire2" title="Selection du gestionnaire n°2 (nouvelle fenetre)">Sélectionner un gestionnaire</a>
-                    <br />
-                    <div class="panel panel-default" id="Gestionnaire2_Panel" name="Gestionnaire2_Panel" style="@if (college.Gestionnaire2Sid == null) { <text>display: none;</text> }">
-                        <div class="panel-heading clearfix">
-                            <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
-                                <i class="fa fa-user color1" aria-hidden="true"></i>
-                                @Html.LabelFor(model => college.Gestionnaire2Sid)
-                            </h4>
-                            <div class="pull-right">
-                                <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="gestionnaire2"></span>
-                            </div>
-                        </div>
-                        <div class="panel-body" style="text-align: center;">
-                            <b><span data-picker="agent.prenom">@Html.DisplayFor(model => college.gestionnaire2.Prenom)</span> <span data-picker="agent.nom">@Html.DisplayFor(model => college.gestionnaire2.Nom)</span></b><br />
-                            <span data-picker="agent.chemin">@Html.DisplayFor(model => college.gestionnaire2.Organisation)</span><br />
-                            <span data-picker="agent.mail">@Html.DisplayFor(model => college.gestionnaire2.Mail)</span><br />
-                            <span data-picker="agent.telephone">@Html.DisplayFor(model => college.gestionnaire2.Telephone)</span>
+            <div class="col-md-4" data-picker-type="gestionnaire2">
+                @Html.HiddenFor(model => college.Gestionnaire2Sid, new { data_picker = "agent.id" })
+                <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/ad67/?type=gestionnaire2" title="Selection du gestionnaire n°2 (nouvelle fenetre)">Sélectionner un gestionnaire</a>
+                <br />
+                <div class="panel panel-default" id="Gestionnaire2_Panel" name="Gestionnaire2_Panel" style="@if (college.Gestionnaire2Sid == null) { <text>display: none;</text> }">
+                    <div class="panel-heading clearfix">
+                        <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
+                            <i class="fa fa-user color1" aria-hidden="true"></i>
+                            @Html.LabelFor(model => college.Gestionnaire2Sid)
+                        </h4>
+                        <div class="pull-right">
+                            <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="gestionnaire2"></span>
                         </div>
                     </div>
+                    <div class="panel-body" style="text-align: center;">
+                        <b><span data-picker="agent.prenom">@Html.DisplayFor(model => college.gestionnaire2.Prenom)</span> <span data-picker="agent.nom">@Html.DisplayFor(model => college.gestionnaire2.Nom)</span></b><br />
+                        <span data-picker="agent.chemin">@Html.DisplayFor(model => college.gestionnaire2.Organisation)</span><br />
+                        <span data-picker="agent.mail">@Html.DisplayFor(model => college.gestionnaire2.Mail)</span><br />
+                        <span data-picker="agent.telephone">@Html.DisplayFor(model => college.gestionnaire2.Telephone)</span>
+                    </div>
                 </div>
             </div>
         </div>
+    </div>
 
-        <br/>
+    <br />
 
-        <div class="form-group">
-            <span style="margin-right:20px;">
-                <input type="submit" value="Enregistrer" class="btn btn-default" />
-            </span>
-            <span>
-                @if (Model.Acces == ModeAcces.Creation)
-                { @Html.ActionLink("Annuler", "Index", new { annee_id = college.Annee_Id }) }
-                else
-                { @Html.ActionLink("Annuler", "Details", new { Id = college.Id }) }
-            </span>
-        </div>
+    <div class="form-group">
+        <span style="margin-right:20px;">
+            <input type="submit" value="Enregistrer" class="btn btn-default" />
+        </span>
+        <span>
+            @if (Model.Acces == ModeAcces.Creation)
+            { @Html.ActionLink("Annuler", "Index", new { annee_id = college.Annee_Id }) }
+            else
+            { @Html.ActionLink("Annuler", "Details", new { Id = college.Id }) }
+        </span>
+    </div>
 
-    </fieldset>
+</fieldset>
 
 }
 
 @section Scripts {
-    <script type="text/javascript">
-        $(".removeItem").click(function () {
-            switch ($(this).data("type")) {
-                case 'commune':
-                    $('#contenu_Code_Postal').val(null);
-                    $('#contenu_Commune_Insee').val(null);
-                    $('#contenu_Commune').val(null);
-                    $('#contenu_Canton').val(null);
-                    $('#contenu_Territoire_Id').val(null);
-                    $('#contenu_TAD').val(null);
-                    $('#contenu_CDC').val(null);
-                    $('#Commune_Panel').hide();
-
-                    //suppression du champ en dessous
-                    $('#code_postaux').val(null);
-                    $('#contenu_Code_Postal').empty();
-                    $('#CP-warning').hide();
-                    break;
-                case 'principal':
-                    $('#college_PrincipalSid').val(null);
-                    $('#Principal_Panel').hide();
-                    break;
-                case 'adjoint':
-                    $('#college_AdjointSid').val(null);
-                    $('#Adjoint_Panel').hide();
-                    break;
-                case 'gestionnaire':
-                    $('#college_Gestionnaire1Sid').val(null);
-                    $('#Gestionnaire_Panel').hide();
-                    break;
-                case 'gestionnaire2':
-                    $('#college_Gestionnaire2Sid').val(null);
-                    $('#Gestionnaire2_Panel').hide();
-                    break;
-                default:
-                    return false;
-            }
-        });
-
-        // Function à implémenter pour éviter une erreur
-        function onModalOpen()
-        {
-            $('#CP-warning').hide();
+<script type="text/javascript">
+    $(".removeItem").click(function () {
+        switch ($(this).data("type")) {
+            case 'commune':
+                $('#contenu_Code_Postal').val(null);
+                $('#contenu_Commune_Insee').val(null);
+                $('#contenu_Commune').val(null);
+                $('#contenu_Canton').val(null);
+                $('#contenu_Territoire_Id').val(null);
+                $('#contenu_TAD').val(null);
+                $('#contenu_CDC').val(null);
+                $('#Commune_Panel').hide();
+
+                //suppression du champ en dessous
+                $('#code_postaux').val(null);
+                $('#contenu_Code_Postal').empty();
+                $('#CP-warning').hide();
+                break;
+            case 'principal':
+                $('#college_PrincipalSid').val(null);
+                $('#Principal_Panel').hide();
+                break;
+            case 'adjoint':
+                $('#college_AdjointSid').val(null);
+                $('#Adjoint_Panel').hide();
+                break;
+            case 'gestionnaire':
+                $('#college_Gestionnaire1Sid').val(null);
+                $('#Gestionnaire_Panel').hide();
+                break;
+            case 'gestionnaire2':
+                $('#college_Gestionnaire2Sid').val(null);
+                $('#Gestionnaire2_Panel').hide();
+                break;
+            default:
+                return false;
         }
+    });
 
-        function onModalClose()
-        {
-            var code_postaux = $('#code_postaux').val();
-            if (code_postaux != '') {
-                //On vide la liste actuelle
-                $('#college_Code_Postal').empty();
-
-                var liste = code_postaux.split(',');
-                liste.forEach(function (element) {
-                    //On ajoute les choix
-                    $('#college_Code_Postal').append($('<option>', {
-                        value: element,
-                        text: element
-                    }));
-                });
-
-                if (liste.length > 1) $('#CP-warning').show();
-            }
+    // Function à implémenter pour éviter une erreur
+    function onModalOpen() {
+        $('#CP-warning').hide();
+    }
+
+    function onModalClose() {
+        var code_postaux = $('#code_postaux').val();
+        if (code_postaux != '') {
+            //On vide la liste actuelle
+            $('#college_Code_Postal').empty();
+
+            var liste = code_postaux.split(',');
+            liste.forEach(function (element) {
+                //On ajoute les choix
+                $('#college_Code_Postal').append($('<option>', {
+                    value: element,
+                    text: element
+                }));
+            });
+
+            if (liste.length > 1) $('#CP-warning').show();
         }
-    </script>
+    }
+</script>
 
     @Scripts.Render("~/bundles/jqueryval")
 }

+ 79 - 0
CD67.FicheCollege.MVC/Views/Colleges/Type.cshtml

@@ -0,0 +1,79 @@
+@using CD67.FicheCollege.MVC.Models
+@model CollegeViewModel
+
+@{
+    ViewBag.Title = Model.Acces.ToString();
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    College college = Model.Obj;
+}
+
+<header>
+    <h2>Type de restauration pour un collège</h2>
+</header>
+
+@using (Html.BeginForm())
+{
+    @Html.AntiForgeryToken()
+
+<div class="form-horizontal">
+    <h4>Type de restauration</h4>
+    <hr />
+    @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+    @Html.HiddenFor(model => college.Id)
+    @Html.HiddenFor(model => college.Annee_Id)
+    @Html.HiddenFor(model => college.CodeRne)
+    @Html.HiddenFor(model => college.Libelle)
+    @Html.HiddenFor(model => college.TokenId)
+    @Html.HiddenFor(model => college.Adresse)
+    @Html.HiddenFor(model => college.Code_Postal)
+    @Html.HiddenFor(model => college.TypeCollege_Id)
+    @Html.HiddenFor(model => college.Commune_Insee)
+    @Html.HiddenFor(model => college.Commune)
+    @Html.HiddenFor(model => college.Canton)
+    @Html.HiddenFor(model => college.Territoire_Id)
+    @Html.HiddenFor(model => college.TAD)
+    @Html.HiddenFor(model => college.CDC)
+    @Html.HiddenFor(model => college.Tel)
+    @Html.HiddenFor(model => college.Fax)
+    @Html.HiddenFor(model => college.Email)
+    @Html.HiddenFor(model => college.PrincipalSid)
+    @Html.HiddenFor(model => college.AdjointSid)
+    @Html.HiddenFor(model => college.Gestionnaire1Sid)
+    @Html.HiddenFor(model => college.Gestionnaire2Sid)
+
+    <div class="form-group">
+        @Html.LabelFor(model => college.CodeRne, htmlAttributes: new { @class = "control-label col-md-2" })
+        <div class="col-md-10">
+            @Html.DisplayFor(model => college.CodeRne, new { htmlAttributes = new { @class = "form-control" } })
+        </div>
+    </div>
+
+    <div class="form-group">
+        @Html.LabelFor(model => college.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
+        <div class="col-md-10">
+            @Html.DisplayFor(model => college.Libelle, new { htmlAttributes = new { @class = "form-control" } })
+        </div>
+    </div>
+
+    <div class="form-group">
+        @Html.LabelFor(model => college.RestaurationType_Id, htmlAttributes: new { @class = "control-label col-md-2" })
+        <div class="col-md-10">
+            @Html.DropDownListFor(model => college.RestaurationType_Id, Model.Sel_TypesRestauration, htmlAttributes: new { @class = "form-control" })
+            @Html.ValidationMessageFor(model => college.RestaurationType_Id, "", new { @class = "text-danger" })
+        </div>
+    </div>
+
+    <div class="form-group">
+        <span style="margin-right:20px;">
+            <input type="submit" value="Enregistrer" class="btn btn-default" />
+        </span>
+        <a href="@Url.Action("Index", "Restauration", new { annee_id = college.Annee_Id })">
+            <span title="Annuler" style="vertical-align: middle" aria-hidden="true">Annuler</span>
+        </a>
+    </div>
+</div>
+    }
+
+    @section Scripts {
+
+    }

+ 79 - 0
CD67.FicheCollege.MVC/Views/Restauration/Index.cshtml

@@ -0,0 +1,79 @@
+@using CD67.FicheCollege.MVC.Models
+@model AnneeViewModel
+
+<title>Restauration @Model.Annee_Lib</title>
+
+@{
+    ViewBag.Title = "Restauration " + @Model.Annee_Lib;
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    College college_model = new College();
+    bool ouverture = ViewBag.Ouverture;
+}
+
+<header>
+    <h2>La restauration</h2>
+    <span>
+        <a class="start-trace" href="@Url.Action("Edit", "RestaurationParametres", new { annee_id = Model.Annee_Id })"> <span class="glyphicon glyphicon-cog color1"></span> Paramètres</a>
+        <a class="start-trace" href="@Url.Action("Index", "RestaurationTypeRepas")"> <span class="glyphicon glyphicon-cog color1"></span> Repas</a>
+        <a class="start-trace" href="@Url.Action("Index", "RestaurationTypes")"> <span class="glyphicon glyphicon-cog color1"></span> Types</a>
+    </span>
+</header>
+
+
+@if (ouverture == true)
+{
+    <h4>Ouverture de la campagne de saisie <a href="@Url.Action("EditCampagne", "RestaurationParametres", new { annee_id = Model.Annee_Id, edit = false })">  <span class="fa fa-toggle-on color1"></span> </a></h4><br />
+}
+else
+{
+    <h4>Ouverture de la campagne de saisie <a href = "@Url.Action("EditCampagne", "RestaurationParametres", new { annee_id = Model.Annee_Id, edit = true })" >  <span class="fa fa-toggle-off color1"></span> </a></h4><br />
+}
+<table id="table-actions" class="datatable table">
+    <thead>
+        <tr>
+            <th>
+                @Html.DisplayNameFor(model => college_model.CodeRne)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => college_model.Libelle)
+            </th>
+            <th>
+                Adresse complète
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => college_model.RestaurationType_Id)
+            </th>
+            <th>
+                Actions
+            </th>
+        </tr>
+    </thead>
+    <tbody>
+        @foreach (College college in Model.Obj.Colleges)
+        {
+        <tr data-url="@Url.Action("Details", new { id = college.Id })">
+
+                <td>
+                    @Html.DisplayFor(modelcollege => college.CodeRne)
+                </td>
+                <td>
+                    @Html.DisplayFor(modelcollege => college.Libelle)
+                    <noscript>
+                        @Html.ActionLink(" > Voir", "Details", new { id = college.Id })
+                    </noscript>
+                </td>
+                <td>
+                    @Html.DisplayFor(modelcollege => college.AdresseComplete)
+                </td>
+                <td>
+                    @Html.DisplayFor(modelcollege => college.RestaurationType.Libelle)<br />
+                </td>
+                <td>
+                    <a href="@Url.Action("Type", "Colleges", new { id = college.Id })">
+                        <span class="glyphicon glyphicon-pencil fa-2x color1" title="Modifier" style="vertical-align: middle" aria-hidden="true"></span>
+                    </a>
+                </td>
+        </tr>
+        }
+    </tbody>
+</table>

+ 98 - 0
CD67.FicheCollege.MVC/Views/RestaurationParametres/Edit.cshtml

@@ -0,0 +1,98 @@
+@using CD67.FicheCollege.MVC.Models
+@model RestaurationParametreViewModel
+
+@{
+    ViewBag.Title = "Modification " + Model.Annee_Lib;
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    RestaurationParametre param = Model.Obj;
+    List<CheckBoxListItem> repasCBList = ViewBag.repasCBList;
+}
+
+<header>
+    @if (Model.Acces == ModeAcces.Modification)
+    {
+        <h2>Modification</h2>
+    }
+    else
+    {
+        <h2>Création</h2>
+    }
+</header>
+
+@using (Html.BeginForm())
+{
+    @Html.AntiForgeryToken()
+    
+<div class="form-horizontal">
+    <h4>Paramètres</h4>
+    <hr />
+    @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+    @if (Model.Acces == ModeAcces.Modification)
+    {
+        @Html.HiddenFor(model => param.Id)
+    }
+    @Html.HiddenFor(model => param.Annee_Id)
+    @Html.HiddenFor(model => param.Campagne)
+
+    <div class="form-group">
+        @Html.LabelFor(model => param.Prix_Mini, htmlAttributes: new { @class = "control-label col-md-2" })
+        <div class="col-md-10">
+            @Html.EditorFor(model => param.Prix_Mini, new { htmlAttributes = new { @class = "form-control" } })
+            @Html.ValidationMessageFor(model => param.Prix_Mini, "", new { @class = "text-danger" })
+        </div>
+    </div>
+
+    <div class="form-group">
+        @Html.LabelFor(model => param.Prix_ATC, htmlAttributes: new { @class = "control-label col-md-2" })
+        <div class="col-md-10">
+            @Html.EditorFor(model => param.Prix_ATC, new { htmlAttributes = new { @class = "form-control" } })
+            @Html.ValidationMessageFor(model => param.Prix_ATC, "", new { @class = "text-danger" })
+        </div>
+    </div>
+
+    <div class="form-group">
+        @Html.LabelFor(model => param.Prix_AgentC, htmlAttributes: new { @class = "control-label col-md-2" })
+        <div class="col-md-10">
+            @Html.EditorFor(model => param.Prix_AgentC, new { htmlAttributes = new { @class = "form-control" } })
+            @Html.ValidationMessageFor(model => param.Prix_AgentC, "", new { @class = "text-danger" })
+        </div>
+    </div>
+
+    <div class="form-group">
+        @Html.LabelFor(model => param.Prix_MiniAutres, htmlAttributes: new { @class = "control-label col-md-2" })
+        <div class="col-md-10">
+            @Html.EditorFor(model => param.Prix_MiniAutres, new { htmlAttributes = new { @class = "form-control" } })
+            @Html.ValidationMessageFor(model => param.Prix_MiniAutres, "", new { @class = "text-danger" })
+        </div>
+    </div>
+
+    <div class="form-group">
+        @Html.Label("Types de repas", htmlAttributes: new { @class = "control-label col-md-2" })
+        <div class="col-md-10">
+            @for (int i = 0; i < repasCBList.Count; i++)
+            {
+                @Html.HiddenFor(x => repasCBList[i].ID)
+                @Html.CheckBoxFor(x => repasCBList[i].IsChecked)
+                <text> </text>
+                @repasCBList[i].Display
+                @Html.HiddenFor(x => repasCBList[i].Display)
+                <br />
+            }
+        </div>
+    </div>
+
+    <div class="form-group">
+        <div class="col-md-offset-2 col-md-10">
+            <input type="submit" value="Enregistrer" class="btn btn-default" /> &nbsp;&nbsp;
+            <a href="@Url.Action("Index", "Restauration", new { annee_id = param.Annee_Id })">
+                <span title="Annuler" style="vertical-align: middle" aria-hidden="true">Annuler</span>
+            </a>
+        </div>
+    </div>
+
+</div>
+}
+
+@section Scripts {
+
+}

+ 52 - 0
CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Create.cshtml

@@ -0,0 +1,52 @@
+@using CD67.FicheCollege.MVC.Models
+@model RestaurationTypeRepaViewModel
+
+@{
+    ViewBag.Title = "Création";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
+    RestaurationTypeRepa repas = Model.Obj;
+}
+
+
+@using (Html.BeginForm()) 
+{
+    @Html.AntiForgeryToken()
+    
+    <div class="form-horizontal">
+        <h4>Types de restauration</h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+        @Html.HiddenFor(model => repas.Id)
+        @Html.HiddenFor(model => repas.Ordre)
+
+        <div class="form-group">
+            @Html.LabelFor(model => repas.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => repas.Libelle, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => repas.Libelle, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => repas.Valid, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => repas.Valid, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => repas.Valid, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            <div class="col-md-offset-2 col-md-10">
+                <input type="submit" value="Créer" class="btn btn-default" />
+            </div>
+        </div>
+    </div>
+}
+
+<div>
+    @Html.ActionLink("Retour à la liste", "Index")
+</div>
+
+@section Scripts {
+
+}

+ 42 - 0
CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Delete.cshtml

@@ -0,0 +1,42 @@
+@using CD67.FicheCollege.MVC.Models
+@model RestaurationTypeRepaViewModel
+
+@{
+    ViewBag.Title = "Suppression";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
+    RestaurationTypeRepa repas = Model.Obj;
+}
+
+<h2>Suppression</h2>
+
+<h3>Voulez-vous vraiment supprimer cet élément?</h3>
+<div>
+    <h4>Type de repas</h4>
+    <hr />
+    <dl class="dl-horizontal">
+        <dt>
+            @Html.DisplayNameFor(model => repas.Libelle)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => repas.Libelle)
+        </dd>
+        <dt>
+            @Html.DisplayNameFor(model => repas.Valid)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => repas.Valid)
+        </dd>
+
+    </dl>
+
+    @using (Html.BeginForm()) {
+        @Html.AntiForgeryToken()
+
+        <div class="form-actions no-color">
+            <input type="submit" value="Supprimer" class="btn btn-default" /> |
+            @Html.ActionLink("Retour à la liste", "Index")
+        </div>
+    }
+</div>

+ 54 - 0
CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Edit.cshtml

@@ -0,0 +1,54 @@
+@using CD67.FicheCollege.MVC.Models
+@model RestaurationTypeRepaViewModel
+
+@{
+    ViewBag.Title = "Modification";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
+    RestaurationTypeRepa repas = Model.Obj;
+}
+
+<h2>Modification</h2>
+
+
+@using (Html.BeginForm())
+{
+    @Html.AntiForgeryToken()
+    
+    <div class="form-horizontal">
+        <h4>Type de repas</h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+        @Html.HiddenFor(model => repas.Id)
+        @Html.HiddenFor(model => repas.Ordre)
+
+        <div class="form-group">
+            @Html.LabelFor(model => repas.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => repas.Libelle, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => repas.Libelle, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => repas.Valid, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => repas.Valid, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => repas.Valid, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            <div class="col-md-offset-2 col-md-10">
+                <input type="submit" value="Enregistrer" class="btn btn-default" />
+            </div>
+        </div>
+    </div>
+}
+
+<div>
+    @Html.ActionLink("Retour à la liste", "Index")
+</div>
+
+@section Scripts {
+
+}

+ 77 - 0
CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Index.cshtml

@@ -0,0 +1,77 @@
+@using CD67.FicheCollege.MVC.Models
+@model RestaurationTypeRepaIndexViewModel
+
+@{
+    ViewBag.Title = "Liste";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
+    int maxOrdre = Model.Obj.Count() == 0 ? 0 : Model.Obj.Max(i => i.Ordre);
+    int row = 1;
+}
+
+<h2>Liste</h2>
+
+<p>
+    <a href="@Url.Action("Create")">
+        <span class="glyphicon glyphicon-plus-sign fa-2x color1" style="vertical-align: middle" aria-hidden="true"></span>
+        Créer un nouvel élément
+    </a>
+</p>
+
+<table class="table">
+    <tr>
+        <th>
+            @Html.DisplayNameFor(model => model.Obj.First().Libelle)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.Obj.First().Valid)
+        </th>
+        <th></th>
+    </tr>
+
+    @foreach (var item in Model.Obj.OrderBy(i => i.Ordre))
+    {
+        <tr>
+            <td>
+                @Html.DisplayFor(modelItem => item.Libelle)
+            </td>
+        
+            <td>
+                @Html.DisplayFor(modelItem => item.Valid)
+            </td>
+
+            <td>
+                @if (row != 1)
+                {
+                    <a href="@Url.Action("Up", new { id = item.Id })">
+                        <span class="glyphicon glyphicon-circle-arrow-up fa-2x color1" title="Remonter" style="vertical-align: middle" aria-hidden="true"></span>
+                    </a>
+                }
+                else
+                {
+                    <span class="glyphicon glyphicon-circle-arrow-up fa-2x color2" title="Remonter" style="vertical-align: middle" aria-hidden="true"></span>
+                }
+                @if (item.Ordre != maxOrdre)
+                {
+                    <a href="@Url.Action("Down", new { id = item.Id })">
+                        <span class="glyphicon glyphicon-circle-arrow-down fa-2x color1" title="Descendre" style="vertical-align: middle" aria-hidden="true"></span>
+                    </a>
+                }
+                else
+                {
+                    <span class="glyphicon glyphicon-circle-arrow-down fa-2x color2" title="Descendre" style="vertical-align: middle" aria-hidden="true"></span>
+                }
+                <a href="@Url.Action("Edit", new { id = item.Id })">
+                    <span class="glyphicon glyphicon-edit fa-2x color1" title="Modifier" style="vertical-align: middle" aria-hidden="true"></span>
+                </a>
+                @if (@item.RestaurationParametres.Count() == 0)
+                {
+                    <a href="@Url.Action("Delete", new { id = item.Id })">
+                        <span class="glyphicon glyphicon-remove-sign fa-2x color1" title="Supprimer" style="vertical-align: middle" aria-hidden="true"></span>
+                    </a>
+                }
+                </td>
+        </tr>
+        row += 1;
+    }
+
+</table>

+ 52 - 0
CD67.FicheCollege.MVC/Views/RestaurationTypes/Create.cshtml

@@ -0,0 +1,52 @@
+@using CD67.FicheCollege.MVC.Models
+@model RestaurationTypeViewModel
+
+@{
+    ViewBag.Title = "Création";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
+    RestaurationType type = Model.Obj;
+}
+
+
+@using (Html.BeginForm()) 
+{
+    @Html.AntiForgeryToken()
+    
+    <div class="form-horizontal">
+        <h4>Types de restauration</h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+        @Html.HiddenFor(model => type.Id)
+        @Html.HiddenFor(model => type.Ordre)
+
+        <div class="form-group">
+            @Html.LabelFor(model => type.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => type.Libelle, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => type.Libelle, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => type.Valid, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => type.Valid, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => type.Valid, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            <div class="col-md-offset-2 col-md-10">
+                <input type="submit" value="Créer" class="btn btn-default" />
+            </div>
+        </div>
+    </div>
+}
+
+<div>
+    @Html.ActionLink("Retour à la liste", "Index")
+</div>
+
+@section Scripts {
+
+}

+ 42 - 0
CD67.FicheCollege.MVC/Views/RestaurationTypes/Delete.cshtml

@@ -0,0 +1,42 @@
+@using CD67.FicheCollege.MVC.Models
+@model RestaurationTypeViewModel
+
+@{
+    ViewBag.Title = "Suppression";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
+    RestaurationType type = Model.Obj;
+}
+
+<h2>Suppression</h2>
+
+<h3>Voulez-vous vraiment supprimer cet élément?</h3>
+<div>
+    <h4>Type de restauration</h4>
+    <hr />
+    <dl class="dl-horizontal">
+        <dt>
+            @Html.DisplayNameFor(model => type.Libelle)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => type.Libelle)
+        </dd>
+        <dt>
+            @Html.DisplayNameFor(model => type.Valid)
+        </dt>
+
+        <dd>
+            @Html.DisplayFor(model => type.Valid)
+        </dd>
+
+    </dl>
+
+    @using (Html.BeginForm()) {
+        @Html.AntiForgeryToken()
+
+        <div class="form-actions no-color">
+            <input type="submit" value="Supprimer" class="btn btn-default" /> |
+            @Html.ActionLink("Retour à la liste", "Index")
+        </div>
+    }
+</div>

+ 54 - 0
CD67.FicheCollege.MVC/Views/RestaurationTypes/Edit.cshtml

@@ -0,0 +1,54 @@
+@using CD67.FicheCollege.MVC.Models
+@model RestaurationTypeViewModel
+
+@{
+    ViewBag.Title = "Modification";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
+    RestaurationType type = Model.Obj;
+}
+
+<h2>Modification</h2>
+
+
+@using (Html.BeginForm())
+{
+    @Html.AntiForgeryToken()
+    
+    <div class="form-horizontal">
+        <h4>Type de restauration</h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+        @Html.HiddenFor(model => type.Id)
+        @Html.HiddenFor(model => type.Ordre)
+
+        <div class="form-group">
+            @Html.LabelFor(model => type.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => type.Libelle, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => type.Libelle, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => type.Valid, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => type.Valid, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => type.Valid, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            <div class="col-md-offset-2 col-md-10">
+                <input type="submit" value="Enregistrer" class="btn btn-default" />
+            </div>
+        </div>
+    </div>
+}
+
+<div>
+    @Html.ActionLink("Retour à la liste", "Index")
+</div>
+
+@section Scripts {
+
+}

+ 77 - 0
CD67.FicheCollege.MVC/Views/RestaurationTypes/Index.cshtml

@@ -0,0 +1,77 @@
+@using CD67.FicheCollege.MVC.Models
+@model RestaurationTypeIndexViewModel
+
+@{
+    ViewBag.Title = "Liste";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
+    int maxOrdre = Model.Obj.Count() == 0 ? 0 : Model.Obj.Max(i => i.Ordre);
+    int row = 1;
+}
+
+<h2>Liste</h2>
+
+<p>
+    <a href="@Url.Action("Create")">
+        <span class="glyphicon glyphicon-plus-sign fa-2x color1" style="vertical-align: middle" aria-hidden="true"></span>
+        Créer un nouvel élément
+    </a>
+</p>
+
+<table class="table">
+    <tr>
+        <th>
+            @Html.DisplayNameFor(model => model.Obj.First().Libelle)
+        </th>
+        <th>
+            @Html.DisplayNameFor(model => model.Obj.First().Valid)
+        </th>
+        <th></th>
+    </tr>
+
+    @foreach (var item in Model.Obj.OrderBy(i => i.Ordre))
+    {
+        <tr>
+            <td>
+                @Html.DisplayFor(modelItem => item.Libelle)
+            </td>
+        
+            <td>
+                @Html.DisplayFor(modelItem => item.Valid)
+            </td>
+
+            <td>
+                @if (row != 1)
+                {
+                    <a href="@Url.Action("Up", new { id = item.Id })">
+                        <span class="glyphicon glyphicon-circle-arrow-up fa-2x color1" title="Remonter" style="vertical-align: middle" aria-hidden="true"></span>
+                    </a>
+                }
+                else
+                {
+                    <span class="glyphicon glyphicon-circle-arrow-up fa-2x color2" title="Remonter" style="vertical-align: middle" aria-hidden="true"></span>
+                }
+                @if (item.Ordre != maxOrdre)
+                {
+                    <a href="@Url.Action("Down", new { id = item.Id })">
+                        <span class="glyphicon glyphicon-circle-arrow-down fa-2x color1" title="Descendre" style="vertical-align: middle" aria-hidden="true"></span>
+                    </a>
+                }
+                else
+                {
+                    <span class="glyphicon glyphicon-circle-arrow-down fa-2x color2" title="Descendre" style="vertical-align: middle" aria-hidden="true"></span>
+                }
+                <a href="@Url.Action("Edit", new { id = item.Id })">
+                    <span class="glyphicon glyphicon-edit fa-2x color1" title="Modifier" style="vertical-align: middle" aria-hidden="true"></span>
+                </a>
+                @if (@item.Colleges.Count() == 0)
+                {
+                    <a href="@Url.Action("Delete", new { id = item.Id })">
+                        <span class="glyphicon glyphicon-remove-sign fa-2x color1" title="Supprimer" style="vertical-align: middle" aria-hidden="true"></span>
+                    </a>
+                }
+                </td>
+        </tr>
+        row += 1;
+    }
+
+</table>

+ 7 - 0
CD67.FicheCollege.MVC/Views/Shared/_Layout.cshtml

@@ -133,6 +133,13 @@
                         </div>
                     </a>
                 </li>
+                <li>
+                    <a href="@Url.Action("Index", "Restauration", new { annee_id = Model.Annee_Id })">
+                        <div class="menu-1">
+                            <span class="fa fa-coffee title">Restauration</span>
+                        </div>
+                    </a>
+                </li>
             </ul>
         </sidebar>
     </header>

+ 10 - 0
CD67.FicheCollege.sln

@@ -15,6 +15,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Clients", "Clients", "{D610
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Metiers", "Metiers", "{EBD348FD-4C67-427E-B989-3B8FCA9D3E89}"
 EndProject
+Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "CD67.FicheCollege.BDD", "CD67.FicheCollege.BDD\CD67.FicheCollege.BDD.sqlproj", "{714893FB-6E06-433F-94D2-2CEAA355D4DC}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -37,14 +39,22 @@ Global
 		{DA01D22C-4381-4429-B131-84C06DCBA3E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{DA01D22C-4381-4429-B131-84C06DCBA3E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{DA01D22C-4381-4429-B131-84C06DCBA3E0}.Release|Any CPU.Build.0 = Release|Any CPU
+		{714893FB-6E06-433F-94D2-2CEAA355D4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{714893FB-6E06-433F-94D2-2CEAA355D4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{714893FB-6E06-433F-94D2-2CEAA355D4DC}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+		{714893FB-6E06-433F-94D2-2CEAA355D4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{714893FB-6E06-433F-94D2-2CEAA355D4DC}.Release|Any CPU.Build.0 = Release|Any CPU
+		{714893FB-6E06-433F-94D2-2CEAA355D4DC}.Release|Any CPU.Deploy.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(NestedProjects) = preSolution
+		{5BDB34B4-4387-4AF7-B388-37D4907DDE39} = {EBD348FD-4C67-427E-B989-3B8FCA9D3E89}
 		{6B7EF24A-1AF8-44FB-A290-E42F01FF8812} = {EBD348FD-4C67-427E-B989-3B8FCA9D3E89}
 		{578D7B80-A578-4971-A350-14C699502A47} = {D6104401-EE11-4BE3-BFE3-5AEBFC27770B}
 		{DA01D22C-4381-4429-B131-84C06DCBA3E0} = {D6104401-EE11-4BE3-BFE3-5AEBFC27770B}
+		{714893FB-6E06-433F-94D2-2CEAA355D4DC} = {EBD348FD-4C67-427E-B989-3B8FCA9D3E89}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {0B11FA2E-C6B1-42F2-B218-9FBD1A015119}