Forráskód Böngészése

NEW Ajout du formulaire (version 1) par collège dans la restauration #43

marjorie.sourdot 7 éve
szülő
commit
3347a03d3e
44 módosított fájl, 1995 hozzáadás és 245 törlés
  1. 3 1
      CD67.FicheCollege.BDD/CD67.FicheCollege.BDD.sqlproj
  2. 40 0
      CD67.FicheCollege.BDD/RestaurationFormulaires.sql
  3. 12 0
      CD67.FicheCollege.BDD/RestaurationFormulairesRepas.sql
  4. 1 1
      CD67.FicheCollege.BDD/RestaurationParametres.sql
  5. 3 3
      CD67.FicheCollege.BDD/RestaurationParametresRepas.sql
  6. 1 1
      CD67.FicheCollege.BDD/RestaurationTypesRepas.sql
  7. 11 2
      CD67.FicheCollege.Entity/CD67.FicheCollege.Entity.csproj
  8. 3 0
      CD67.FicheCollege.Entity/College.cs
  9. 53 0
      CD67.FicheCollege.Entity/Constants.cs
  10. 3 1
      CD67.FicheCollege.Entity/EntityModel.Context.cs
  11. 1 1
      CD67.FicheCollege.Entity/EntityModel.Designer.cs
  12. 290 41
      CD67.FicheCollege.Entity/EntityModel.edmx
  13. 4 0
      CD67.FicheCollege.Entity/EntityModel.edmx.diagram
  14. 94 0
      CD67.FicheCollege.Entity/Extend/RestaurationFormulaire.cs
  15. 45 0
      CD67.FicheCollege.Entity/Extend/RestaurationFormulairesRepa.cs
  16. 1 1
      CD67.FicheCollege.Entity/Extend/RestaurationParametre.cs
  17. 3 3
      CD67.FicheCollege.Entity/Extend/RestaurationTypesRepa.cs
  18. 59 0
      CD67.FicheCollege.Entity/RestaurationFormulaire.cs
  19. 27 0
      CD67.FicheCollege.Entity/RestaurationFormulairesRepa.cs
  20. 2 2
      CD67.FicheCollege.Entity/RestaurationParametre.cs
  21. 5 2
      CD67.FicheCollege.Entity/RestaurationTypesRepa.cs
  22. 10 2
      CD67.FicheCollege.Factory/CD67.FicheCollege.Factory.csproj
  23. 21 0
      CD67.FicheCollege.Factory/Internal/RestaurationFormulaireFactory.cs
  24. 21 0
      CD67.FicheCollege.Factory/Internal/RestaurationFormulairesRepaFactory.cs
  25. 2 2
      CD67.FicheCollege.Factory/Internal/RestaurationTypesRepaFactory.cs
  26. 47 0
      CD67.FicheCollege.Factory/RestaurationFormulaireFactory.cs
  27. 55 0
      CD67.FicheCollege.Factory/RestaurationFormulairesRepaFactory.cs
  28. 5 5
      CD67.FicheCollege.Factory/RestaurationParametreFactory.cs
  29. 0 81
      CD67.FicheCollege.Factory/RestaurationTypeRepaFactory.cs
  30. 81 0
      CD67.FicheCollege.Factory/RestaurationTypesRepaFactory.cs
  31. 9 4
      CD67.FicheCollege.MVC/CD67.FicheCollege.MVC.csproj
  32. 16 0
      CD67.FicheCollege.MVC/Content/cd67-custom.less
  33. 227 0
      CD67.FicheCollege.MVC/Controllers/RestaurationFormulairesController.cs
  34. 9 9
      CD67.FicheCollege.MVC/Controllers/RestaurationParametresController.cs
  35. 29 29
      CD67.FicheCollege.MVC/Controllers/RestaurationTypesRepasController.cs
  36. 19 0
      CD67.FicheCollege.MVC/Models/RestaurationFormulaireViewModel.cs
  37. 0 29
      CD67.FicheCollege.MVC/Models/RestaurationTypeRepaViewModel.cs
  38. 29 0
      CD67.FicheCollege.MVC/Models/RestaurationTypesRepaViewModel.cs
  39. 46 22
      CD67.FicheCollege.MVC/Views/Restauration/Index.cshtml
  40. 340 0
      CD67.FicheCollege.MVC/Views/RestaurationFormulaires/Details.cshtml
  41. 353 0
      CD67.FicheCollege.MVC/Views/RestaurationFormulaires/Edit.cshtml
  42. 2 2
      CD67.FicheCollege.MVC/Views/RestaurationTypesRepas/Edit.cshtml
  43. 1 1
      CD67.FicheCollege.MVC/Views/RestaurationTypesRepas/Index.cshtml
  44. 12 0
      CD67.FicheCollege.MVC/Views/Shared/DisplayTemplates/RestaurationStatut.cshtml

+ 3 - 1
CD67.FicheCollege.BDD/CD67.FicheCollege.BDD.sqlproj

@@ -73,7 +73,9 @@
     <Build Include="TypesCollege.sql" />
     <Build Include="RestaurationTypes.sql" />
     <Build Include="RestaurationParametres.sql" />
-    <Build Include="RestaurationTypeRepas.sql" />
+    <Build Include="RestaurationTypesRepas.sql" />
     <Build Include="RestaurationParametresRepas.sql" />
+    <Build Include="RestaurationFormulaires.sql" />
+    <Build Include="RestaurationFormulairesRepas.sql" />
   </ItemGroup>
 </Project>

+ 40 - 0
CD67.FicheCollege.BDD/RestaurationFormulaires.sql

@@ -0,0 +1,40 @@
+CREATE TABLE [dbo].[RestaurationFormulaires]
+(
+    [Id]						UNIQUEIDENTIFIER	NOT NULL,
+	[College_Id]				INT					NOT NULL,
+	[Statut]					NVARCHAR (50) 		NOT NULL,
+	[NbDP_College]				INT					NOT NULL,
+	[NbDP_Lycee]				INT					NULL,
+	[NbDP_MatPrimPeri]			INT					NULL,
+	[NbDP_Commensaux]			INT					NULL,
+	[NbDP_ATC]					INT					NULL,
+	[NbDP_AgentC]				INT					NULL,
+	[Prix_Forfait5j]			DECIMAL (18,2)		NULL,
+	[NbJours_Forfait5j]			INT					NULL,
+	[Prix_Forfait4j]			DECIMAL (18,2)		NULL,
+	[NbJours_Forfait4j]			INT					NULL,
+	[Prix_Forfait3j]			DECIMAL (18,2)		NULL,
+	[NbJours_Forfait3j]			INT					NULL,
+	[Prix_Forfait2j]			DECIMAL (18,2)		NULL,
+	[NbJours_Forfait2j]			INT					NULL,
+	[Prix_Forfait1j]			DECIMAL (18,2)		NULL,
+	[NbJours_Forfait1j]			INT					NULL,
+	[Prix_Ticket]				DECIMAL (18,2)		NOT NULL,
+	[Tarif_Pension]				DECIMAL (18,2)		NULL,
+	[Prix_ATC]					DECIMAL (18,2)		NOT NULL,
+	[Prix_AgentC]				DECIMAL (18,2)		NOT NULL,
+	[Prix_Commensaux]			DECIMAL (18,2)		NULL,
+	[Prix_EcolePeri]			DECIMAL (18,2)		NULL,
+	[NbEleves_FondSocial]		INT					NULL,
+	[Montant_FondSocial]		DECIMAL (18,2)		NULL,
+	[NbEleves_Impayes]			INT					NULL,
+	[Montant_Impayes]			DECIMAL (18,2)		NULL,
+	[Date_AvisCA]				DATETIME2 			NULL,
+	[Ind_Signature]				BIT					NOT NULL,
+	CONSTRAINT [PK_RestaurationFormulaires] PRIMARY KEY CLUSTERED ([Id] ASC),
+	CONSTRAINT [FK_RestaurationFormulairesColleges] FOREIGN KEY ([College_Id]) REFERENCES [dbo].[Colleges] ([Id])
+)
+
+GO
+CREATE NONCLUSTERED INDEX [IX_FK_RestaurationFormulairesCollege]
+    ON [dbo].[RestaurationFormulaires]([College_Id] ASC);

+ 12 - 0
CD67.FicheCollege.BDD/RestaurationFormulairesRepas.sql

@@ -0,0 +1,12 @@
+CREATE TABLE [dbo].[RestaurationFormulairesRepas]
+(
+    [Id]							INT					IDENTITY (1, 1) NOT NULL,
+	[RestaurationFormulaires_Id]	UNIQUEIDENTIFIER	NOT NULL,
+	[RestaurationTypesRepas_Id]		INT					NOT NULL,
+	[NbRepas]						INT					NULL,
+	[NbJours]						INT					NULL,
+	[NomEtablissement]				NVARCHAR(255)		NULL, 
+	CONSTRAINT [PK_RestaurationFormulairesRepas] PRIMARY KEY CLUSTERED ([Id] ASC),
+	CONSTRAINT [FK_RestaurationFormulairesRepasForm] FOREIGN KEY ([RestaurationFormulaires_Id]) REFERENCES [dbo].[RestaurationFormulaires] ([Id]),
+	CONSTRAINT [FK_RestaurationFormulairesTypesRepas] FOREIGN KEY ([RestaurationTypesRepas_Id]) REFERENCES [dbo].[RestaurationTypesRepas] ([Id]),
+)

+ 1 - 1
CD67.FicheCollege.BDD/RestaurationParametres.sql

@@ -12,5 +12,5 @@
 )
 
 GO
-CREATE NONCLUSTERED INDEX [IX_FK_AnneeCollege]
+CREATE NONCLUSTERED INDEX [IX_FK_RestaurationParametresAnneeCollege]
     ON [dbo].[RestaurationParametres]([Annee_Id] ASC);

+ 3 - 3
CD67.FicheCollege.BDD/RestaurationParametresRepas.sql

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

+ 1 - 1
CD67.FicheCollege.BDD/RestaurationTypeRepas.sql → CD67.FicheCollege.BDD/RestaurationTypesRepas.sql

@@ -1,4 +1,4 @@
-CREATE TABLE [dbo].[RestaurationTypeRepas]
+CREATE TABLE [dbo].[RestaurationTypesRepas]
 (
 	[Id] INT NOT NULL PRIMARY KEY IDENTITY, 
     [Libelle] NVARCHAR(255) NOT NULL, 

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

@@ -114,6 +114,7 @@
     <Compile Include="commune.cs">
       <DependentUpon>EducfModel.tt</DependentUpon>
     </Compile>
+    <Compile Include="Constants.cs" />
     <Compile Include="EducfModel.Context.cs">
       <AutoGen>True</AutoGen>
       <DesignTime>True</DesignTime>
@@ -163,8 +164,10 @@
     <Compile Include="Extend\Annee.cs" />
     <Compile Include="Extend\College.cs" />
     <Compile Include="Extend\ActionEduStatut.cs" />
+    <Compile Include="Extend\RestaurationFormulaire.cs" />
+    <Compile Include="Extend\RestaurationFormulairesRepa.cs" />
     <Compile Include="Extend\RestaurationParametre.cs" />
-    <Compile Include="Extend\RestaurationTypeRepa.cs" />
+    <Compile Include="Extend\RestaurationTypesRepa.cs" />
     <Compile Include="Extend\Territoire.cs" />
     <Compile Include="Extend\ActionEduAxe.cs" />
     <Compile Include="Extend\ActionEduThematique.cs" />
@@ -192,13 +195,19 @@
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
       <DependentUpon>Settings.settings</DependentUpon>
     </Compile>
+    <Compile Include="RestaurationFormulaire.cs">
+      <DependentUpon>EntityModel.tt</DependentUpon>
+    </Compile>
+    <Compile Include="RestaurationFormulairesRepa.cs">
+      <DependentUpon>EntityModel.tt</DependentUpon>
+    </Compile>
     <Compile Include="RestaurationParametre.cs">
       <DependentUpon>EntityModel.tt</DependentUpon>
     </Compile>
     <Compile Include="RestaurationType.cs">
       <DependentUpon>EntityModel.tt</DependentUpon>
     </Compile>
-    <Compile Include="RestaurationTypeRepa.cs">
+    <Compile Include="RestaurationTypesRepa.cs">
       <DependentUpon>EntityModel.tt</DependentUpon>
     </Compile>
     <Compile Include="rue.cs">

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

@@ -18,6 +18,7 @@ namespace CD67.FicheCollege.Entity
         public College()
         {
             this.ActionsEduColleges = new HashSet<ActionEduCollege>();
+            this.RestaurationFormulaires = new HashSet<RestaurationFormulaire>();
         }
     
         public int Id { get; set; }
@@ -49,5 +50,7 @@ namespace CD67.FicheCollege.Entity
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
         public virtual ICollection<ActionEduCollege> ActionsEduColleges { get; set; }
         public virtual RestaurationType RestaurationType { get; set; }
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<RestaurationFormulaire> RestaurationFormulaires { get; set; }
     }
 }

+ 53 - 0
CD67.FicheCollege.Entity/Constants.cs

@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+
+namespace CD67.FicheCollege.Entity
+{
+    public static class Constants
+    {
+        public enum Statut
+        {
+            [Display(Description = "A saisir")]
+            A_SAISIR,
+            [Display(Description = "En cours de saisie")]
+            EN_COURS_DE_SAISIE,
+            [Display(Description = "Proposé")]
+            PROPOSE,
+            [Display(Description = "Validé")]
+            VALIDE
+        }
+
+        /// <summary>
+        /// Fonction permettant de récupérer la valeur notée en description d'une énumération
+        /// </summary>
+        /// <param name="value">Elément d'une énumération</param>
+        /// <returns>Description associée à l'élément</returns>
+        public static string GetDescription(this Enum value)
+        {
+            Type type = value.GetType();
+            string name = Enum.GetName(type, value);
+            if (name != null)
+            {
+                FieldInfo field = type.GetField(name);
+                if (field != null)
+                {
+                    DescriptionAttribute attr =
+                           Attribute.GetCustomAttribute(field,
+                             typeof(DescriptionAttribute)) as DescriptionAttribute;
+                    if (attr != null)
+                    {
+                        return attr.Description;
+                    }
+                }
+            }
+            return null;
+        }
+    }
+}

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

