/// <summary> /// Permet de charger une ITLang de la DB via sa clé primaire /// </summary> /// <param name="idit">Identifiant unique de l' ITLang</param> /// <returns>l'ITLang correspondante</returns> public static ITLang ChargerUneITLang(int idit) { List <Dictionary <string, object> > UneItLang = GestionConnexion.Instance.getData("select * from ITLang where idIT=" + idit); ITLang lan = Associe(UneItLang[0]); return(lan); }
/// <summary> /// Permet d'associer les infos récupérées de la DB avec les propriété d'une ITLang /// </summary> /// <param name="UneItLang">Un dictionnaire contenant les données BD</param> /// <returns>L'ITLang remplie</returns> private static ITLang Associe(Dictionary <string, object> UneItLang) { ITLang lan = new ITLang(); lan.IdIT = (int)UneItLang["idIT"]; lan.ITLabel = UneItLang["ITLabel"].ToString(); return(lan); }
/// <summary> /// Permet de charger les langues associées à la catégorie courante /// </summary> /// <returns>une liste contenant les langues associées à la catégorie courante</returns> private List <ITLang> ChargerLesITLangs() { string query = @"select i.idIT,i.ITLabel from ITLang i inner join LangCateg c on c.idIT = i.idIT where c.idCategory =" + this.IdCategory; List <ITLang> retour = new List <ITLang>(); List <Dictionary <string, object> > MesLangs = GestionConnexion.Instance.getData(query); foreach (Dictionary <string, object> item in MesLangs) { ITLang l = new ITLang(); l.IdIT = (int)item["idIT"]; l.ITLabel = item["ITLabel"].ToString(); retour.Add(l); } return(retour); }