public int DeleteEquipe(PROPUser Equipe) { SQLHelper sqlHelper = new SQLHelper(); List <MySqlParameter> lstParameter = new List <MySqlParameter>(); lstParameter.Add(new MySqlParameter("_EquipeID", Equipe.Id)); return(sqlHelper.executeSP <int>(lstParameter, "DeleteEquipe")); }
public int CreateEquipe(PROPUser Equipe) { SQLHelper sqlHelper = new SQLHelper(); List <MySqlParameter> parameters = new List <MySqlParameter>(); parameters.Add(new MySqlParameter("_UserName", Equipe.UserName)); parameters.Add(new MySqlParameter("_Email", Equipe.Email)); parameters.Add(new MySqlParameter("_Password", Equipe.Password)); return(sqlHelper.executeSP <int>(parameters, "InsertUser")); }
public void UpdateEquipe(PROPUser Equipe) { SQLHelper sqlHelper = new SQLHelper(); List <MySqlParameter> lstParameter = new List <MySqlParameter>(); lstParameter.Add(new MySqlParameter("_Id", Equipe.Id)); lstParameter.Add(new MySqlParameter("_UserName", Equipe.UserName)); lstParameter.Add(new MySqlParameter("_Email", Equipe.Email)); lstParameter.Add(new MySqlParameter("_Password", Equipe.Password)); sqlHelper.executenonquery(lstParameter, "UpdateUser"); }
public bool updateUser(PROPUser User) { if (string.IsNullOrEmpty(User.UserName) || User.Id <= 0) { return(false); } else { DALUser dalUser = new DALUser(); dalUser.UpdateEquipe(User); return(true); } }
public int CreateUser(string UserName, string UserPrenom, string sexe) { if (string.IsNullOrEmpty(UserName)) { return(-1); } else { DALUser dalUser = new DALUser(); PROPUser joueur = new PROPUser(0, UserName, UserPrenom, sexe); return(dalUser.CreateEquipe(joueur)); } }
public List <PROPUser> getAllEquipe() { List <PROPUser> EquipeList = new List <PROPUser>(); SQLHelper sqlHelper = new SQLHelper(); List <MySqlParameter> parameters = new List <MySqlParameter>(); var resultSet = sqlHelper.executeSP <DataSet>(parameters, "getAllUser"); foreach (DataRow drow in resultSet.Tables[0].Rows) { var user = new PROPUser( Convert.ToInt32(drow[0].ToString()), drow[1].ToString(), drow[2].ToString(), drow[3].ToString() ); EquipeList.Add(user); } return(EquipeList); }
public List <PROPUser> getEquipe(string searchEquipe) { List <PROPUser> EquipeList = new List <PROPUser>(); SQLHelper sqlHelper = new SQLHelper(); List <MySqlParameter> parameters = new List <MySqlParameter>(); parameters.Add(new MySqlParameter("_EquipeSearch", searchEquipe)); var resultSet = sqlHelper.executeSP <DataSet>(parameters, "SelectEquipe"); foreach (DataRow drow in resultSet.Tables[0].Rows) { var user = new PROPUser( Convert.ToInt32(drow[0].ToString()), drow[1].ToString(), drow[2].ToString(), drow[2].ToString() ); EquipeList.Add(user); } return(EquipeList); }