@@ -38,7 +38,9 @@ namespace CD67.FicheCollege.Entity
         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; }
+        public virtual DbSet<RestaurationTypesRepa> RestaurationTypesRepas { get; set; }
+        public virtual DbSet<RestaurationFormulaire> RestaurationFormulaires { get; set; }
+        public virtual DbSet<RestaurationFormulairesRepa> RestaurationFormulairesRepas { 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.

+ 290 - 41
CD67.FicheCollege.Entity/EntityModel.edmx

@@ -65,7 +65,7 @@
             <PropertyRef Name="Id" />
           </Key>
           <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
-          <Property Name="Numero" Type="nvarchar(max)" Nullable="false" />
+          <Property Name="Numero" Type="nvarchar" MaxLength="10" Nullable="false" />
           <Property Name="Nom" Type="nvarchar(max)" Nullable="false" />
           <Property Name="Montant" Type="decimal" Precision="18" Scale="0" />
           <Property Name="Description" Type="nvarchar(max)" />
@@ -84,7 +84,7 @@
           </Key>
           <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
           <Property Name="Commentaire" Type="nvarchar(max)" />
-          <Property Name="NbEleves" Type="bigint" />
+          <Property Name="NbEleves" Type="int" />
           <Property Name="CollegeId" Type="int" Nullable="false" />
           <Property Name="ActionEduId" Type="int" Nullable="false" />
         </EntityType>
@@ -123,6 +123,53 @@
           <Property Name="TokenId" Type="uniqueidentifier" Nullable="false" />
           <Property Name="RestaurationType_Id" Type="int" />
         </EntityType>
+        <EntityType Name="RestaurationFormulaires">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="uniqueidentifier" Nullable="false" />
+          <Property Name="College_Id" Type="int" Nullable="false" />
+          <Property Name="Statut" Type="nvarchar" MaxLength="50" Nullable="false" />
+          <Property Name="NbDP_College" Type="int" Nullable="false" />
+          <Property Name="NbDP_Lycee" Type="int" />
+          <Property Name="NbDP_MatPrimPeri" Type="int" />
+          <Property Name="NbDP_Commensaux" Type="int" />
+          <Property Name="NbDP_ATC" Type="int" />
+          <Property Name="NbDP_AgentC" Type="int" />
+          <Property Name="Prix_Forfait5j" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="NbJours_Forfait5j" Type="int" />
+          <Property Name="Prix_Forfait4j" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="NbJours_Forfait4j" Type="int" />
+          <Property Name="Prix_Forfait3j" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="NbJours_Forfait3j" Type="int" />
+          <Property Name="Prix_Forfait2j" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="NbJours_Forfait2j" Type="int" />
+          <Property Name="Prix_Forfait1j" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="NbJours_Forfait1j" Type="int" />
+          <Property Name="Prix_Ticket" Type="decimal" Precision="18" Scale="2" Nullable="false" />
+          <Property Name="Tarif_Pension" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="Prix_ATC" Type="decimal" Precision="18" Scale="2" Nullable="false" />
+          <Property Name="Prix_AgentC" Type="decimal" Precision="18" Scale="2" Nullable="false" />
+          <Property Name="Prix_Commensaux" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="Prix_EcolePeri" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="NbEleves_FondSocial" Type="int" />
+          <Property Name="Montant_FondSocial" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="NbEleves_Impayes" Type="int" />
+          <Property Name="Montant_Impayes" Type="decimal" Precision="18" Scale="2" />
+          <Property Name="Date_AvisCA" Type="datetime2" Precision="7" />
+          <Property Name="Ind_Signature" Type="bit" Nullable="false" />
+        </EntityType>
+        <EntityType Name="RestaurationFormulairesRepas">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="RestaurationFormulaires_Id" Type="uniqueidentifier" Nullable="false" />
+          <Property Name="RestaurationTypesRepas_Id" Type="int" Nullable="false" />
+          <Property Name="NbRepas" Type="int" />
+          <Property Name="NbJours" Type="int" />
+          <Property Name="NomEtablissement" Type="nvarchar" MaxLength="255" />
+        </EntityType>
         <EntityType Name="RestaurationParametres">
           <Key>
             <PropertyRef Name="Id" />
@@ -138,12 +185,12 @@
         <EntityType Name="RestaurationParametresRepas">
           <Key>
             <PropertyRef Name="RestaurationParametres_Id" />
-            <PropertyRef Name="RestaurationTypeRepas_Id" />
+            <PropertyRef Name="RestaurationTypesRepas_Id" />
           </Key>
           <Property Name="RestaurationParametres_Id" Type="int" Nullable="false" />
-          <Property Name="RestaurationTypeRepas_Id" Type="int" Nullable="false" />
+          <Property Name="RestaurationTypesRepas_Id" Type="int" Nullable="false" />
         </EntityType>
-        <EntityType Name="RestaurationTypeRepas">
+        <EntityType Name="RestaurationTypes">
           <Key>
             <PropertyRef Name="Id" />
           </Key>
@@ -152,7 +199,7 @@
           <Property Name="Valid" Type="bit" Nullable="false" />
           <Property Name="Ordre" Type="int" Nullable="false" />
         </EntityType>
-        <EntityType Name="RestaurationTypes">
+        <EntityType Name="RestaurationTypesRepas">
           <Key>
             <PropertyRef Name="Id" />
           </Key>
@@ -339,6 +386,42 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
+        <Association Name="FK_RestaurationFormulairesColleges">
+          <End Role="Colleges" Type="Self.Colleges" Multiplicity="1" />
+          <End Role="RestaurationFormulaires" Type="Self.RestaurationFormulaires" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="Colleges">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="RestaurationFormulaires">
+              <PropertyRef Name="College_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_RestaurationFormulairesRepasForm">
+          <End Role="RestaurationFormulaires" Type="Self.RestaurationFormulaires" Multiplicity="1" />
+          <End Role="RestaurationFormulairesRepas" Type="Self.RestaurationFormulairesRepas" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="RestaurationFormulaires">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="RestaurationFormulairesRepas">
+              <PropertyRef Name="RestaurationFormulaires_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_RestaurationFormulairesTypesRepas">
+          <End Role="RestaurationTypesRepas" Type="Self.RestaurationTypesRepas" Multiplicity="1" />
+          <End Role="RestaurationFormulairesRepas" Type="Self.RestaurationFormulairesRepas" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="RestaurationTypesRepas">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="RestaurationFormulairesRepas">
+              <PropertyRef Name="RestaurationTypesRepas_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
         <Association Name="FK_RestaurationParametresAnnee">
           <End Role="Annees" Type="Self.Annees" Multiplicity="1" />
           <End Role="RestaurationParametres" Type="Self.RestaurationParametres" Multiplicity="*" />
@@ -364,14 +447,14 @@
           </ReferentialConstraint>
         </Association>
         <Association Name="FK_RestaurationParametresRepas_Repas">
-          <End Role="RestaurationTypeRepas" Type="Self.RestaurationTypeRepas" Multiplicity="1" />
+          <End Role="RestaurationTypesRepas" Type="Self.RestaurationTypesRepas" Multiplicity="1" />
           <End Role="RestaurationParametresRepas" Type="Self.RestaurationParametresRepas" Multiplicity="*" />
           <ReferentialConstraint>
-            <Principal Role="RestaurationTypeRepas">
+            <Principal Role="RestaurationTypesRepas">
               <PropertyRef Name="Id" />
             </Principal>
             <Dependent Role="RestaurationParametresRepas">
-              <PropertyRef Name="RestaurationTypeRepas_Id" />
+              <PropertyRef Name="RestaurationTypesRepas_Id" />
             </Dependent>
           </ReferentialConstraint>
         </Association>
@@ -386,10 +469,12 @@
           <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="RestaurationFormulaires" EntityType="Self.RestaurationFormulaires" Schema="dbo" store:Type="Tables" />
+          <EntitySet Name="RestaurationFormulairesRepas" EntityType="Self.RestaurationFormulairesRepas" 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="RestaurationTypesRepas" EntityType="Self.RestaurationTypesRepas" 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">
@@ -444,6 +529,18 @@
             <End Role="TypesCollege" EntitySet="TypesCollege" />
             <End Role="Colleges" EntitySet="Colleges" />
           </AssociationSet>
+          <AssociationSet Name="FK_RestaurationFormulairesColleges" Association="Self.FK_RestaurationFormulairesColleges">
+            <End Role="Colleges" EntitySet="Colleges" />
+            <End Role="RestaurationFormulaires" EntitySet="RestaurationFormulaires" />
+          </AssociationSet>
+          <AssociationSet Name="FK_RestaurationFormulairesRepasForm" Association="Self.FK_RestaurationFormulairesRepasForm">
+            <End Role="RestaurationFormulaires" EntitySet="RestaurationFormulaires" />
+            <End Role="RestaurationFormulairesRepas" EntitySet="RestaurationFormulairesRepas" />
+          </AssociationSet>
+          <AssociationSet Name="FK_RestaurationFormulairesTypesRepas" Association="Self.FK_RestaurationFormulairesTypesRepas">
+            <End Role="RestaurationTypesRepas" EntitySet="RestaurationTypesRepas" />
+            <End Role="RestaurationFormulairesRepas" EntitySet="RestaurationFormulairesRepas" />
+          </AssociationSet>
           <AssociationSet Name="FK_RestaurationParametresAnnee" Association="Self.FK_RestaurationParametresAnnee">
             <End Role="Annees" EntitySet="Annees" />
             <End Role="RestaurationParametres" EntitySet="RestaurationParametres" />
@@ -453,7 +550,7 @@
             <End Role="RestaurationParametresRepas" EntitySet="RestaurationParametresRepas" />
           </AssociationSet>
           <AssociationSet Name="FK_RestaurationParametresRepas_Repas" Association="Self.FK_RestaurationParametresRepas_Repas">
-            <End Role="RestaurationTypeRepas" EntitySet="RestaurationTypeRepas" />
+            <End Role="RestaurationTypesRepas" EntitySet="RestaurationTypesRepas" />
             <End Role="RestaurationParametresRepas" EntitySet="RestaurationParametresRepas" />
           </AssociationSet>
         </EntityContainer>
@@ -527,15 +624,29 @@
             <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">
+          <EntitySet Name="RestaurationTypesRepas" EntityType="CD67.FicheCollege.RestaurationTypesRepa" />
+          <AssociationSet Name="RestaurationParametresRepas1" Association="CD67.FicheCollege.RestaurationParametresRepas1">
             <End Role="RestaurationParametre" EntitySet="RestaurationParametres" />
-            <End Role="RestaurationTypeRepa" EntitySet="RestaurationTypeRepas" />
+            <End Role="RestaurationTypesRepa" EntitySet="RestaurationTypesRepas" />
+          </AssociationSet>
+          <EntitySet Name="RestaurationFormulaires" EntityType="CD67.FicheCollege.RestaurationFormulaire" />
+          <EntitySet Name="RestaurationFormulairesRepas" EntityType="CD67.FicheCollege.RestaurationFormulairesRepa" />
+          <AssociationSet Name="FK_RestaurationFormulairesColleges" Association="CD67.FicheCollege.FK_RestaurationFormulairesColleges">
+            <End Role="College" EntitySet="Colleges" />
+            <End Role="RestaurationFormulaire" EntitySet="RestaurationFormulaires" />
+          </AssociationSet>
+          <AssociationSet Name="FK_RestaurationFormulairesRepasForm" Association="CD67.FicheCollege.FK_RestaurationFormulairesRepasForm">
+            <End Role="RestaurationFormulaire" EntitySet="RestaurationFormulaires" />
+            <End Role="RestaurationFormulairesRepa" EntitySet="RestaurationFormulairesRepas" />
+          </AssociationSet>
+          <AssociationSet Name="FK_RestaurationFormulairesTypesRepas" Association="CD67.FicheCollege.FK_RestaurationFormulairesTypesRepas">
+            <End Role="RestaurationTypesRepa" EntitySet="RestaurationTypesRepas" />
+            <End Role="RestaurationFormulairesRepa" EntitySet="RestaurationFormulairesRepas" />
           </AssociationSet>
           </EntityContainer>
         <EntityType Name="TypeCollege">
@@ -593,6 +704,7 @@
           <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" />
+          <NavigationProperty Name="RestaurationFormulaires" Relationship="CD67.FicheCollege.FK_RestaurationFormulairesColleges" FromRole="College" ToRole="RestaurationFormulaire" />
         </EntityType>
         <Association Name="FK_Colleges_Territoires">
           <End Type="CD67.FicheCollege.Territoire" Role="Territoire" Multiplicity="0..1" />
@@ -668,7 +780,7 @@
             <PropertyRef Name="Id" />
           </Key>
           <Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
-          <Property Name="Numero" Type="String" Nullable="false" MaxLength="Max" Unicode="true" FixedLength="false" />
+          <Property Name="Numero" Type="String" Nullable="false" MaxLength="10" Unicode="true" FixedLength="false" />
           <Property Name="Nom" Type="String" Nullable="false" MaxLength="Max" Unicode="true" FixedLength="false" />
           <Property Name="Montant" Type="Decimal" Precision="18" Scale="0" Nullable="true" />
           <Property Name="Description" Type="String" Nullable="true" MaxLength="Max" Unicode="true" FixedLength="false" />
@@ -870,16 +982,6 @@
             </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" />
@@ -892,7 +994,7 @@
           <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" />
+          <NavigationProperty Name="RestaurationTypesRepas" Relationship="CD67.FicheCollege.RestaurationParametresRepas1" FromRole="RestaurationParametre" ToRole="RestaurationTypesRepa" />
         </EntityType>
         <Association Name="FK_RestaurationParametresAnnee">
           <End Type="CD67.FicheCollege.Annee" Role="Annee" Multiplicity="1" />
@@ -906,9 +1008,107 @@
             </Dependent>
           </ReferentialConstraint>
         </Association>
-        <Association Name="RestaurationParametresRepas">
+        <EntityType Name="RestaurationTypesRepa">
+          <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.RestaurationParametresRepas1" FromRole="RestaurationTypesRepa" ToRole="RestaurationParametre" />
+          <NavigationProperty Name="RestaurationFormulairesRepas" Relationship="CD67.FicheCollege.FK_RestaurationFormulairesTypesRepas" FromRole="RestaurationTypesRepa" ToRole="RestaurationFormulairesRepa" />
+        </EntityType>
+        <Association Name="RestaurationParametresRepas1">
           <End Type="CD67.FicheCollege.RestaurationParametre" Role="RestaurationParametre" Multiplicity="*" />
-          <End Type="CD67.FicheCollege.RestaurationTypeRepa" Role="RestaurationTypeRepa" Multiplicity="*" />
+          <End Type="CD67.FicheCollege.RestaurationTypesRepa" Role="RestaurationTypesRepa" Multiplicity="*" />
+        </Association>
+        <EntityType Name="RestaurationFormulaire">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="Guid" Nullable="false" />
+          <Property Name="College_Id" Type="Int32" Nullable="false" />
+          <Property Name="Statut" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" />
+          <Property Name="NbDP_College" Type="Int32" Nullable="false" />
+          <Property Name="NbDP_Lycee" Type="Int32" />
+          <Property Name="NbDP_MatPrimPeri" Type="Int32" />
+          <Property Name="NbDP_Commensaux" Type="Int32" />
+          <Property Name="NbDP_ATC" Type="Int32" />
+          <Property Name="NbDP_AgentC" Type="Int32" />
+          <Property Name="Prix_Forfait5j" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="NbJours_Forfait5j" Type="Int32" />
+          <Property Name="Prix_Forfait4j" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="NbJours_Forfait4j" Type="Int32" />
+          <Property Name="Prix_Forfait3j" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="NbJours_Forfait3j" Type="Int32" />
+          <Property Name="Prix_Forfait2j" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="NbJours_Forfait2j" Type="Int32" />
+          <Property Name="Prix_Forfait1j" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="NbJours_Forfait1j" Type="Int32" />
+          <Property Name="Prix_Ticket" Type="Decimal" Nullable="false" Precision="18" Scale="2" />
+          <Property Name="Tarif_Pension" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="Prix_ATC" Type="Decimal" Nullable="false" Precision="18" Scale="2" />
+          <Property Name="Prix_AgentC" Type="Decimal" Nullable="false" Precision="18" Scale="2" />
+          <Property Name="Prix_Commensaux" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="Prix_EcolePeri" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="NbEleves_FondSocial" Type="Int32" />
+          <Property Name="Montant_FondSocial" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="NbEleves_Impayes" Type="Int32" />
+          <Property Name="Montant_Impayes" Type="Decimal" Precision="18" Scale="2" />
+          <Property Name="Date_AvisCA" Type="DateTime" Precision="7" />
+          <Property Name="Ind_Signature" Type="Boolean" Nullable="false" />
+          <NavigationProperty Name="College" Relationship="CD67.FicheCollege.FK_RestaurationFormulairesColleges" FromRole="RestaurationFormulaire" ToRole="College" />
+          <NavigationProperty Name="RestaurationFormulairesRepas" Relationship="CD67.FicheCollege.FK_RestaurationFormulairesRepasForm" FromRole="RestaurationFormulaire" ToRole="RestaurationFormulairesRepa" />
+        </EntityType>
+        <EntityType Name="RestaurationFormulairesRepa">
+          <Key>
+            <PropertyRef Name="Id" />
+          </Key>
+          <Property Name="Id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
+          <Property Name="RestaurationFormulaires_Id" Type="Guid" Nullable="false" />
+          <Property Name="RestaurationTypesRepas_Id" Type="Int32" Nullable="false" />
+          <Property Name="NbRepas" Type="Int32" />
+          <Property Name="NbJours" Type="Int32" />
+          <Property Name="NomEtablissement" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
+          <NavigationProperty Name="RestaurationFormulaire" Relationship="CD67.FicheCollege.FK_RestaurationFormulairesRepasForm" FromRole="RestaurationFormulairesRepa" ToRole="RestaurationFormulaire" />
+          <NavigationProperty Name="RestaurationTypesRepa" Relationship="CD67.FicheCollege.FK_RestaurationFormulairesTypesRepas" FromRole="RestaurationFormulairesRepa" ToRole="RestaurationTypesRepa" />
+        </EntityType>
+        <Association Name="FK_RestaurationFormulairesColleges">
+          <End Type="CD67.FicheCollege.College" Role="College" Multiplicity="1" />
+          <End Type="CD67.FicheCollege.RestaurationFormulaire" Role="RestaurationFormulaire" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="College">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="RestaurationFormulaire">
+              <PropertyRef Name="College_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_RestaurationFormulairesRepasForm">
+          <End Type="CD67.FicheCollege.RestaurationFormulaire" Role="RestaurationFormulaire" Multiplicity="1" />
+          <End Type="CD67.FicheCollege.RestaurationFormulairesRepa" Role="RestaurationFormulairesRepa" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="RestaurationFormulaire">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="RestaurationFormulairesRepa">
+              <PropertyRef Name="RestaurationFormulaires_Id" />
+            </Dependent>
+          </ReferentialConstraint>
+        </Association>
+        <Association Name="FK_RestaurationFormulairesTypesRepas">
+          <End Type="CD67.FicheCollege.RestaurationTypesRepa" Role="RestaurationTypesRepa" Multiplicity="1" />
+          <End Type="CD67.FicheCollege.RestaurationFormulairesRepa" Role="RestaurationFormulairesRepa" Multiplicity="*" />
+          <ReferentialConstraint>
+            <Principal Role="RestaurationTypesRepa">
+              <PropertyRef Name="Id" />
+            </Principal>
+            <Dependent Role="RestaurationFormulairesRepa">
+              <PropertyRef Name="RestaurationTypesRepas_Id" />
+            </Dependent>
+          </ReferentialConstraint>
         </Association>
         </Schema>
     </edmx:ConceptualModels>
@@ -1078,16 +1278,6 @@
               </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">
@@ -1101,14 +1291,73 @@
               </MappingFragment>
             </EntityTypeMapping>
           </EntitySetMapping>
-          <AssociationSetMapping Name="RestaurationParametresRepas" TypeName="CD67.FicheCollege.RestaurationParametresRepas" StoreEntitySet="RestaurationParametresRepas">
-            <EndProperty Name="RestaurationTypeRepa">
-              <ScalarProperty Name="Id" ColumnName="RestaurationTypeRepas_Id" />
+          <EntitySetMapping Name="RestaurationTypesRepas">
+            <EntityTypeMapping TypeName="CD67.FicheCollege.RestaurationTypesRepa">
+              <MappingFragment StoreEntitySet="RestaurationTypesRepas">
+                <ScalarProperty Name="Ordre" ColumnName="Ordre" />
+                <ScalarProperty Name="Valid" ColumnName="Valid" />
+                <ScalarProperty Name="Libelle" ColumnName="Libelle" />
+                <ScalarProperty Name="Id" ColumnName="Id" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <AssociationSetMapping Name="RestaurationParametresRepas1" TypeName="CD67.FicheCollege.RestaurationParametresRepas1" StoreEntitySet="RestaurationParametresRepas">
+            <EndProperty Name="RestaurationTypesRepa">
+              <ScalarProperty Name="Id" ColumnName="RestaurationTypesRepas_Id" />
             </EndProperty>
             <EndProperty Name="RestaurationParametre">
               <ScalarProperty Name="Id" ColumnName="RestaurationParametres_Id" />
             </EndProperty>
           </AssociationSetMapping>
+          <EntitySetMapping Name="RestaurationFormulaires">
+            <EntityTypeMapping TypeName="CD67.FicheCollege.RestaurationFormulaire">
+              <MappingFragment StoreEntitySet="RestaurationFormulaires">
+                <ScalarProperty Name="Ind_Signature" ColumnName="Ind_Signature" />
+                <ScalarProperty Name="Date_AvisCA" ColumnName="Date_AvisCA" />
+                <ScalarProperty Name="Montant_Impayes" ColumnName="Montant_Impayes" />
+                <ScalarProperty Name="NbEleves_Impayes" ColumnName="NbEleves_Impayes" />
+                <ScalarProperty Name="Montant_FondSocial" ColumnName="Montant_FondSocial" />
+                <ScalarProperty Name="NbEleves_FondSocial" ColumnName="NbEleves_FondSocial" />
+                <ScalarProperty Name="Prix_EcolePeri" ColumnName="Prix_EcolePeri" />
+                <ScalarProperty Name="Prix_Commensaux" ColumnName="Prix_Commensaux" />
+                <ScalarProperty Name="Prix_AgentC" ColumnName="Prix_AgentC" />
+                <ScalarProperty Name="Prix_ATC" ColumnName="Prix_ATC" />
+                <ScalarProperty Name="Tarif_Pension" ColumnName="Tarif_Pension" />
+                <ScalarProperty Name="Prix_Ticket" ColumnName="Prix_Ticket" />
+                <ScalarProperty Name="NbJours_Forfait1j" ColumnName="NbJours_Forfait1j" />
+                <ScalarProperty Name="Prix_Forfait1j" ColumnName="Prix_Forfait1j" />
+                <ScalarProperty Name="NbJours_Forfait2j" ColumnName="NbJours_Forfait2j" />
+                <ScalarProperty Name="Prix_Forfait2j" ColumnName="Prix_Forfait2j" />
+                <ScalarProperty Name="NbJours_Forfait3j" ColumnName="NbJours_Forfait3j" />
+                <ScalarProperty Name="Prix_Forfait3j" ColumnName="Prix_Forfait3j" />
+                <ScalarProperty Name="NbJours_Forfait4j" ColumnName="NbJours_Forfait4j" />
+                <ScalarProperty Name="Prix_Forfait4j" ColumnName="Prix_Forfait4j" />
+                <ScalarProperty Name="NbJours_Forfait5j" ColumnName="NbJours_Forfait5j" />
+                <ScalarProperty Name="Prix_Forfait5j" ColumnName="Prix_Forfait5j" />
+                <ScalarProperty Name="NbDP_AgentC" ColumnName="NbDP_AgentC" />
+                <ScalarProperty Name="NbDP_ATC" ColumnName="NbDP_ATC" />
+                <ScalarProperty Name="NbDP_Commensaux" ColumnName="NbDP_Commensaux" />
+                <ScalarProperty Name="NbDP_MatPrimPeri" ColumnName="NbDP_MatPrimPeri" />
+                <ScalarProperty Name="NbDP_Lycee" ColumnName="NbDP_Lycee" />
+                <ScalarProperty Name="NbDP_College" ColumnName="NbDP_College" />
+                <ScalarProperty Name="Statut" ColumnName="Statut" />
+                <ScalarProperty Name="College_Id" ColumnName="College_Id" />
+                <ScalarProperty Name="Id" ColumnName="Id" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
+          <EntitySetMapping Name="RestaurationFormulairesRepas">
+            <EntityTypeMapping TypeName="CD67.FicheCollege.RestaurationFormulairesRepa">
+              <MappingFragment StoreEntitySet="RestaurationFormulairesRepas">
+                <ScalarProperty Name="NomEtablissement" ColumnName="NomEtablissement" />
+                <ScalarProperty Name="NbJours" ColumnName="NbJours" />
+                <ScalarProperty Name="NbRepas" ColumnName="NbRepas" />
+                <ScalarProperty Name="RestaurationTypesRepas_Id" ColumnName="RestaurationTypesRepas_Id" />
+                <ScalarProperty Name="RestaurationFormulaires_Id" ColumnName="RestaurationFormulaires_Id" />
+                <ScalarProperty Name="Id" ColumnName="Id" />
+              </MappingFragment>
+            </EntityTypeMapping>
+          </EntitySetMapping>
           </EntityContainerMapping>
 </Mapping></edmx:Mappings>
   </edmx:Runtime>

+ 4 - 0
CD67.FicheCollege.Entity/EntityModel.edmx.diagram

@@ -35,6 +35,10 @@
         <EntityTypeShape EntityType="CD67.FicheCollege.RestaurationParametre" Width="2" PointX="9.375" PointY="0.5" />
         <AssociationConnector Association="CD67.FicheCollege.FK_RestaurationParametresAnnee" />
         <AssociationConnector Association="CD67.FicheCollege.RestaurationParametresRepas" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.RestaurationFormulaire" Width="1.5" PointX="6.875" PointY="9.125" />
+        <EntityTypeShape EntityType="CD67.FicheCollege.RestaurationFormulairesRepa" Width="1.5" PointX="4.625" PointY="9.25" />
+        <AssociationConnector Association="CD67.FicheCollege.FK_RestaurationFormulairesColleges" />
+        <AssociationConnector Association="CD67.FicheCollege.FK_RestaurationFormulairesRepasForm" />
         </Diagram>
     </edmx:Diagrams>
   </edmx:Designer>

+ 94 - 0
CD67.FicheCollege.Entity/Extend/RestaurationFormulaire.cs

@@ -0,0 +1,94 @@
+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(RestaurationFormulaire_Metadata))]
+    public partial class RestaurationFormulaire
+    {
+    }
+
+    /// <summary>
+    /// Classe contenant les DataAnnotations pour chaque champ
+    /// </summary>
+    public class RestaurationFormulaire_Metadata
+    {
+        [Required(ErrorMessage = "Obligatoire")]
+        public System.Guid Id { get; set; }
+
+        [Required(ErrorMessage = "Obligatoire")]
+        public int College_Id { get; set; }
+
+        [Required(ErrorMessage = "Obligatoire")]
+        [UIHint("RestaurationStatut")]
+        public string Statut { get; set; }
+
+        [Required(ErrorMessage = "Obligatoire")]
+        [Display(Name = "Collège")]
+        public int NbDP_College { get; set; }
+
+        [Display(Name = "Lycée")]
+        public int NbDP_Lycee { get; set; }
+
+        [Display(Name = "Maternelle/ Primaire/ Périscolaire")]
+        public int NbDP_MatPrimPeri { get; set; }
+
+        [Display(Name = "Commensaux")]
+        public int NbDP_Commensaux { get; set; }
+
+        [Display(Name = "ATC")]
+        public int NbDP_ATC { get; set; }
+
+        [Display(Name = "Catégorie C et assimilés")]
+        public int NbDP_AgentC { get; set; }
+
+        public Nullable<decimal> Prix_Forfait5j { get; set; }
+        public int NbJours_Forfait5j { get; set; }
+        public Nullable<decimal> Prix_Forfait4j { get; set; }
+        public int NbJours_Forfait4j { get; set; }
+        public Nullable<decimal> Prix_Forfait3j { get; set; }
+        public int NbJours_Forfait3j { get; set; }
+        public Nullable<decimal> Prix_Forfait2j { get; set; }
+        public int NbJours_Forfait2j { get; set; }
+        public Nullable<decimal> Prix_Forfait1j { get; set; }
+        public int NbJours_Forfait1j { get; set; }
+
+        [Display(Name = "Prix du ticket")]
+        public decimal Prix_Ticket { get; set; }
+
+        [Display(Name = "Tarif de pension")]
+        public Nullable<decimal> Tarif_Pension { get; set; }
+
+        [Display(Name = "Prix du ticket ATC")]
+        public decimal Prix_ATC { get; set; }
+
+        [Display(Name = "Prix ticket agent de catégorie C et assimilés")]
+        public decimal Prix_AgentC { get; set; }
+
+        [Display(Name = "Prix ticket autres commensaux")]
+        public Nullable<decimal> Prix_Commensaux { get; set; }
+
+        [Display(Name = "Prix ticket école, périscolaire")]
+        public Nullable<decimal> Prix_EcolePeri { get; set; }
+
+        public int NbEleves_FondSocial { get; set; }
+        public Nullable<decimal> Montant_FondSocial { get; set; }
+        public int NbEleves_Impayes { get; set; }
+        public Nullable<decimal> Montant_Impayes { get; set; }
+
+        [DataType(DataType.Date)]
+        public System.DateTime Date_AvisCA { get; set; }
+
+        [Display(Name = "Je certifie sur l'honneur l'exactitude des renseignements fournis.")]
+        public bool? Ind_Signature { get; set; }
+
+        public virtual College College { get; set; }
+    }
+}

