//private List<News> ListNews //{ // get // { // if (_listNews == null) // { // _listNews = ChargerLesNews(); // } // return _listNews; // } // set { _listNews = value; } //} public static Journalist ChargerUnJournalist(int idJourn) { List <Dictionary <string, object> > UnJournalist = GestionConnexion.Instance.getData("select * from Journalist where idJournalist=" + idJourn); Journalist jou = Associe(UnJournalist[0]); return(jou); }
public static Journalist AuthentifieMoi(string login, string password) { List <Dictionary <string, object> > infoJournalist = GestionConnexion.Instance.getData("Select * from Journalist where LoginJournalist='" + login + "' and PasswordJournalist='" + password + "'"); Journalist retour = null; if (infoJournalist.Count > 0) { int idJournalist = (int)infoJournalist[0]["idJournalist"]; retour = Journalist.ChargerUnJournalist(idJournalist); } return(retour); }
private static Journalist Associe(Dictionary <string, object> item) { Journalist jou = new Journalist() { IdJournalist = (int)item["idJournalist"], NameJournalist = item["NameJournalist"].ToString(), FirstNameJournalist = item["FirstNameJournalist"].ToString(), LoginJournalist = item["LoginJournalist"].ToString(), PasswordJournalist = item["PasswordJournalist"].ToString(), }; return(jou); }