|
@@ -9,7 +9,7 @@ namespace CD67.FicheCollege.Factory
|
|
|
{
|
|
{
|
|
|
public partial class AnneeFactory : Internal.BaseFactory<Entity.Annee>
|
|
public partial class AnneeFactory : Internal.BaseFactory<Entity.Annee>
|
|
|
{
|
|
{
|
|
|
- public AnneeFactory(Entities dbContext) : base(dbContext) { }
|
|
|
|
|
|
|
+ //public AnneeFactory(Entities dbContext) : base(dbContext) { }
|
|
|
|
|
|
|
|
public Annee getByLibelle(params object[] keyValues)
|
|
public Annee getByLibelle(params object[] keyValues)
|
|
|
{
|
|
{
|
|
@@ -30,5 +30,20 @@ namespace CD67.FicheCollege.Factory
|
|
|
return annee;
|
|
return annee;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Retourne l'id de l'année courante
|
|
|
|
|
+ public int get_current_year_id()
|
|
|
|
|
+ {
|
|
|
|
|
+ string annee_lib;
|
|
|
|
|
+ if (DateTime.Now.Month <= 7)
|
|
|
|
|
+ {
|
|
|
|
|
+ annee_lib = String.Format("{0}-{1}", DateTime.Now.Year - 1, DateTime.Now.Year);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ annee_lib = String.Format("{0}-{1}", DateTime.Now.Year, DateTime.Now.Year + 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ return dbContext.Annees.Where(a => a.Libelle == annee_lib).First().Id;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|