+ 45 - 0
CD67.FicheCollege.Entity/Extend/RestaurationFormulairesRepa.cs

@@ -0,0 +1,45 @@
+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(RestaurationFormulairesRepaMetadata))]
+    public partial class RestaurationFormulairesRepa
+    {
+    }
+
+    /// <summary>
+    /// Classe contenant les DataAnnotations pour chaque champ
+    /// </summary>
+    public class RestaurationFormulairesRepaMetadata
+    {
+        [Required(ErrorMessage = "Obligatoire")]
+        public int Id { get; set; }
+
+        [Required(ErrorMessage = "Obligatoire")]
+        public System.Guid RestaurationFormulaires_Id { get; set; }
+
+        [Required(ErrorMessage = "Obligatoire")]
+        public int RestaurationTypesRepas_Id { get; set; }
+
+        [Display(Name = "Nombre de repas")]
+        public int NbRepas { get; set; }
+
+        [Display(Name = "Nombre de jour en ")]
+        public int NbJours { get; set; }
+
+        [Display(Name = "Nom de l'établissement")]
+        public string NomEtablissement { get; set; }
+
+
+        public virtual RestaurationFormulaire RestaurationFormulaire { get; set; }
+        public virtual ICollection<RestaurationTypesRepa> RestaurationTypesRepa { get; set; }
+    }
+}

