예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="firstAndLastName"></param>
 /// <returns></returns>
 public static Student GetStudentByFullName(string firstAndLastName)
 {
     using (var db = new Ef())
     {
         return(db.Student.SingleOrDefault(s => s.FirstName + s.LastName == firstAndLastName));
     }
 }
예제 #2
0
 /// <summary>
 /// Renvoi la List de Tous les Annee Scolaires
 /// </summary>
 /// <returns>Une Dictionaire</returns>
 public Dictionary <string, string> GetAllAnneeScolaires()
 {
     using (var db = new Ef())
     {
         return(db.AnneeScolaire.OrderBy(a => a.DateDebut).ToDictionary(a => a.Name, a => a.AnneeScolaireGuid.ToString()));
     }
 }
예제 #3
0
 private static Guid GetCoursAnneeScolaireGuid(Guid coursGuid)
 {
     using (var db = new Ef())
     {
         return(db.PeriodeScolaire.Find(db.Cours.Find(coursGuid).PeriodeScolaireGuid)?.AnneeScolaireGuid ?? GetCurrentAnneeScolaireGuid);
     }
 }
예제 #4
0
 private void GetCLASSES_COUNT()
 {
     using (var db = new Ef())
     {
         ClassesCount = db.Classe.Count(c => c.FiliereGuid == FiliereGuid);
     }
 }
예제 #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="inscriptionGuid"></param>
 /// <returns></returns>
 public Inscription GetInscriptionById(Guid inscriptionGuid)
 {
     using (var db = new Ef())
     {
         return(db.Inscription.Find(inscriptionGuid));
     }
 }
예제 #6
0
 /// <summary>
 /// Renvoi les matieres Enregistrees pour cette classe
 /// </summary>
 /// <param name="classeId"></param>
 /// <returns></returns>
 public List <Matiere> GetClassMatieres(Guid classeId)
 {
     using (var db = new Ef())
     {
         return(db.Matiere.Where(m => m.ClasseGuid == classeId).ToList());
     }
 }
예제 #7
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public List <Classe> GetAllClasse()
 {
     using (var db = new Ef())
     {
         return(db.Classe.ToList());
     }
 }
예제 #8
0
 private void GetSTAFF_COUNT( )
 {
     using (var db = new Ef())
     {
         StaffCount = string.IsNullOrEmpty(DepartementName) ? db.Staff.Count(s => string.IsNullOrEmpty(s.Departement)) : db.Staff.Count(s => s.Departement == DepartementName);
     }
 }
예제 #9
0
파일: HRManager.cs 프로젝트: war-man/Matrix
 /// <summary>
 ///
 /// </summary>
 /// <param name="depName"></param>
 /// <returns></returns>
 public List <Staff> GetDepStaffs(string depName = null)
 {
     using (var db = new Ef())
     {
         return(depName == null?db.Staff.Where(s => string.IsNullOrEmpty(s.Departement)).OrderBy(s => s.LastName).ToList() : db.Staff.Where(s => s.Departement == depName).OrderBy(s => s.LastName).ToList());
     }
 }
예제 #10
0
        /// <summary>
        /// Modifier Un Parametre
        /// </summary>
        /// <returns></returns>
        public bool SetSetting(Guid userProfileId, Settings mySetting, string newValue)
        {
            using (var db = new Ef())
            {
                //var firstOrDefault = db.Setting.FirstOrDefault(s => s.UserProfileId == userProfileId && s.SettingNum == (int)mySetting);

                //if (firstOrDefault != null)
                //{
                //    firstOrDefault.SettingValue = newValue;
                //}
                //else
                //{
                //    var newSetting = new Setting
                //    {
                //        SettingId = Guid.NewGuid(),
                //        UserProfileId = userProfileId,
                //        SettingNum = (int)mySetting,
                //        SettingValue = newValue
                //    };
                //    AddSetting(newSetting);
                //}

                return(db.SaveChanges() > 0);
            }
        }
