Browse Source

Mise à jour corrective de la base et de l'edmx

olivier.massot 7 years ago
parent
commit
d82294ed02

+ 1 - 1
CD67.FicheCollege.BDD/Actions-CLAS.sql

@@ -1,6 +1,6 @@
 CREATE TABLE [dbo].[Actions-CLAS]
 (
-	[College_Id] NVARCHAR(8) NOT NULL PRIMARY KEY, 
+	[College_Id] INT NOT NULL PRIMARY KEY, 
     [Action] BIT NULL, 
     [Commentaire] NTEXT NULL, 
     CONSTRAINT [FK_Actions-CLAS_College] FOREIGN KEY ([College_Id]) REFERENCES [Colleges]([Id])

+ 5 - 4
CD67.FicheCollege.BDD/Colleges.sql

@@ -1,20 +1,21 @@
 CREATE TABLE [dbo].[Colleges]
 (
-	[Id] NVARCHAR(8) NOT NULL PRIMARY KEY, 
-	[Libelle] NVARCHAR(255) NOT NULL, 
+	[Id] INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
+    [Annee_Id] int  NOT NULL,
+	[CodeRne] NVARCHAR(10) NOT NULL, 
+	[Libelle] NVARCHAR(255) NOT NULL,
 	[Adresse] NVARCHAR(255) NULL, 
 	[Code_Postal] NVARCHAR(5) NULL, 
     [TypeCollege_Id] INT NOT NULL, 
 	[Commune_Insee] NVARCHAR(5) NULL, 
 	[Commune] NVARCHAR(255) NOT NULL, 
     [Canton] NVARCHAR(255) NULL, 
-    [Territoire_Id] NVARCHAR(10) NULL, 
+    [Territoire_Id] NVARCHAR(10) NULL,
     [TAD] NVARCHAR(255) NULL, 
     [CDC] NVARCHAR(255) NULL, 
 	[Tel] NVARCHAR(255) NULL,
 	[Fax] NVARCHAR(255) NULL,
 	[Email] NVARCHAR(255) NULL,
-    [Annee_Id] int  NOT NULL
     CONSTRAINT [FK_Colleges_TypesCollege] FOREIGN KEY ([TypeCollege_Id]) REFERENCES [TypesCollege]([Id]), 
     CONSTRAINT [FK_Colleges_Territoires] FOREIGN KEY ([Territoire_Id]) REFERENCES [Territoires]([Id]),
     CONSTRAINT [FK_Annees_Colleges] FOREIGN KEY ([Annee_Id]) REFERENCES [Annees]([Id])

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

@@ -1,6 +1,6 @@
 CREATE TABLE [dbo].[Identites]
 (
-	[College_Id] NVARCHAR(8) NOT NULL PRIMARY KEY, 
+	[College_Id] INT NOT NULL PRIMARY KEY, 
 	[Principal_SID] NVARCHAR(64) NULL, 
 	[Principal_Login] NVARCHAR(255) NULL, 
     [Principal_Nom] NVARCHAR(255) NULL, 

+ 1 - 1
CD67.FicheCollege.Entity/ActionCLAS.cs

@@ -14,7 +14,7 @@ namespace CD67.FicheCollege.Entity
     
     public partial class ActionCLAS
     {
-        public string College_Id { get; set; }
+        public int College_Id { get; set; }
         public Nullable<bool> Action { get; set; }
         public string Commentaire { get; set; }
     

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

@@ -14,7 +14,9 @@ namespace CD67.FicheCollege.Entity
     
     public partial class College
     {
-        public string Id { get; set; }
+        public int Id { get; set; }
+        public int Annee_Id { get; set; }
+        public string CodeRne { get; set; }
         public string Libelle { get; set; }
         public string Adresse { get; set; }
         public string Code_Postal { get; set; }
@@ -28,7 +30,6 @@ namespace CD67.FicheCollege.Entity
         public string Tel { get; set; }
         public string Fax { get; set; }
         public string Email { get; set; }
-        public int Annee_Id { get; set; }
     
         public virtual Territoire Territoire { get; set; }
         public virtual TypeCollege TypeCollege { get; set; }

+ 12 - 9
CD67.FicheCollege.Entity/EntityModel.edmx

@@ -9,7 +9,7 @@
           <Key>
             <PropertyRef Name="College_Id" />
           </Key>
-          <Property Name="College_Id" Type="nvarchar" MaxLength="8" Nullable="false" />
+          <Property Name="College_Id" Type="int" Nullable="false" />
           <Property Name="Action" Type="bit" />
           <Property Name="Commentaire" Type="ntext" />
         </EntityType>
@@ -24,7 +24,9 @@
           <Key>
             <PropertyRef Name="Id" />
           </Key>
-          <Property Name="Id" Type="nvarchar" MaxLength="8" Nullable="false" />
+          <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
+          <Property Name="Annee_Id" Type="int" Nullable="false" />
+          <Property Name="CodeRne" Type="nvarchar" MaxLength="10" Nullable="false" />
           <Property Name="Libelle" Type="nvarchar" MaxLength="255" Nullable="false" />
           <Property Name="Adresse" Type="nvarchar" MaxLength="255" />
           <Property Name="Code_Postal" Type="nvarchar" MaxLength="5" />
@@ -38,13 +40,12 @@
           <Property Name="Tel" Type="nvarchar" MaxLength="255" />
           <Property Name="Fax" Type="nvarchar" MaxLength="255" />
           <Property Name="Email" Type="nvarchar" MaxLength="255" />
-          <Property Name="Annee_Id" Type="int" Nullable="false" />
         </EntityType>
         <EntityType Name="Identites">
           <Key>
             <PropertyRef Name="College_Id" />
           </Key>
-          <Property Name="College_Id" Type="nvarchar" MaxLength="8" Nullable="false" />
+          <Property Name="College_Id" Type="int" Nullable="false" />
           <Property Name="Principal_SID" Type="nvarchar" MaxLength="64" />
           <Property Name="Principal_Login" Type="nvarchar" MaxLength="255" />
           <Property Name="Principal_Nom" Type="nvarchar" MaxLength="255" />
@@ -244,7 +245,9 @@
           <Key>
             <PropertyRef Name="Id" />
           </Key>
-          <Property Name="Id" Type="String" Nullable="false" MaxLength="8" FixedLength="false" Unicode="true" />
+          <Property Name="Id" Type="Int32" Nullable="false" />
+          <Property Name="Annee_Id" Type="Int32" Nullable="false" />
+          <Property Name="CodeRne" Type="String" Nullable="false" MaxLength="10" FixedLength="false" Unicode="true" />
           <Property Name="Libelle" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="true" />
           <Property Name="Adresse" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
           <Property Name="Code_Postal" Type="String" MaxLength="5" FixedLength="false" Unicode="true" />
@@ -262,7 +265,6 @@
           <NavigationProperty Name="TypeCollege" Relationship="CD67.FicheCollege.FK_Colleges_TypesCollege" FromRole="College" ToRole="TypeCollege" />
           <NavigationProperty Name="Identite" Relationship="CD67.FicheCollege.FK_FicheIdentite_College" FromRole="College" ToRole="Identite" />
           <NavigationProperty Name="Annee" Relationship="CD67.FicheCollege.AnneeCollege" FromRole="College" ToRole="Annee" />
-          <Property Name="Annee_Id" Type="Int32" Nullable="false" />
           <NavigationProperty Name="Actions_CLAS" Relationship="CD67.FicheCollege.FK_Actions_CLAS_College" FromRole="College" ToRole="Actions_CLAS" />
         </EntityType>
         <Association Name="FK_Colleges_Territoires">
@@ -293,7 +295,7 @@
           <Key>
             <PropertyRef Name="College_Id" />
           </Key>
-          <Property Name="College_Id" Type="String" Nullable="false" MaxLength="8" FixedLength="false" Unicode="true" />
+          <Property Name="College_Id" Type="Int32" Nullable="false" />
           <Property Name="Principal_SID" Type="String" MaxLength="64" FixedLength="false" Unicode="true" />
           <Property Name="Principal_Login" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
           <Property Name="Principal_Nom" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
@@ -360,7 +362,7 @@
           <Key>
             <PropertyRef Name="College_Id" />
           </Key>
-          <Property Name="College_Id" Type="String" Nullable="false" MaxLength="8" FixedLength="false" Unicode="true" />
+          <Property Name="College_Id" Type="Int32" Nullable="false" />
           <Property Name="Action" Type="Boolean" />
           <Property Name="Commentaire" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
           <NavigationProperty Name="College" Relationship="CD67.FicheCollege.FK_Actions_CLAS_College" FromRole="Actions_CLAS" ToRole="College" />
@@ -410,7 +412,8 @@
     <EntitySetMapping Name="Colleges">
       <EntityTypeMapping TypeName="IsTypeOf(CD67.FicheCollege.College)">
         <MappingFragment StoreEntitySet="Colleges">
-          <ScalarProperty Name="Id" ColumnName="Id" />
+          <ScalarProperty Name="CodeRne" ColumnName="CodeRne" />
+                <ScalarProperty Name="Id" ColumnName="Id" />
           <ScalarProperty Name="Libelle" ColumnName="Libelle" />
           <ScalarProperty Name="Adresse" ColumnName="Adresse" />
           <ScalarProperty Name="Code_Postal" ColumnName="Code_Postal" />

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

@@ -22,9 +22,13 @@ namespace CD67.FicheCollege.Entity
     public class College_Metadata
     {
         [Required]
-        [Display(Name = "Code RNE du collège")]
         public string Id { get; set; }
         [Required]
+        [Display(Name = "Code RNE du collège")]
+        public string CodeRne { get; set; }
+        [Display(Name = "Année scolaire")]
+        public string Annee_Id { get; set; }
+        [Required]
         [Display(Name = "Collège")]
         public string Libelle { get; set; }
         [Display(Name = "Code postal")]
@@ -35,6 +39,5 @@ namespace CD67.FicheCollege.Entity
         public string Territoire_Id { get; set; }
         [Display(Name = "Canton de rattachement")]
         public string Canton { get; set; }
-
     }
 }

+ 1 - 1
CD67.FicheCollege.Entity/Identite.cs

@@ -14,7 +14,7 @@ namespace CD67.FicheCollege.Entity
     
     public partial class Identite
     {
-        public string College_Id { get; set; }
+        public int College_Id { get; set; }
         public string Principal_SID { get; set; }
         public string Principal_Login { get; set; }
         public string Principal_Nom { get; set; }