+ 1 - 1
CD67.FicheCollege.Entity/Extend/RestaurationParametre.cs

@@ -38,6 +38,6 @@ namespace CD67.FicheCollege.Entity
         public Nullable<decimal> Prix_MiniAutres { get; set; }
 
         [Display(Name = "Types de repas")]
-        public virtual ICollection<RestaurationTypeRepa> RestaurationTypeRepas { get; set; }
+        public virtual ICollection<RestaurationTypesRepa> RestaurationTypesRepas { get; set; }
     }
 }

+ 3 - 3
CD67.FicheCollege.Entity/Extend/RestaurationTypeRepa.cs → CD67.FicheCollege.Entity/Extend/RestaurationTypesRepa.cs

@@ -10,15 +10,15 @@ 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
+    [MetadataType(typeof(RestaurationTypesRepa_Metadata))]
+    public partial class RestaurationTypesRepa
     {
     }
 
     /// <summary>
     /// Classe contenant les DataAnnotations pour chaque champ
     /// </summary>
-    public class RestaurationTypeRepa_Metadata
+    public class RestaurationTypesRepa_Metadata
     {
         [Required(ErrorMessage = "Obligatoire")]
         public int Id { get; set; }

+ 59 - 0
CD67.FicheCollege.Entity/RestaurationFormulaire.cs

@@ -0,0 +1,59 @@
+//------------------------------------------------------------------------------
+// <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 RestaurationFormulaire
+    {
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+        public RestaurationFormulaire()
+        {
+            this.RestaurationFormulairesRepas = new HashSet<RestaurationFormulairesRepa>();
+        }
+    
+        public System.Guid Id { get; set; }
+        public int College_Id { get; set; }
+        public string Statut { get; set; }
+        public int NbDP_College { get; set; }
+        public Nullable<int> NbDP_Lycee { get; set; }
+        public Nullable<int> NbDP_MatPrimPeri { get; set; }
+        public Nullable<int> NbDP_Commensaux { get; set; }
+        public Nullable<int> NbDP_ATC { get; set; }
+        public Nullable<int> NbDP_AgentC { get; set; }
+        public Nullable<decimal> Prix_Forfait5j { get; set; }
+        public Nullable<int> NbJours_Forfait5j { get; set; }
+        public Nullable<decimal> Prix_Forfait4j { get; set; }
+        public Nullable<int> NbJours_Forfait4j { get; set; }
+        public Nullable<decimal> Prix_Forfait3j { get; set; }
+        public Nullable<int> NbJours_Forfait3j { get; set; }
+        public Nullable<decimal> Prix_Forfait2j { get; set; }
+        public Nullable<int> NbJours_Forfait2j { get; set; }
+        public Nullable<decimal> Prix_Forfait1j { get; set; }
+        public Nullable<int> NbJours_Forfait1j { get; set; }
+        public decimal Prix_Ticket { get; set; }
+        public Nullable<decimal> Tarif_Pension { get; set; }
+        public decimal Prix_ATC { get; set; }
+        public decimal Prix_AgentC { get; set; }
+        public Nullable<decimal> Prix_Commensaux { get; set; }
+        public Nullable<decimal> Prix_EcolePeri { get; set; }
+        public Nullable<int> NbEleves_FondSocial { get; set; }
+        public Nullable<decimal> Montant_FondSocial { get; set; }
+        public Nullable<int> NbEleves_Impayes { get; set; }
+        public Nullable<decimal> Montant_Impayes { get; set; }
+        public Nullable<System.DateTime> Date_AvisCA { get; set; }
+        public bool Ind_Signature { get; set; }
+    
+        public virtual College College { get; set; }
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<RestaurationFormulairesRepa> RestaurationFormulairesRepas { get; set; }
+    }
+}

+ 27 - 0
CD67.FicheCollege.Entity/RestaurationFormulairesRepa.cs

@@ -0,0 +1,27 @@
+//------------------------------------------------------------------------------
+// <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 RestaurationFormulairesRepa
+    {
+        public int Id { get; set; }
+        public System.Guid RestaurationFormulaires_Id { get; set; }
+        public int RestaurationTypesRepas_Id { get; set; }
+        public Nullable<int> NbRepas { get; set; }
+        public Nullable<int> NbJours { get; set; }
+        public string NomEtablissement { get; set; }
+    
+        public virtual RestaurationFormulaire RestaurationFormulaire { get; set; }
+        public virtual RestaurationTypesRepa RestaurationTypesRepa { get; set; }
+    }
+}

+ 2 - 2
CD67.FicheCollege.Entity/RestaurationParametre.cs

@@ -17,7 +17,7 @@ namespace CD67.FicheCollege.Entity
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
         public RestaurationParametre()
         {
-            this.RestaurationTypeRepas = new HashSet<RestaurationTypeRepa>();
+            this.RestaurationTypesRepas = new HashSet<RestaurationTypesRepa>();
         }
     
         public int Id { get; set; }
@@ -30,6 +30,6 @@ namespace CD67.FicheCollege.Entity
     
         public virtual Annee Annee { get; set; }
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
-        public virtual ICollection<RestaurationTypeRepa> RestaurationTypeRepas { get; set; }
+        public virtual ICollection<RestaurationTypesRepa> RestaurationTypesRepas { get; set; }
     }
 }

+ 5 - 2
CD67.FicheCollege.Entity/RestaurationTypeRepa.cs → CD67.FicheCollege.Entity/RestaurationTypesRepa.cs

@@ -12,12 +12,13 @@ namespace CD67.FicheCollege.Entity
     using System;
     using System.Collections.Generic;
     
-    public partial class RestaurationTypeRepa
+    public partial class RestaurationTypesRepa
     {
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
-        public RestaurationTypeRepa()
+        public RestaurationTypesRepa()
         {
             this.RestaurationParametres = new HashSet<RestaurationParametre>();
+            this.RestaurationFormulairesRepas = new HashSet<RestaurationFormulairesRepa>();
         }
     
         public int Id { get; set; }
@@ -27,5 +28,7 @@ namespace CD67.FicheCollege.Entity
     
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
         public virtual ICollection<RestaurationParametre> RestaurationParametres { get; set; }
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+        public virtual ICollection<RestaurationFormulairesRepa> RestaurationFormulairesRepas { get; set; }
     }
 }

+ 10 - 2
CD67.FicheCollege.Factory/CD67.FicheCollege.Factory.csproj

@@ -117,13 +117,19 @@
       <DependentUpon>GenericFactories.tt</DependentUpon>
     </Compile>
     <Compile Include="Internal\BaseFactory.cs" />
+    <Compile Include="Internal\RestaurationFormulaireFactory.cs">
+      <DependentUpon>GenericFactories.tt</DependentUpon>
+    </Compile>
+    <Compile Include="Internal\RestaurationFormulairesRepaFactory.cs">
+      <DependentUpon>GenericFactories.tt</DependentUpon>
+    </Compile>
     <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">
+    <Compile Include="Internal\RestaurationTypesRepaFactory.cs">
       <DependentUpon>GenericFactories.tt</DependentUpon>
     </Compile>
     <Compile Include="Internal\TerritoireFactory.cs">
@@ -138,8 +144,10 @@
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
       <DependentUpon>Settings.settings</DependentUpon>
     </Compile>
+    <Compile Include="RestaurationFormulairesRepaFactory.cs" />
+    <Compile Include="RestaurationFormulaireFactory.cs" />
     <Compile Include="RestaurationParametreFactory.cs" />
-    <Compile Include="RestaurationTypeRepaFactory.cs" />
+    <Compile Include="RestaurationTypesRepaFactory.cs" />
     <Compile Include="TerritoireFactory.cs" />
     <Compile Include="ActionEduAxeFactory.cs" />
     <Compile Include="RestaurationTypeFactory.cs" />

+ 21 - 0
CD67.FicheCollege.Factory/Internal/RestaurationFormulaireFactory.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 RestaurationFormulaireFactory : Internal.BaseFactory<Entity.RestaurationFormulaire>
+	{
+		/// <summary>
+        /// Constructeur public lié au constructeur de base
+        /// </summary>
+        /// <param name="dbContext">Context Entity Framework utilisé dans la classe</param>
+		public RestaurationFormulaireFactory(Entities dbContext) : base(dbContext) { }
+	}
+}
+	

+ 21 - 0
CD67.FicheCollege.Factory/Internal/RestaurationFormulairesRepaFactory.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 RestaurationFormulairesRepaFactory : Internal.BaseFactory<Entity.RestaurationFormulairesRepa>
+	{
+		/// <summary>
+        /// Constructeur public lié au constructeur de base
+        /// </summary>
+        /// <param name="dbContext">Context Entity Framework utilisé dans la classe</param>
+		public RestaurationFormulairesRepaFactory(Entities dbContext) : base(dbContext) { }
+	}
+}
+	

+ 2 - 2
CD67.FicheCollege.Factory/Internal/RestaurationTypeRepaFactory.cs → CD67.FicheCollege.Factory/Internal/RestaurationTypesRepaFactory.cs