예제 #11
0
        /// <summary>
        /// Retourne les Informations d'une Journee Avec la liste de ses Cours
        /// </summary>
        /// <param name="classId">ID de la Classe</param>
        /// <param name="scheduleDate"> Date De la Journee</param>
        public DayCoursCards(Guid classId, DateTime scheduleDate)
        {
            DayCours = new List <CoursCard> ();

            DayName = scheduleDate.DayOfWeek.ToString().ToUpper();

            DayColor = scheduleDate == DateTime.Today ? "Green" : "#25A0DA";        // "Beige"; //"#25A0DA";

            DayDate = scheduleDate;

            using (var db = new Ef())
            {
                var myCours = db.Cours.Where(c => c.ClasseGuid == classId && c.StartDate <= scheduleDate && c.EndDate >= scheduleDate).OrderBy(c => c.StartTime);

                foreach (var cr in myCours)
                {
                    var dayNum = (int)scheduleDate.DayOfWeek;

                    if (cr.RecurrenceDays.Contains(dayNum.ToString()))
                    {
                        DayCours.Add(new CoursCard(cr, scheduleDate));
                    }
                }
            }
        }
예제 #12
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public List <Matiere> GetAllMatieres()
 {
     using (var db = new Ef())
     {
         return(db.Matiere.ToList());
     }
 }
예제 #13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="matiereId"></param>
 /// <returns></returns>
 public bool MatiereExist(Guid matiereId)
 {
     using (var db = new Ef())
     {
         return(db.Matiere.Find(matiereId) != null);
     }
 }
예제 #14
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public IEnumerable GetAllMatieresNames()
 {
     using (var db = new Ef())
     {
         return(db.Matiere.Select(m => m.Name).ToList());
     }
 }
예제 #15
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="classeId"></param>
 /// <returns></returns>
 public string GetClasseName(Guid classeId)
 {
     using (var db = new Ef())
     {
         return(db.Classe.Find(classeId).Name);
     }
 }
예제 #16
0
파일: HRManager.cs 프로젝트: war-man/Matrix
 /// <summary>
 ///
 /// </summary>
 /// <param name="staffGuid"></param>
 /// <returns></returns>
 public string GetStaffFullName(Guid staffGuid)
 {
     using (var db = new Ef())
     {
         return(db.Staff.Find(staffGuid).FullName);
     }
 }
예제 #17
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="classeId"></param>
 /// <returns></returns>
 public bool ClasseExist(string classeId)
 {
     using (var db = new Ef())
     {
         return(db.Classe.Find(classeId) != null);
     }
 }
예제 #18
0
파일: HRManager.cs 프로젝트: war-man/Matrix
 /// <summary>
 ///
 /// </summary>
 /// <param name="staffId"></param>
 /// <returns></returns>
 public string GetStaffFullName(string staffId)
 {
     using (var db = new Ef())
     {
         return(db.Staff.First(s => s.StaffId == staffId).FullName);
     }
 }
예제 #19
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="classeId"></param>
 /// <returns></returns>
 public Classe GetClasseById(Guid classeId)
 {
     using (var db = new Ef())
     {
         return(db.Classe.Find(classeId));
     }
 }
예제 #20
0
파일: HRManager.cs 프로젝트: war-man/Matrix
 /// <summary>
 ///
 /// </summary>
 /// <param name="staffId"></param>
 /// <returns></returns>
 public bool StaffIdExist(string staffId)
 {
     using (var db = new Ef())
     {
         return(db.Staff.Any(s => s.StaffId == staffId));
     }
 }
예제 #21
0
        /// <summary>
        /// Return La Valeur du Paramettre System
        /// </summary>
        /// <param name="systemSetting"></param>
        /// <returns></returns>
        public object GetMatrixSetting(MatrixSettings systemSetting)
        {
            using (var db = new Ef())
            {
                if (db.SystemSetting.Find(MatrixConstants.SystemGuid()) == null)
                {
                    db.SystemSetting.Add(new MatrixSetting());
                }

                switch (systemSetting)
                {
                case MatrixSettings.CurrentAnneeScolaire:
                    return(db.SystemSetting.Find(MatrixConstants.SystemGuid()).CurrentAnneeScolaireGuid);

                case MatrixSettings.CurrentPerodeScolaire:
                    return(db.SystemSetting.Find(MatrixConstants.SystemGuid()).CurrentPeriodeScolaireGuid);

                case MatrixSettings.EtablissementName:
                    return(db.SystemSetting.Find(MatrixConstants.SystemGuid()).EtablissementName);

                case MatrixSettings.EtablissementFax:
                    return(db.SystemSetting.Find(MatrixConstants.SystemGuid()).EtablissementFax);

                case MatrixSettings.EtablissementLogo:
                    return(db.SystemSetting.Find(MatrixConstants.SystemGuid()).EtablissementLogo);

                default:
                    return(null);
                }
            }
        }
