public int GetIdByProperties(string name, int RefectoryId, RegimeEnum RegimeType) { ApplicationDbContext context = ApplicationDbContext.GetDbContext(); Table table = context.Tables.FirstOrDefault(d => d.Name.Equals(name) && d.RefectoryId == RefectoryId && d.RegimeType == RegimeType); return((table == null)? 0 : table.Id); }
protected TableEntry GetTableEntry(RegimeEnum refType) { if (this.ListAvailableTables.IsNullOrEmpty() || !this.ListAvailableTables.ContainsKey(refType) || this.ListAvailableTables[refType].IsNullOrEmpty()) { Console.WriteLine("GetTableEntry(): No table available!"); return(null); } return(this.ListAvailableTables[refType].Pop()); }
public static string RegimeToString(this RegimeEnum type) { switch (type) { case RegimeEnum.CLERICAL: return("Clergé"); case RegimeEnum.COOKING: return("Cuisine"); case RegimeEnum.DISABLED: return("Handicapé"); case RegimeEnum.FULL_MEMBER: return("Membre Plein"); case RegimeEnum.GENERAL_MANAGER: return("Responsable Général"); case RegimeEnum.HEALTH_SERVICE: return("Service Santé"); case RegimeEnum.MUSIC_INSTRUMENT_SERVICE: return("Service Instrument"); case RegimeEnum.NEW_BORN: return("Nouveaux-né"); case RegimeEnum.RELIGIOUS: return("Réligieux"); case RegimeEnum.SECOND_LANGUAGE: return("Seconde Langue"); case RegimeEnum.SONG_SERVICE: return("Service Chant"); case RegimeEnum.SPECIAL_GUEST: return("Invite Spécial"); case RegimeEnum.TRANSLATION_SERVICE: return("Service Traduction"); case RegimeEnum.WITHOUT_SALT_WITHOUT_OIL: return("Sans Sel - sans Huile"); case RegimeEnum.NONE: default: return("Sans Régime"); } }