@@ -9,13 +9,13 @@ namespace CD67.FicheCollege.Factory
     /// 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>
+	public partial class RestaurationTypesRepaFactory : Internal.BaseFactory<Entity.RestaurationTypesRepa>
 	{
 		/// <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) { }
+		public RestaurationTypesRepaFactory(Entities dbContext) : base(dbContext) { }
 	}
 }
 	

+ 47 - 0
CD67.FicheCollege.Factory/RestaurationFormulaireFactory.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 RestaurationFormulaireFactory : Internal.BaseFactory<Entity.RestaurationFormulaire>
+    {
+        public override IQueryable<Entity.RestaurationFormulaire> getAll()
+        {
+            return base.getAll();
+        }
+
+        public override void add(ref Entity.RestaurationFormulaire entity)
+        {
+            base.add(ref entity);
+        }
+
+        public override void update(ref Entity.RestaurationFormulaire entity)
+        {
+            base.update(ref entity);
+        }
+
+        public void addFormulairesRepas(ref Entity.RestaurationFormulairesRepa repas, RestaurationFormulaire form)
+        {
+            form.RestaurationFormulairesRepas.Add(repas);
+            base.update(ref form);
+        }
+
+        public void removeFormulairesRepas(ref Entity.RestaurationFormulairesRepa repas, RestaurationFormulaire form)
+        {
+            form.RestaurationFormulairesRepas.Remove(repas);
+            base.update(ref form);
+        }
+
+        public override void delete(ref Entity.RestaurationFormulaire form)
+        {
+            base.delete(ref form);
+            //On supprime le formulaire
+            form.RestaurationFormulairesRepas.Clear();
+            this.update(ref form);
+        }
+    }
+}

+ 55 - 0
CD67.FicheCollege.Factory/RestaurationFormulairesRepaFactory.cs

@@ -0,0 +1,55 @@
+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 RestaurationFormulairesRepaFactory : Internal.BaseFactory<Entity.RestaurationFormulairesRepa>
+    {
+        public override IQueryable<Entity.RestaurationFormulairesRepa> getAll()
+        {
+            return base.getAll();
+        }
+
+        public List<Entity.RestaurationFormulairesRepa> getByForm(Guid form_Id)
+        {
+            return dbContext.RestaurationFormulairesRepas.Where(x => x.RestaurationFormulaires_Id == form_Id).OrderBy(x => x.RestaurationTypesRepas_Id).ToList();
+        }
+
+        public int getSumTotal(Guid form_Id)
+        {
+            return dbContext.RestaurationFormulairesRepas.Where(x => x.RestaurationFormulaires_Id == form_Id).Sum(x => x.NbRepas).Value;
+        }
+
+        public int getMoyTotal(Guid form_Id)
+        {
+            ICollection<RestaurationFormulairesRepa> listeFormRepas = dbContext.RestaurationFormulairesRepas.Where(x => x.RestaurationFormulaires_Id == form_Id).ToList();
+            int sum = 0;
+            int count = listeFormRepas.Count();
+
+            foreach (RestaurationFormulairesRepa repas in listeFormRepas)
+            {
+                sum = sum + (repas.NbRepas.Value / repas.NbJours.Value);
+            }
+
+            return sum;
+        }
+
+        public override void add(ref Entity.RestaurationFormulairesRepa form)
+        {
+            base.add(ref form);
+        }
+
+        public override void update(ref Entity.RestaurationFormulairesRepa form)
+        {
+            base.update(ref form);
+        }
+        public override void delete(ref Entity.RestaurationFormulairesRepa form)
+        {
+            base.delete(ref form);
+        }
+    }
+}

+ 5 - 5
CD67.FicheCollege.Factory/RestaurationParametreFactory.cs

@@ -24,15 +24,15 @@ namespace CD67.FicheCollege.Factory
             base.update(ref entity);
         }
 
-        public void addTypeRepas(ref Entity.RestaurationTypeRepa typeRepas, RestaurationParametre param)
+        public void addTypeRepas(ref Entity.RestaurationTypesRepa typeRepas, RestaurationParametre param)
         {
-            param.RestaurationTypeRepas.Add(typeRepas);
+            param.RestaurationTypesRepas.Add(typeRepas);
             base.update(ref param);
         }
 
-        public void removeTypeRepas(ref Entity.RestaurationTypeRepa typeRepas, RestaurationParametre param)
+        public void removeTypeRepas(ref Entity.RestaurationTypesRepa typeRepas, RestaurationParametre param)
         {
-            param.RestaurationTypeRepas.Remove(typeRepas);
+            param.RestaurationTypesRepas.Remove(typeRepas);
             base.update(ref param);
         }
 
@@ -40,7 +40,7 @@ namespace CD67.FicheCollege.Factory
         {
             base.delete(ref entity);
             //On supprime les types de repas liés
-            entity.RestaurationTypeRepas.Clear();
+            entity.RestaurationTypesRepas.Clear();
             this.update(ref entity);
         }
     }

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

@@ -1,81 +0,0 @@
-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();
-        }
-    }
-}

+ 81 - 0
CD67.FicheCollege.Factory/RestaurationTypesRepaFactory.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 RestaurationTypesRepaFactory : Internal.BaseFactory<Entity.RestaurationTypesRepa>
+    {
+        public override IQueryable<Entity.RestaurationTypesRepa> getAll()
+        {
+            return base.getAll("Ordre");
+        }
+
+        public IQueryable<Entity.RestaurationTypesRepa> getAllValid()
+        {
+            return base.getAll("Ordre").Where(i => i.Valid == true);
+        }
+
+        public IQueryable<Entity.RestaurationTypesRepa> getAllValid(RestaurationParametre param)
+        {
+            if (param.RestaurationTypesRepas.Count == 0) this.dbContext.Entry(param).Collection(i => i.RestaurationTypesRepas).Load();
+            IQueryable<Entity.RestaurationTypesRepa> typeRepas = param.RestaurationTypesRepas.AsQueryable();
+
+            return typeRepas.Where(i => i.Valid == true).OrderBy(i => i.Ordre);
+        }
+
+        public void Up(ref Entity.RestaurationTypesRepa item)
+        {
+            int ordre = item.Ordre;
+
+            //Cas de sortie immédiate
+            if (item.Ordre == 1) return;
+
+            Entity.RestaurationTypesRepa itemToSubstitute = dbContext.RestaurationTypesRepas.Where(i => i.Ordre == ordre - 1).First();
+            itemToSubstitute.Ordre += 1;
+            item.Ordre -= 1;
+            dbContext.SaveChanges();
+        }
+
+        public void Down(ref Entity.RestaurationTypesRepa item)
+        {
+            int ordre = item.Ordre;
+
+            //Cas de sortie immédiate
+            if (item.Ordre == dbContext.RestaurationTypes.Max(i => i.Ordre)) return;
+
+            Entity.RestaurationTypesRepa itemToSubstitute = dbContext.RestaurationTypesRepas.Where(i => i.Ordre == ordre + 1).First();
+            itemToSubstitute.Ordre -= 1;
+            item.Ordre += 1;
+            dbContext.SaveChanges();
+        }
+
+        private void Sort()
+        {
+            int ordre = 1;
+            foreach (Entity.RestaurationTypesRepa statut in dbContext.RestaurationTypesRepas.OrderBy(i => i.Ordre))
+            {
+                statut.Ordre = ordre++;
+            }
+            dbContext.SaveChanges();
+        }
+
+        public override void add(ref Entity.RestaurationTypesRepa entity)
+        {
+            //Initialisation de l'ordre
+            if (dbContext.RestaurationTypesRepas.Count() == 0) entity.Ordre = 1;
+            else entity.Ordre = dbContext.RestaurationTypesRepas.Max(i => i.Ordre) + 1;
+
+            base.add(ref entity);
+        }
+
+        public override void delete(ref Entity.RestaurationTypesRepa entity)
+        {
+            base.delete(ref entity);
+            Sort();
+        }
+    }
+}

+ 9 - 4
CD67.FicheCollege.MVC/CD67.FicheCollege.MVC.csproj

@@ -178,8 +178,9 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="App_Start\BundleConfig.cs" />
+    <Compile Include="Controllers\RestaurationFormulairesController.cs" />
     <Compile Include="Controllers\RestaurationParametresController.cs" />
-    <Compile Include="Controllers\RestaurationTypeRepasController.cs" />
+    <Compile Include="Controllers\RestaurationTypesRepasController.cs" />
     <Compile Include="Controllers\RestaurationTypesController.cs" />
     <Compile Include="Controllers\ActionEduAxesController.cs" />
     <Compile Include="Controllers\ActionsEduActeursController.cs" />
@@ -209,8 +210,9 @@
     <Compile Include="Models\CheckBoxListItem.cs" />
     <Compile Include="Models\ImportActionEduViewModel.cs" />
     <Compile Include="Models\ImportCollegeViewModel.cs" />
+    <Compile Include="Models\RestaurationFormulaireViewModel.cs" />
     <Compile Include="Models\RestaurationParametreViewModel.cs" />
-    <Compile Include="Models\RestaurationTypeRepaViewModel.cs" />
+    <Compile Include="Models\RestaurationTypesRepaViewModel.cs" />
     <Compile Include="Models\TerritoireViewModel.cs" />
     <Compile Include="Models\RestaurationTypeViewModel.cs" />
     <Compile Include="Models\TypeCollegeViewModel.cs" />
@@ -486,10 +488,13 @@
     <Content Include="Views\RestaurationTypes\Edit.cshtml" />
     <Content Include="Views\RestaurationTypes\Index.cshtml" />
     <Content Include="Views\Colleges\Type.cshtml" />
-    <Content Include="Views\RestaurationTypeRepas\Edit.cshtml" />
-    <Content Include="Views\RestaurationTypeRepas\Index.cshtml" />
+    <Content Include="Views\RestaurationTypesRepas\Edit.cshtml" />
+    <Content Include="Views\RestaurationTypesRepas\Index.cshtml" />
     <Content Include="Views\RestaurationParametres\Edit.cshtml" />
     <Content Include="Views\Shared\_AdminDeleteWarning.cshtml" />
+    <Content Include="Views\RestaurationFormulaires\Edit.cshtml" />
+    <Content Include="Views\RestaurationFormulaires\Details.cshtml" />
+    <Content Include="Views\Shared\DisplayTemplates\RestaurationStatut.cshtml" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="App_Data\" />

+ 16 - 0
CD67.FicheCollege.MVC/Content/cd67-custom.less

@@ -302,4 +302,20 @@ header nav{
 
 .table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
   background-color: lighten(@color1,25%) !important;
+}
+
+@media (min-width: 768px) {
+    .dl-horizontal-bg dt {
+        float: left;
+        width: 320px !important;
+        overflow: hidden;
+        clear: left;
+        text-align: right;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+    }
+
+    .dl-horizontal-bg dd {
+        margin-left: 340px;
+    }
 }

+ 227 - 0
CD67.FicheCollege.MVC/Controllers/RestaurationFormulairesController.cs