예제 #22
0
파일: HRManager.cs 프로젝트: war-man/Matrix
 /// <summary>
 ///
 /// </summary>
 /// <param name="staffGuid"></param>
 /// <returns></returns>
 public Staff GetStaffByGuid(Guid staffGuid)
 {
     using (var db = new Ef())
     {
         return(db.Staff.Find(staffGuid));
     }
 }
예제 #23
0
 /// <summary>
 /// Verifier si ce ID est Deja Utilisee
 /// </summary>
 /// <param name="insId"></param>
 /// <returns></returns>
 public bool InscExist(string insId)
 {
     using (var db = new Ef())
     {
         return(db.Inscription.Any(i => i.InscriptionId == insId));
     }
 }
예제 #24
0
파일: HRManager.cs 프로젝트: war-man/Matrix
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public List <Staff> GetAllStaffs()
 {
     using (var db = new Ef())
     {
         return(db.Staff.ToList());
     }
 }
예제 #25
0
 /// <summary>
 /// Return true si l'Etudiant est Inscrit
 /// </summary>
 /// <returns>True or False</returns>
 public bool IsStudentInsc(Guid studentGuid, Guid currentAnneeScolaireGuid)
 {
     using (var db = new Ef())
     {
         return(db.Inscription.Any(i => i.AnneeScolaireGuid == currentAnneeScolaireGuid && i.StudentGuid == studentGuid));
     }
 }
예제 #26
0
파일: CoursCard.cs 프로젝트: war-man/Matrix
        private void ResolveData(DateTime coursDay, Guid matiereGuid, Guid staffGuid)
        {
            using (var db = new Ef())
            {
                var m = db.Matiere.Find(matiereGuid);

                MatiereName = m.Name.Substring(0, 1).ToUpper() + m.Name.Substring(1).ToLower();
                Couleur     = m.Couleur;

                StaffFullName = db.Staff.Find(staffGuid).FullName;
            }

            if (coursDay < DateTime.Today)
            {
                ForeColor = "Gray";
            }
            else if (coursDay == DateTime.Today)
            {
                if (EndTime < DateTime.Now.TimeOfDay)
                {
                    ForeColor = "Gray";
                }

                if (StartTime <= DateTime.Now.TimeOfDay && EndTime >= DateTime.Now.TimeOfDay)
                {
                    ForeColor = "Red";
                }
            }
        }
예제 #27
0
 private static Guid GetCoursStaffGuid(Guid coursGuid)
 {
     using (var db = new Ef())
     {
         return(db.Cours.Find(coursGuid).StaffGuid);
     }
 }
예제 #28
0
        /// <summary>
        /// Constructeur
        /// </summary>
        public StudentCard(Student currentStudent, AnneeScolaire currentAnneeScolaire)
        {
            StudentGuid   = currentStudent.StudentGuid;
            Title         = currentStudent.Title;
            Firstname     = currentStudent.FirstName;
            Lastname      = currentStudent.LastName;
            PhotoIdentity = currentStudent.PhotoIdentity;
            PhoneNumber   = currentStudent.PhoneNumber;
            EmailAdress   = currentStudent.EmailAdress;
            HomeAdress    = currentStudent.HomeAdress;

            using (var db = new Ef())
            {
                var currentInscription = db.Inscription.First(i => i.AnneeScolaireGuid == currentAnneeScolaire.AnneeScolaireGuid);

                if (currentInscription != null)
                {
                    var currentClasse = db.Classe.Find(currentInscription.ClasseGuid);

                    CurrentClasseLevel = currentClasse.Name;
                    CurrentFiliere     = db.Filiere.Find(currentClasse.FiliereGuid).Name;
                }
                else
                {
                    CurrentClasseLevel = "Non Inscrit";
                    CurrentFiliere     = "Non Inscrit";
                }
            }
        }
예제 #29
0
 private static Matiere GetMatiereById(Guid matiereId)
 {
     using (var db = new Ef())
     {
         return(db.Matiere.Find(matiereId));
     }
 }
예제 #30
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="studentGuid"></param>
 /// <returns></returns>
 public Student GetStudentByGuid(Guid studentGuid)
 {
     using (var db = new Ef())
     {
         return(db.Student.Find(studentGuid));
     }
 }