@@ -0,0 +1,227 @@
+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 RestaurationFormulairesController : Controller
+    {
+        private Entities db = new Entities();
+
+        // GET: RestaurationFormulaires/Details/5
+        public ActionResult Details(int? id)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+
+            CollegeFactory colFact = new CollegeFactory(db);
+            College college = colFact.getById(id.Value);
+
+            if (college == null)
+            {
+                return HttpNotFound();
+            }
+
+            RestaurationFormulaireFactory restoFact = new RestaurationFormulaireFactory(db);
+            RestaurationFormulaire restoForm = restoFact.getBy(x => x.College_Id == id.Value);
+
+            // si null on est en mode création
+            if (restoForm == null)
+                return RedirectToAction("Edit", "RestaurationFormulaires", new { id = college.Id, mode = ModeAcces.Creation });
+
+            AnneeFactory fact = new AnneeFactory(db);
+            Annee annee = fact.getById(college.Annee_Id);
+            ViewBag.AnneeEnCours = annee.AnneeRentree;
+
+            RestaurationParametreFactory paramFact = new RestaurationParametreFactory(db);
+            RestaurationParametre param = paramFact.getBy(x => x.Annee_Id == annee.Id);
+            ViewBag.Param = param;
+
+            restoForm.College = college;
+            RestaurationFormulairesRepaFactory formRepasFact = new RestaurationFormulairesRepaFactory(db);
+            restoForm.RestaurationFormulairesRepas = formRepasFact.getByForm(restoForm.Id);
+
+            int total = formRepasFact.getSumTotal(restoForm.Id);
+            ViewBag.SumTotal = total;
+
+            int moyenneTotal = formRepasFact.getMoyTotal(restoForm.Id);
+            ViewBag.MoyenneTotal = moyenneTotal;
+
+            RestaurationFormulaireViewModel model = new RestaurationFormulaireViewModel(restoForm, ModeAcces.Lecture);
+
+            return View(model);
+        }
+
+        // GET: RestaurationFormulaires/Edit/5
+        public ActionResult Edit(int? id, ModeAcces mode)
+        {
+            if (id == null)
+            {
+                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
+            }
+
+            CollegeFactory colFact = new CollegeFactory(db);
+            College college = colFact.getById(id.Value);
+
+            if (college == null)
+            {
+                return HttpNotFound();
+            }
+
+            RestaurationFormulaireFactory restoFact = new RestaurationFormulaireFactory(db);
+            RestaurationFormulaire restoForm = restoFact.getBy(x => x.College_Id == id.Value);
+
+            List<RestaurationFormulairesRepa> listeFormRepas = new List<RestaurationFormulairesRepa>();
+
+            AnneeFactory fact = new AnneeFactory(db);
+            Annee annee = fact.getById(college.Annee_Id);
+            ViewBag.AnneeEnCours = annee.AnneeRentree;
+
+            RestaurationParametreFactory paramFact = new RestaurationParametreFactory(db);
+            RestaurationParametre param = paramFact.getBy(x => x.Annee_Id == annee.Id);
+            ViewBag.Param = param;
+
+            RestaurationFormulairesRepaFactory formRepasFact = new RestaurationFormulairesRepaFactory(db);
+            RestaurationTypesRepaFactory typeRepasFact = new RestaurationTypesRepaFactory(db);
+
+            if (restoForm == null)
+            {
+                restoForm = new RestaurationFormulaire();
+                restoForm.Id = Guid.NewGuid();
+                restoForm.College_Id = college.Id;
+                restoForm.Statut = Constants.Statut.EN_COURS_DE_SAISIE.ToString();
+                restoForm.College = college;
+
+                foreach (RestaurationTypesRepa listeTypeRepas in param.RestaurationTypesRepas)
+                {
+                    RestaurationFormulairesRepa getRepas = new RestaurationFormulairesRepa();
+                    getRepas.RestaurationFormulaires_Id = restoForm.Id;
+                    getRepas.RestaurationTypesRepas_Id = listeTypeRepas.Id;
+                    getRepas.RestaurationTypesRepa = typeRepasFact.getById(listeTypeRepas.Id);
+
+                    listeFormRepas.Add(getRepas);
+                }
+
+                restoForm.RestaurationFormulairesRepas = listeFormRepas;
+            }
+            else
+            {
+                restoForm.College = college;
+                restoForm.RestaurationFormulairesRepas = formRepasFact.getByForm(restoForm.Id);
+            }
+
+            RestaurationFormulaireViewModel model = new RestaurationFormulaireViewModel(restoForm, mode);
+
+            return View(model);
+        }
+
+    // POST: RestaurationFormulaires/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(int id, ModeAcces mode, RestaurationFormulaire form, List<RestaurationFormulairesRepa> repas)
+        {
+            RestaurationFormulaireFactory formFact = new RestaurationFormulaireFactory(db);
+            RestaurationFormulairesRepaFactory formRepasFact = new RestaurationFormulairesRepaFactory(db);
+
+            CollegeFactory colFact = new CollegeFactory(db);
+            College college = colFact.getById(id);
+            form.College = college;
+
+            AnneeFactory fact = new AnneeFactory(db);
+            Annee annee = fact.getById(college.Annee_Id);
+            ViewBag.AnneeEnCours = annee.AnneeRentree;
+
+            RestaurationParametreFactory paramFact = new RestaurationParametreFactory(db);
+            RestaurationParametre param = paramFact.getBy(x => x.Annee_Id == annee.Id);
+            ViewBag.Param = param;
+
+            if (ModelState.IsValid)
+            {
+                if (mode == ModeAcces.Creation)
+                    formFact.add(ref form);
+                else
+                    formFact.update(ref form);
+
+                foreach (RestaurationFormulairesRepa listeRepas in repas)
+                {
+                    RestaurationFormulairesRepa getRepas = listeRepas;
+
+                    if (listeRepas.Id == 0)
+                        formRepasFact.add(ref getRepas);
+                    else
+                        formRepasFact.update(ref getRepas);
+                }
+
+                return RedirectToAction("Index", "Restauration", new { annee_id = param.Annee_Id });
+            }
+
+            form.RestaurationFormulairesRepas = formRepasFact.getByForm(form.Id);
+            RestaurationFormulaireViewModel model = new RestaurationFormulaireViewModel(form, ModeAcces.Modification);
+
+            return View(form);
+        }
+
+        // GET: RestaurationFormulaires/Finish/5
+        public ActionResult Finish(int? id)
+        {
+            CollegeFactory colFact = new CollegeFactory(db);
+            College college = colFact.getById(id);
+
+            RestaurationFormulaireFactory restoFact = new RestaurationFormulaireFactory(db);
+            RestaurationFormulaire restoForm = restoFact.getBy(x => x.College_Id == id.Value);
+
+            restoForm.Statut = Constants.Statut.PROPOSE.ToString();
+            restoFact.update(ref restoForm);
+
+            return RedirectToAction("Details", new { id = college.Id });
+        }
+
+        // GET: RestaurationFormulaires/Input/5
+        public ActionResult Input(int? id)
+        {
+            CollegeFactory colFact = new CollegeFactory(db);
+            College college = colFact.getById(id);
+
+            RestaurationFormulaireFactory restoFact = new RestaurationFormulaireFactory(db);
+            RestaurationFormulaire restoForm = restoFact.getBy(x => x.College_Id == id.Value);
+
+            restoForm.Statut = Constants.Statut.EN_COURS_DE_SAISIE.ToString();
+            restoFact.update(ref restoForm);
+
+            return RedirectToAction("Details", new { id = college.Id });
+        }
+
+        // GET: RestaurationFormulaires/Validate/5
+        public ActionResult Validate(int? id)
+        {
+            CollegeFactory colFact = new CollegeFactory(db);
+            College college = colFact.getById(id);
+
+            RestaurationFormulaireFactory restoFact = new RestaurationFormulaireFactory(db);
+            RestaurationFormulaire restoForm = restoFact.getBy(x => x.College_Id == id.Value);
+
+            restoForm.Statut = Constants.Statut.VALIDE.ToString();
+            restoFact.update(ref restoForm);
+
+            return RedirectToAction("Details", new { id = college.Id });
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                db.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+    }
+}

+ 9 - 9
CD67.FicheCollege.MVC/Controllers/RestaurationParametresController.cs

@@ -35,7 +35,7 @@ namespace CD67.FicheCollege.MVC.Controllers
                 param.Annee_Id = annee_id.Value;
             }
 
-            RestaurationTypeRepaFactory typeRepasFactory = new RestaurationTypeRepaFactory(db);
+            RestaurationTypesRepaFactory typeRepasFactory = new RestaurationTypesRepaFactory(db);
             List<CheckBoxListItem> repasCBList = new List<CheckBoxListItem>();
             foreach (var item in typeRepasFactory.getAllValid().ToList())
             {
@@ -44,7 +44,7 @@ namespace CD67.FicheCollege.MVC.Controllers
                     {
                         ID = item.Id.ToString(),
                         Display = item.Libelle,
-                        IsChecked = param.RestaurationTypeRepas.Any(i => i.Id == item.Id) ? true : false
+                        IsChecked = param.RestaurationTypesRepas.Any(i => i.Id == item.Id) ? true : false
                     }
                     );
             }
@@ -68,29 +68,29 @@ namespace CD67.FicheCollege.MVC.Controllers
         public ActionResult Edit(Entity.RestaurationParametre param, List<CheckBoxListItem> RepasCBList)
         {
             ModeAcces mode = new ModeAcces();
-            RestaurationTypeRepaFactory typeRepasFactory = new RestaurationTypeRepaFactory(db);
+            RestaurationTypesRepaFactory typeRepasFactory = new RestaurationTypesRepaFactory(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();
+                db.Entry(param).Collection(i => i.RestaurationTypesRepas).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)))
+                        if (!param.RestaurationTypesRepas.Any(repas => repas.Id == int.Parse(item.ID)))
                         {
-                            param.RestaurationTypeRepas.Add(typeRepasFactory.getById(int.Parse(item.ID)));
+                            param.RestaurationTypesRepas.Add(typeRepasFactory.getById(int.Parse(item.ID)));
                         }
                     }
                     else
                     {
-                        if (param.RestaurationTypeRepas.Any(repas => repas.Id == int.Parse(item.ID)))
+                        if (param.RestaurationTypesRepas.Any(repas => repas.Id == int.Parse(item.ID)))
                         {
-                            param.RestaurationTypeRepas.Remove(typeRepasFactory.getById(int.Parse(item.ID)));
+                            param.RestaurationTypesRepas.Remove(typeRepasFactory.getById(int.Parse(item.ID)));
                         }
                     }
                 }
@@ -119,7 +119,7 @@ namespace CD67.FicheCollege.MVC.Controllers
                     {
                         ID = item.Id.ToString(),
                         Display = item.Libelle,
-                        IsChecked = param.RestaurationTypeRepas.Any(i => i.Id == item.Id) ? true : false
+                        IsChecked = param.RestaurationTypesRepas.Any(i => i.Id == item.Id) ? true : false
                     }
                     );
             }

+ 29 - 29
CD67.FicheCollege.MVC/Controllers/RestaurationTypeRepasController.cs → CD67.FicheCollege.MVC/Controllers/RestaurationTypesRepasController.cs

@@ -6,88 +6,88 @@ using System.Web.Mvc;
 
 namespace CD67.FicheCollege.MVC.Controllers
 {
-    public class RestaurationTypeRepasController : Controller
+    public class RestaurationTypesRepasController : Controller
     {
         private Entities db = new Entities();
 
-        // GET: RestaurationTypeRepas
+        // GET: RestaurationTypesRepas
         public ActionResult Index()
         {
-            RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
-            RestaurationTypeRepaIndexViewModel model = new RestaurationTypeRepaIndexViewModel(fact.getAll());
+            RestaurationTypesRepaFactory fact = new RestaurationTypesRepaFactory(db);
+            RestaurationTypesRepaIndexViewModel model = new RestaurationTypesRepaIndexViewModel(fact.getAll());
             return View(model);
         }
 
-        // GET: RestaurationTypeRepas/Create
+        // GET: RestaurationTypesRepas/Create
         public ActionResult Create()
         {
-            RestaurationTypeRepa repas = new RestaurationTypeRepa();
+            RestaurationTypesRepa repas = new RestaurationTypesRepa();
 
-            RestaurationTypeRepaViewModel model = new RestaurationTypeRepaViewModel(repas, ModeAcces.Creation);
+            RestaurationTypesRepaViewModel model = new RestaurationTypesRepaViewModel(repas, ModeAcces.Creation);
             return View("Edit", model);
         }
 
-        // POST: RestaurationTypeRepas/Create
+        // POST: RestaurationTypesRepas/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)
+        public ActionResult Create(RestaurationTypesRepa repas)
         {
             if (ModelState.IsValid)
             {
-                RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
+                RestaurationTypesRepaFactory fact = new RestaurationTypesRepaFactory(db);
                 fact.add(ref repas);
                 return RedirectToAction("Index");
             }
 
-            RestaurationTypeRepaViewModel model = new RestaurationTypeRepaViewModel(repas, ModeAcces.Creation);
+            RestaurationTypesRepaViewModel model = new RestaurationTypesRepaViewModel(repas, ModeAcces.Creation);
             return View("Edit", model);
         }
 
-        // GET: RestaurationTypeRepas/Edit/5
+        // GET: RestaurationTypesRepas/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);
+            RestaurationTypesRepaFactory fact = new RestaurationTypesRepaFactory(db);
+            RestaurationTypesRepa repas = fact.getById(id.Value);
             if (repas == null)
             {
                 return HttpNotFound();
             }
-            RestaurationTypeRepaViewModel model = new RestaurationTypeRepaViewModel(repas, ModeAcces.Modification);
+            RestaurationTypesRepaViewModel model = new RestaurationTypesRepaViewModel(repas, ModeAcces.Modification);
             return View(model);
         }
 
-        // POST: RestaurationTypeRepas/Edit/5
+        // POST: RestaurationTypesRepas/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)
+        public ActionResult Edit(RestaurationTypesRepa repas)
         {
             if (ModelState.IsValid)
             {
-                RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
+                RestaurationTypesRepaFactory fact = new RestaurationTypesRepaFactory(db);
                 fact.update(ref repas);
                 return RedirectToAction("Index");
             }
-            RestaurationTypeRepaViewModel model = new RestaurationTypeRepaViewModel(repas, ModeAcces.Modification);
+            RestaurationTypesRepaViewModel model = new RestaurationTypesRepaViewModel(repas, ModeAcces.Modification);
             return View(model);
         }
 
-        // GET: RestaurationTypeRepas/Delete/5
+        // GET: RestaurationTypesRepas/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);
+            RestaurationTypesRepaFactory fact = new RestaurationTypesRepaFactory(db);
+            RestaurationTypesRepa repas = fact.getById(id.Value);
             if (repas == null)
             {
                 return HttpNotFound();
@@ -96,13 +96,13 @@ namespace CD67.FicheCollege.MVC.Controllers
             return View("~/Views/Shared/_AdminDeleteWarning.cshtml", model);
         }
 
-        // POST: RestaurationTypeRepas/Delete/5
+        // POST: RestaurationTypesRepas/Delete/5
         [HttpPost, ActionName("Delete")]
         [ValidateAntiForgeryToken]
         public ActionResult DeleteConfirmed(int id)
         {
-            RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
-            RestaurationTypeRepa repas = fact.getById(id);
+            RestaurationTypesRepaFactory fact = new RestaurationTypesRepaFactory(db);
+            RestaurationTypesRepa repas = fact.getById(id);
             fact.delete(ref repas);
             return RedirectToAction("Index");
         }
@@ -113,8 +113,8 @@ namespace CD67.FicheCollege.MVC.Controllers
             {
                 return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
             }
-            RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
-            RestaurationTypeRepa repas = fact.getById(id.Value);
+            RestaurationTypesRepaFactory fact = new RestaurationTypesRepaFactory(db);
+            RestaurationTypesRepa repas = fact.getById(id.Value);
             fact.Up(ref repas);
             return RedirectToAction("Index");
         }
@@ -125,8 +125,8 @@ namespace CD67.FicheCollege.MVC.Controllers
             {
                 return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
             }
-            RestaurationTypeRepaFactory fact = new RestaurationTypeRepaFactory(db);
-            RestaurationTypeRepa repas = fact.getById(id.Value);
+            RestaurationTypesRepaFactory fact = new RestaurationTypesRepaFactory(db);
+            RestaurationTypesRepa repas = fact.getById(id.Value);
             fact.Down(ref repas);
             return RedirectToAction("Index");
         }

+ 19 - 0
CD67.FicheCollege.MVC/Models/RestaurationFormulaireViewModel.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 RestaurationFormulaireViewModel : BaseViewModel<RestaurationFormulaire>
+    {
+
+        public RestaurationFormulaireViewModel(RestaurationFormulaire model, ModeAcces acces = ModeAcces.Lecture, Dictionary<string, object> bag = null) : base(model, acces, bag)
+        {
+        }
+
+        public override int Annee_Id { get { return Obj.College.Annee.Id; } }
+        public override string Annee_Lib { get { return Obj.College.Annee.Libelle; } }
+    }
+}

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

@@ -1,29 +0,0 @@
-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/RestaurationTypesRepaViewModel.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 RestaurationTypesRepaViewModel : BaseViewModel<RestaurationTypesRepa>
+    {
+        public RestaurationTypesRepaViewModel(RestaurationTypesRepa 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 RestaurationTypesRepaIndexViewModel : BaseViewModel<IEnumerable<RestaurationTypesRepa>>
+    {
+        public RestaurationTypesRepaIndexViewModel(IEnumerable<RestaurationTypesRepa> 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 ""; } }
+
+    }
+}

+ 46 - 22
CD67.FicheCollege.MVC/Views/Restauration/Index.cshtml

@@ -1,5 +1,6 @@
 @using CD67.FicheCollege.MVC.Models
 @model AnneeViewModel
+@using CD67.FicheCollege.Entity;
 
 <title>Restauration @Model.Annee_Lib</title>
 
@@ -11,10 +12,10 @@
 }
 
 <header>
-    <h2>La restauration</h2>
+    <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", "RestaurationTypesRepas")"> <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>
@@ -26,7 +27,7 @@
 }
 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 />
+    <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>
@@ -43,6 +44,9 @@ else
             <th>
                 @Html.DisplayNameFor(model => college_model.RestaurationType_Id)
             </th>
+            <th>
+                Statut du formulaire
+            </th>
             <th>
                 Actions
             </th>
@@ -51,25 +55,45 @@ else
     <tbody>
         @foreach (College college in Model.Obj.Colleges)
         {
-        <tr>
-            <td>
-                @Html.DisplayFor(modelcollege => college.CodeRne)
-            </td>
-            <td>
-                <a href="@Url.Action("Details", "Colleges", new { id = college.Id })">@Html.DisplayFor(modelcollege => college.Libelle)</a>
-            </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>
+            <tr>
+                <td>
+                    @Html.DisplayFor(modelcollege => college.CodeRne)
+                </td>
+                <td>
+                    <a href="@Url.Action("Details", "Colleges", new { id = college.Id })">@Html.DisplayFor(modelcollege => college.Libelle)</a>
+                </td>
+                <td>
+                    @Html.DisplayFor(modelcollege => college.AdresseComplete)
+                </td>
+                <td>
+                    <div style="text-align:left">
+                        @Html.DisplayFor(modelcollege => college.RestaurationType.Libelle)
+                    </div>
+                    <div style="text-align:right">
+                        <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>
+                    </div>
+                </td>
+                @if (college.RestaurationFormulaires.Count() > 0)
+                {
+                    foreach (RestaurationFormulaire form in college.RestaurationFormulaires)
+                    { 
+                        <td>
+                            @Html.DisplayFor(modelcollege => form.Statut)
+                        </td>
+                    }
+                }
+                else
+                {
+                    <td>A saisir</td>
+                }
+                <td>
+                    <a href="@Url.Action("Details", "RestaurationFormulaires", new { id = college.Id })">
+                        <span class="fa fa-file-text fa-2x color1" title="Détails" style="vertical-align: middle" aria-hidden="true"></span>
+                    </a>
+                </td>
+            </tr>
         }
     </tbody>
 </table>

+ 340 - 0
CD67.FicheCollege.MVC/Views/RestaurationFormulaires/Details.cshtml

@@ -0,0 +1,340 @@
+@using CD67.FicheCollege.MVC.Models
+@model RestaurationFormulaireViewModel
+
+@{
+    ViewBag.Title = "Details";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    RestaurationFormulaire form = Model.Obj;
+    int anneePlus = ViewBag.AnneeEnCours + 1;
+    int anneeMoins = ViewBag.AnneeEnCours - 1;
+    RestaurationParametre param = ViewBag.Param;
+    List<RestaurationFormulairesRepa> repas = Model.Obj.RestaurationFormulairesRepas.ToList();
+    decimal sum = 0;
+}
+
+<header>
+    <h2>
+        La Restauration - @form.College.Libelle
+        @if (form.College.RestaurationType_Id != null)
+        {
+            <text>(</text>@form.College.RestaurationType.Libelle<text>)</text>
+        }
+    </h2>
+</header>
+
+<hr />
+
+<div class="form-horizontal">
+    <h4><b>PROPOSITIONS DE TARIFS DE RESTAURATION ET D'HEBERGEMENT POUR L'ANNEE @anneePlus</b></h4>
+    <hr />
+
+    <b>I. Nombre de demi-pensionnaires</b><br /><br />
+    <dl class="dl-horizontal-bg">
+        <dt>@Html.DisplayNameFor(model => form.NbDP_College)</dt>
+        <dd>@Html.DisplayFor(model => form.NbDP_College)</dd>
+
+        <dt>@Html.DisplayNameFor(model => form.NbDP_Lycee)</dt>
+        <dd>@Html.DisplayFor(model => form.NbDP_Lycee)</dd>
+
+        <dt>@Html.DisplayNameFor(model => form.NbDP_MatPrimPeri)</dt>
+        <dd>@Html.DisplayFor(model => form.NbDP_MatPrimPeri)</dd>
+
+        <dt>@Html.DisplayNameFor(model => form.NbDP_Commensaux)</dt>
+        <dd>@Html.DisplayFor(model => form.NbDP_Commensaux)</dd>
+
+        <dt>@Html.DisplayNameFor(model => form.NbDP_ATC)</dt>
+        <dd>@Html.DisplayFor(model => form.NbDP_ATC)</dd>
+
+        <dt>@Html.DisplayNameFor(model => form.NbDP_AgentC)</dt>
+        <dd>@Html.DisplayFor(model => form.NbDP_AgentC)</dd>
+    </dl>
+
+    <hr />
+
+    <b>II. Tarifs élèves @anneePlus</b>
+    <br />
+    <br />
+    <text>Prix des forfaits (prix unitaire <b>minimum</b> fixé à <b>@param.Prix_Mini €</b>)</text>
+
+    <div class="form-group">
+        <table id="table-actions" class="table" style="width:80%">
+            <thead>
+                <tr>
+                    <th>
+                        Forfait
+                    </th>
+                    <th>
+                        Prix du forfait
+                    </th>
+                    <th>
+                        Nombre de jours d'ouverture prévu de la demi-pension
+                    </th>
+                    <th>
+                        Prix unitaire du repas (Prix du forfait / Nombre de jours)
+                    </th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr>
+                    <td>
+                        5 j
+                    </td>
+                    <td>
+                        @form.Prix_Forfait5j €
+                    </td>
+                    <td>
+                        @form.NbJours_Forfait5j
+                    </td>
+                    <td>
+                        @((form.Prix_Forfait5j.Value / form.NbJours_Forfait5j.Value).ToString("N2")) €
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        4 j
+                    </td>
+                    <td>
+                        @form.Prix_Forfait4j €
+                    </td>
+                    <td>
+                        @form.NbJours_Forfait4j
+                    </td>
+                    <td>
+                        @((form.Prix_Forfait4j.Value / form.NbJours_Forfait4j.Value).ToString("N2")) €
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        3 j
+                    </td>
+                    <td>
+                        @form.Prix_Forfait3j €
+                    </td>
+                    <td>
+                        @form.NbJours_Forfait3j
+                    </td>
+                    <td>
+                        @((form.Prix_Forfait3j.Value / form.NbJours_Forfait3j.Value).ToString("N2")) €
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        2 j
+                    </td>
+                    <td>
+                        @form.Prix_Forfait2j €
+                    </td>
+                    <td>
+                        @form.NbJours_Forfait2j
+                    </td>
+                    <td>
+                        @((form.Prix_Forfait2j.Value / form.NbJours_Forfait2j.Value).ToString("N2")) €
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        1 j
+                    </td>
+                    <td>
+                        @form.Prix_Forfait1j €
+                    </td>
+                    <td>
+                        @form.NbJours_Forfait1j
+                    </td>
+                    <td>
+                        @((form.Prix_Forfait1j.Value / form.NbJours_Forfait1j.Value).ToString("N2")) €
+                    </td>
+                </tr>
+            </tbody>
+        </table>
+    </div>
+
+    <dl class="dl-horizontal">
+        <dt>@Html.DisplayNameFor(model => form.Prix_Ticket)</dt>
+        <dd>@Html.DisplayFor(model => form.Prix_Ticket) €</dd>
+
+        <dt>@Html.DisplayNameFor(model => form.Tarif_Pension)</dt>
+        <dd>@Html.DisplayFor(model => form.Tarif_Pension) €</dd>
+    </dl>
+
+    <hr />
+
+    <b>III. Tarifs « commensaux » @anneePlus</b>
+    <br />
+    <br />
+
+    <dl class="dl-horizontal-bg">
+        <dt>@Html.DisplayNameFor(model => form.Prix_ATC)</dt>
+        <dd>@Html.DisplayFor(model => form.Prix_ATC) € <text><b> (défaut @param.Prix_ATC €)</b></text></dd>
+
+        <dt>@Html.DisplayNameFor(model => form.Prix_AgentC)</dt>
+        <dd>@Html.DisplayFor(model => form.Prix_AgentC) € <text><b> (défaut @param.Prix_AgentC €)</b></text></dd>
+
+        <dt>@Html.DisplayNameFor(model => form.Prix_Commensaux)</dt>
+        <dd>@Html.DisplayFor(model => form.Prix_Commensaux) € <text><b> (minimum @param.Prix_MiniAutres €)</b></text></dd>
+
+        <dt>@Html.DisplayNameFor(model => form.Prix_EcolePeri)</dt>
+        <dd>@Html.DisplayFor(model => form.Prix_EcolePeri) €</dd>
+    </dl>
+
+    <hr />
+
+    <b>IV. Nombre de repas encaissés en @anneeMoins</b> (données STAR, PRESTO, ALISE)
+    <br />
+    <br />
+
+    <div class="form-group">
+        <table id="table-actions" class="table">
+            <thead>
+                <tr>
+                    <th>
+                        Type de repas
+                    </th>
+                    <th>
+                        Nombre de repas
+                    </th>
+                    <th>
+                        Nombre de jours en @anneeMoins
+                    </th>
+                    <th>
+                        Moyenne du nombre de repas par jour
+                    </th>
+                    <th>
+                        Nom de l'établissement
+                    </th>
+                </tr>
+            </thead>
+            <tbody>
+                @for (int i = 0; i < repas.Count(); i++)
+                {
+
+                    <tr>
+                        <td>
+                            @repas[i].RestaurationTypesRepa.Libelle
+                        </td>
+                        <td>
+                            @repas[i].NbRepas
+                        </td>
+                        <td>
+                            @repas[i].NbJours
+                        </td>
+                        <td>
+                            @(@repas[i].NbRepas / @repas[i].NbJours)
+                        </td>
+                        <td>
+                            @repas[i].NomEtablissement
+                        </td>
+                    </tr>
+                }
+            </tbody>
+            <tfooter>
+            <tr>
+                <td>
+                    Total
+                </td>
+                <td>@ViewBag.SumTotal</td>
+                <td></td>
+                <td>@ViewBag.MoyenneTotal</td>
+                <td></td>
+            </tr>
+            </tfooter>
+        </table>
+    </div>
+
+    <hr />
+
+    <b>V. Participation au fond social ou impayés @anneeMoins</b>
+    <br />
+    <br />
+
+    <div class="form-group">
+        <table id="table-actions" class="table" style="width:40%">
+            <thead>
+                <tr>
+                    <th>
+                    </th>
+                    <th>
+                        Fond social
+                    </th>
+                    <th>
+                        Impayés
+                    </th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr>
+                    <td>
+                        Nombre d'élèves concernés
+                    </td>
+                    <td>
+                        @form.NbEleves_FondSocial
+                    </td>
+                    <td>
+                        @form.NbEleves_Impayes
+                    </td>
+                </tr>
+                <tr>
+                    <td>
+                        Montant
+                    </td>
+                    <td>
+                        @form.Montant_FondSocial
+                    </td>
+                    <td>
+                        @form.Montant_Impayes
+                    </td>
+                </tr>
+            </tbody>
+        </table>
+    </div>
+
+    <hr />
+
+    <text>Avis du conseil d'administration du collège recueilli en date du @form.Date_AvisCA.Value.ToShortDateString()</text><br />
+    <text><b>Signature du chef d'établissement :     </b></text><br />
+    @if (form.Ind_Signature == false)
+    {
+        <span class="fa fa-times fa-2x" style="color:red"></span> @Html.LabelFor(model => form.Ind_Signature, htmlAttributes: new { @class = "control-label" })
+    }
+    else
+    {
+        <span class="fa fa-check fa-2x" style="color:green"></span>@Html.LabelFor(model => form.Ind_Signature, htmlAttributes: new { @class = "control-label" })
+    }
+    <br /><br />
+          <div class="form-group btn-bar">
+
+              @if (param.Campagne == true)
+              {
+                  if (form.Statut == Constants.Statut.EN_COURS_DE_SAISIE.ToString())
+                  {
+                      @* Si c'est l'admin, il peut revenir à la liste *@
+                      <a href=@Url.Action("Index", "Restauration", new { annee_id = form.College.Annee_Id }) class="btn btn-default">Retour à la liste</a>
+
+
+                      <a href=@Url.Action("Edit", "RestaurationFormulaires", new { id = form.College_Id, mode = ModeAcces.Modification }) class="btn btn-primary">Modifier</a>
+                      <a href=@Url.Action("Finish", "RestaurationFormulaires", new { id = form.College_Id }) class="btn btn-primary">Terminer</a>
+                  }
+                  else if (form.Statut == Constants.Statut.PROPOSE.ToString())
+                  {
+                      @* Si c'est l'admin *@
+                      <a href=@Url.Action("Index", "Restauration", new { annee_id = form.College.Annee_Id }) class="btn btn-default">Retour à la liste</a>
+                      <a href=@Url.Action("Edit", "RestaurationFormulaires", new { id = form.College_Id, mode = ModeAcces.Modification }) class="btn btn-primary">Modifier</a>
+                      <a href=@Url.Action("Input", "RestaurationFormulaires", new { id = form.College_Id }) class="btn btn-primary">Réouverture au collège</a>
+                      <a href=@Url.Action("Validate", "RestaurationFormulaires", new { id = form.College_Id }) class="btn btn-primary">Valider</a>
+                  }
+                  else if (form.Statut == Constants.Statut.VALIDE.ToString())
+                  {
+                      @* Si c'est l'admin *@
+                      <a href=@Url.Action("Index", "Restauration", new { annee_id = form.College.Annee_Id }) class="btn btn-default">Retour à la liste</a>
+                      <a href=@Url.Action("Finish", "RestaurationFormulaires", new { id = form.College_Id }) class="btn btn-primary">Dé-valider</a>
+                  }
+              }
+              else
+              {
+                  @* Si c'est l'admin*@
+                  <a href=@Url.Action("Index", "Restauration", new { annee_id = form.College.Annee_Id }) class="btn btn-default">Retour à la liste</a>
+                  <a href=@Url.Action("Edit", "RestaurationFormulaires", new { id = form.College_Id, mode = ModeAcces.Modification }) class="btn btn-primary">Modifier</a>
+
+              }
+          </div>
+</div>

+ 353 - 0
CD67.FicheCollege.MVC/Views/RestaurationFormulaires/Edit.cshtml

@@ -0,0 +1,353 @@
+@using CD67.FicheCollege.MVC.Models
+@model RestaurationFormulaireViewModel
+
+@{
+    ViewBag.Title = "Modification";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+    RestaurationFormulaire form = Model.Obj;
+    int anneePlus = ViewBag.AnneeEnCours + 1;
+    int anneeMoins = ViewBag.AnneeEnCours - 1;
+    RestaurationParametre param = ViewBag.Param;
+    List<RestaurationFormulairesRepa> repas = Model.Obj.RestaurationFormulairesRepas.ToList();
+}
+
+<h2>
+    La Restauration - @form.College.Libelle
+    @if (form.College.RestaurationType_Id != null)
+    {
+        <text>(</text>@form.College.RestaurationType.Libelle<text>)</text>
+    }
+</h2>
+
+<hr />
+
+@using (Html.BeginForm())
+{
+    @Html.AntiForgeryToken()
+
+    <div class="form-horizontal">
+        <h4><b>PROPOSITIONS DE TARIFS DE RESTAURATION ET D'HEBERGEMENT POUR L'ANNEE @anneePlus</b></h4>
+        <hr />
+        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
+        @Html.HiddenFor(model => form.Id)
+        @Html.HiddenFor(model => form.College_Id)
+        @Html.HiddenFor(model => form.Statut)
+
+        <b>I. Nombre de demi-pensionnaires</b><br /><br />
+        <div class="form-group">
+            @Html.LabelFor(model => form.NbDP_College, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => form.NbDP_College, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.NbDP_College, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => form.NbDP_Lycee, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => form.NbDP_Lycee, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.NbDP_Lycee, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => form.NbDP_MatPrimPeri, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => form.NbDP_MatPrimPeri, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.NbDP_MatPrimPeri, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => form.NbDP_Commensaux, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => form.NbDP_Commensaux, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.NbDP_Commensaux, "", new { @class = "text-danger" })
+            </div>
+        </div>
+        <div class="form-group">
+            @Html.LabelFor(model => form.NbDP_ATC, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => form.NbDP_ATC, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.NbDP_ATC, "", new { @class = "text-danger" })
+            </div>
+        </div>
+        <div class="form-group">
+            @Html.LabelFor(model => form.NbDP_AgentC, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => form.NbDP_AgentC, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.NbDP_AgentC, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <hr />
+
+        <b>II. Tarifs élèves @anneePlus</b><br /><br />
+        <div class="form-group">
+            <div class="col-md-12">
+                <text>Prix des forfaits (prix unitaire <b>minimum</b> fixé à <b>@param.Prix_Mini €</b>)</text>
+            </div>
+        </div>
+
+        <div class="form-group">
+            <table id="table-actions" class="table">
+                <thead>
+                    <tr>
+                        <th>
+                            Forfait
+                        </th>
+                        <th>
+                            Prix du forfait
+                        </th>
+                        <th>
+                            Nombre de jours d'ouverture prévu de la demi-pension
+                        </th>
+                    </tr>
+                </thead>
+                <tbody>
+                    <tr>
+                        <td>
+                            5 j
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.Prix_Forfait5j, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.Prix_Forfait5j, "", new { @class = "text-danger" })
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.NbJours_Forfait5j, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.NbJours_Forfait5j, "", new { @class = "text-danger" })
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            4 j
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.Prix_Forfait4j, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.Prix_Forfait4j, "", new { @class = "text-danger" })
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.NbJours_Forfait4j, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.NbJours_Forfait4j, "", new { @class = "text-danger" })
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            3 j
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.Prix_Forfait3j, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.Prix_Forfait3j, "", new { @class = "text-danger" })
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.NbJours_Forfait3j, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.NbJours_Forfait3j, "", new { @class = "text-danger" })
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            2 j
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.Prix_Forfait2j, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.Prix_Forfait2j, "", new { @class = "text-danger" })
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.NbJours_Forfait2j, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.NbJours_Forfait2j, "", new { @class = "text-danger" })
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            1 j
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.Prix_Forfait1j, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.Prix_Forfait1j, "", new { @class = "text-danger" })
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.NbJours_Forfait1j, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.NbJours_Forfait1j, "", new { @class = "text-danger" })
+                        </td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => form.Prix_Ticket, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => form.Prix_Ticket, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.Prix_Ticket, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <div class="form-group">
+            @Html.LabelFor(model => form.Tarif_Pension, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => form.Tarif_Pension, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.Tarif_Pension, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <hr />
+
+        <b>III. Tarifs « commensaux » @anneePlus</b><br /><br />
+        <div class="form-group">
+            @Html.LabelFor(model => form.Prix_ATC, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => form.Prix_ATC, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.Prix_ATC, "", new { @class = "text-danger" })
+                <text><b>(défaut @param.Prix_ATC €)</b></text>
+            </div>
+        </div>
+        <div class="form-group">
+            @Html.LabelFor(model => form.Prix_AgentC, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => form.Prix_AgentC, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.Prix_AgentC, "", new { @class = "text-danger" })
+                <text><b>(défaut @param.Prix_AgentC €)</b></text>
+            </div>
+        </div>
+        <div class="form-group">
+            @Html.LabelFor(model => form.Prix_Commensaux, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => form.Prix_Commensaux, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.Prix_Commensaux, "", new { @class = "text-danger" })
+                <text><b>(minimum @param.Prix_MiniAutres €)</b></text>
+            </div>
+        </div>
+        <div class="form-group">
+            @Html.LabelFor(model => form.Prix_EcolePeri, htmlAttributes: new { @class = "control-label col-md-2" })
+            <div class="col-md-10">
+                @Html.EditorFor(model => form.Prix_EcolePeri, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.Prix_EcolePeri, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <hr />
+
+        <b>IV. Nombre de repas encaissés en @anneeMoins</b> (données STAR, PRESTO, ALISE)<br /><br />
+
+        <div class="form-group">
+            <table id="table-actions" class="table">
+                <thead>
+                    <tr>
+                        <th>
+                            Type de repas
+                        </th>
+                        <th>
+                            Nombre de repas
+                        </th>
+                        <th>
+                            Nombre de jours en @anneeMoins
+                        </th>
+                        <th>
+                            Nom de l'établissement
+                        </th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @for (int i = 0; i < repas.Count(); i++)
+                    {
+                        <tr>
+                            <td>
+                                @repas[i].RestaurationTypesRepa.Libelle
+                                @Html.HiddenFor(model => repas[i].Id)
+                                @Html.HiddenFor(model => repas[i].RestaurationFormulaires_Id)
+                                @Html.HiddenFor(model => repas[i].RestaurationTypesRepas_Id)
+                            </td>
+                            <td>
+                                @Html.EditorFor(model => repas[i].NbRepas, new { htmlAttributes = new { @class = "form-control" } })
+                                @Html.ValidationMessageFor(model => repas[i].NbRepas, "", new { @class = "text-danger" })
+                            </td>
+                            <td>
+                                @Html.EditorFor(model => repas[i].NbJours, new { htmlAttributes = new { @class = "form-control" } })
+                                @Html.ValidationMessageFor(model => repas[i].NbJours, "", new { @class = "text-danger" })
+                            </td>
+                            <td>
+                                @Html.EditorFor(model => repas[i].NomEtablissement, new { htmlAttributes = new { @class = "form-control" } })
+                                @Html.ValidationMessageFor(model => repas[i].NomEtablissement, "", new { @class = "text-danger" })
+                            </td>
+                        </tr>
+                    }
+                </tbody>
+            </table>
+        </div>
+
+        <hr />
+
+        <b>V. Participation au fond social ou impayés @anneeMoins</b><br /><br />
+
+        <div class="form-group">
+            <table id="table-actions" class="table">
+                <thead>
+                    <tr>
+                        <th>
+                        </th>
+                        <th>
+                            Fond social
+                        </th>
+                        <th>
+                            Impayés
+                        </th>
+                    </tr>
+                </thead>
+                <tbody>
+                    <tr>
+                        <td>
+                            Nombre d'élèves concernés
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.NbEleves_FondSocial, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.NbEleves_FondSocial, "", new { @class = "text-danger" })
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.NbEleves_Impayes, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.NbEleves_Impayes, "", new { @class = "text-danger" })
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            Montant
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.Montant_FondSocial, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.Montant_FondSocial, "", new { @class = "text-danger" })
+                        </td>
+                        <td>
+                            @Html.EditorFor(model => form.Montant_Impayes, new { htmlAttributes = new { @class = "form-control" } })
+                            @Html.ValidationMessageFor(model => form.Montant_Impayes, "", new { @class = "text-danger" })
+                        </td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
+
+        <hr />
+
+        <div class="form-group">
+            @Html.Label("Avis du conseil d'administration du collège recueilli en date du", htmlAttributes: new { @class = "control-label col-md-5" })
+
+            <div class="col-md-7">
+                @Html.EditorFor(model => form.Date_AvisCA, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.Date_AvisCA, "", new { @class = "text-danger" })
+            </div>
+        </div>
+
+        <b>Signature du chef d'établissement : </b> <br /><br />
+        <div class="form-group">
+            <div class="col-md-1">
+                @Html.EditorFor(model => form.Ind_Signature, new { htmlAttributes = new { @class = "form-control" } })
+                @Html.ValidationMessageFor(model => form.Ind_Signature, "", new { @class = "text-danger" })
+            </div>
+            @Html.LabelFor(model => form.Ind_Signature, htmlAttributes: new { @class = "control-label" })
+        </div>
+
+        <div class="form-group btn-bar">
+            <a href=@Url.Action("Index", "Restauration", new { annee_id = form.College.Annee_Id }) class="btn btn-default">Annuler</a>
+            <input type="submit" value="Enregistrer" class="btn btn-primary" />
+        </div>
+
+    </div>
+}

+ 2 - 2
CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Edit.cshtml → CD67.FicheCollege.MVC/Views/RestaurationTypesRepas/Edit.cshtml

@@ -1,10 +1,10 @@
 @using CD67.FicheCollege.MVC.Models
-@model RestaurationTypeRepaViewModel
+@model RestaurationTypesRepaViewModel
 
 @{
     ViewBag.Title = Model.Acces.ToString();
     Layout = "~/Views/Shared/_AdminLayout.cshtml";
-    RestaurationTypeRepa repas = Model.Obj;
+    RestaurationTypesRepa repas = Model.Obj;
 }
 
 @if (Model.Acces == ModeAcces.Modification)

+ 1 - 1
CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Index.cshtml → CD67.FicheCollege.MVC/Views/RestaurationTypesRepas/Index.cshtml

@@ -1,5 +1,5 @@
 @using CD67.FicheCollege.MVC.Models
-@model RestaurationTypeRepaIndexViewModel
+@model RestaurationTypesRepaIndexViewModel
 
 @{
     ViewBag.Title = "Types de Repas";

+ 12 - 0
CD67.FicheCollege.MVC/Views/Shared/DisplayTemplates/RestaurationStatut.cshtml

@@ -0,0 +1,12 @@
+@using CD67.FicheCollege.Entity
+@model string
+@{
+    string val = "";
+    if (Model != null)
+    {
+        Constants.Statut statut = (Constants.Statut)Enum.Parse(typeof(Constants.Statut), Model);
+        val = statut.EnumDisplayNameFor(MvcHtmlHelpers.DisplayValue.Description).ToString();
+    }
+}
+
+@val