public int NewSujet(int idRub, string nomUser, string titresujet, string textsujet, DateTime datecreatsujet) { SqlCommand cmd = new SqlCommand(); cmd.Connection = SqlDataBaseDAO.GetInstance().GetConnection(); cmd.CommandText = "NewSujet"; cmd.CommandType = CommandType.StoredProcedure; SqlParameter pIdRub = new SqlParameter("IDRUB", idRub); cmd.Parameters.Add(pIdRub); SqlParameter pNomUser = new SqlParameter("NOMUSER", nomUser); cmd.Parameters.Add(pNomUser); SqlParameter pTitresujet = new SqlParameter("TITRESUJET", titresujet); cmd.Parameters.Add(pTitresujet); SqlParameter pTextsujet = new SqlParameter("TEXTSUJET", textsujet); cmd.Parameters.Add(pTextsujet); SqlParameter pDatecreatsujet = new SqlParameter("DATECREATSUJET", datecreatsujet); cmd.Parameters.Add(pDatecreatsujet); // Ou .......... : //cmd.Parameters.Add(new SqlParameter("IDUSER", idUser)); //cmd.Parameters.Add(new SqlParameter("IDSUJET", idSujet)); //cmd.Parameters.Add(new SqlParameter("TEXTREP", textrep)); int nbLigne = cmd.ExecuteNonQuery(); return nbLigne; }
public int NewReponse(int idSujet, string nomUser, string textrep, DateTime dateenvoirep) { SqlCommand cmd = new SqlCommand(); cmd.Connection = SqlDataBaseDAO.GetInstance().GetConnection(); cmd.CommandText = "NewReponse"; cmd.CommandType = CommandType.StoredProcedure; SqlParameter pIdSujet = new SqlParameter("IDSUJET", idSujet); cmd.Parameters.Add(pIdSujet); SqlParameter pNomUser = new SqlParameter("NOMUSER", nomUser); cmd.Parameters.Add(pNomUser); SqlParameter pTextrep = new SqlParameter("TEXTREP", textrep); cmd.Parameters.Add(pTextrep); SqlParameter pDateenvoirep = new SqlParameter("DATEENVOIREP", dateenvoirep); cmd.Parameters.Add(pDateenvoirep); // Ou .......... : //cmd.Parameters.Add(new SqlParameter("IDUSER", idUser)); //cmd.Parameters.Add(new SqlParameter("IDSUJET", idSujet)); //cmd.Parameters.Add(new SqlParameter("TEXTREP", textrep)); int nbLigne = cmd.ExecuteNonQuery(); return(nbLigne); }
public static SqlDataBaseDAO GetInstance() { if (_Instance == null) { _Instance = new SqlDataBaseDAO(); } return(_Instance); }
public static int DeleteSujet(int idSujet) { SqlCommand cmd = new SqlCommand(); cmd.Connection = SqlDataBaseDAO.GetInstance().GetConnection(); cmd.CommandText = "DeleteSujet"; cmd.CommandType = CommandType.StoredProcedure; SqlParameter pIdSujet = new SqlParameter("IDSUJET", idSujet); cmd.Parameters.Add(pIdSujet); int nbLigne = cmd.ExecuteNonQuery(); return nbLigne; }
public DataSet GetSujets() { SqlCommand cmd = new SqlCommand(); cmd.Connection = SqlDataBaseDAO.GetInstance().GetConnection(); cmd.CommandText = "GetSujets"; cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter objDataAdapter = new SqlDataAdapter(cmd); DataSet objDataSet = new DataSet(); objDataAdapter.Fill(objDataSet); return objDataSet; }
public DataSet GetRubriqueByIdRub(int idrub) { SqlCommand cmd = new SqlCommand(); cmd.Connection = SqlDataBaseDAO.GetInstance().GetConnection(); cmd.CommandText = "GetRubriqueById "; cmd.CommandType = CommandType.StoredProcedure; SqlParameter pDeptno = new SqlParameter("IDRUB", idrub); cmd.Parameters.Add(pDeptno); SqlDataAdapter objDataAdapter = new SqlDataAdapter(cmd); DataSet objDataSet = new DataSet(); objDataAdapter.Fill(objDataSet); return objDataSet; }
public DataSet GetRubriqueByNomRub(string nomrub) { SqlCommand cmd = new SqlCommand(); cmd.Connection = SqlDataBaseDAO.GetInstance().GetConnection(); cmd.CommandText = "GetRubriqueByNomRub"; cmd.CommandType = CommandType.StoredProcedure; SqlParameter pNomrub = new SqlParameter("NOMRUB", nomrub); cmd.Parameters.Add(pNomrub); SqlDataAdapter objDataAdapter = new SqlDataAdapter(cmd); DataSet objDataSet = new DataSet(); objDataAdapter.Fill(objDataSet); return objDataSet; }
public static int DeleteReponse(int idRep) { SqlCommand cmd = new SqlCommand(); cmd.Connection = SqlDataBaseDAO.GetInstance().GetConnection(); cmd.CommandText = "DeleteReponse"; cmd.CommandType = CommandType.StoredProcedure; SqlParameter pIdRep = new SqlParameter("IDREP", idRep); cmd.Parameters.Add(pIdRep); int nbLigne = cmd.ExecuteNonQuery(); return(nbLigne); }
public DataSet GetUtilisateurById(int iduser) { SqlCommand cmd = new SqlCommand(); cmd.Connection = SqlDataBaseDAO.GetInstance().GetConnection(); cmd.CommandText = "GetUtilisateurById "; cmd.CommandType = CommandType.StoredProcedure; SqlParameter pIduser = new SqlParameter("IDUSER", iduser); cmd.Parameters.Add(pIduser); SqlDataAdapter objDataAdapter = new SqlDataAdapter(cmd); DataSet objDataSet = new DataSet(); objDataAdapter.Fill(objDataSet); return(objDataSet); }
public DataSet GetReponseByIdSujet(int idsujet) { SqlCommand cmd = new SqlCommand(); cmd.Connection = SqlDataBaseDAO.GetInstance().GetConnection(); cmd.CommandText = "GetReponseByIdSujet "; cmd.CommandType = CommandType.StoredProcedure; SqlParameter pIdsujet = new SqlParameter("IDSUJET", idsujet); cmd.Parameters.Add(pIdsujet); SqlDataAdapter objDataAdapter = new SqlDataAdapter(cmd); DataSet objDataSet = new DataSet(); objDataAdapter.Fill(objDataSet); return(objDataSet); }
public int UpdateSujet(int idSujet, string titresujet, string ancientitre, string textsujet, string ancientext) { SqlCommand cmd = new SqlCommand(); cmd.Connection = SqlDataBaseDAO.GetInstance().GetConnection(); cmd.CommandText = "UpdateSujet"; cmd.CommandType = CommandType.StoredProcedure; SqlParameter pISujet = new SqlParameter("IDSUJET", idSujet); cmd.Parameters.Add(pISujet); //SqlParameter pNomUser = new SqlParameter("NOMUSER", nomUser); //cmd.Parameters.Add(pNomUser); SqlParameter pTitresujet = new SqlParameter("TITRESUJET", titresujet); cmd.Parameters.Add(pTitresujet); SqlParameter pAncienTitre = new SqlParameter("ANCIENTITRE", ancientitre); cmd.Parameters.Add(pAncienTitre); SqlParameter pTextsujet = new SqlParameter("TEXTSUJET", textsujet); cmd.Parameters.Add(pTextsujet); SqlParameter pAncienText = new SqlParameter("ANCIENTEXT", ancientext); cmd.Parameters.Add(pAncienText); //SqlParameter pDatecreatsujet = new SqlParameter("DATECREATSUJET", datecreatsujet); //cmd.Parameters.Add(pDatecreatsujet); // Ou .......... : //cmd.Parameters.Add(new SqlParameter("IDUSER", idUser)); //cmd.Parameters.Add(new SqlParameter("IDSUJET", idSujet)); //cmd.Parameters.Add(new SqlParameter("TEXTREP", textrep)); int nbLigne = cmd.ExecuteNonQuery(); return nbLigne; }
private UtilisateurDAO() { _Database = SqlDataBaseDAO.GetInstance(); }
private RubriqueDAO() { _Database = SqlDataBaseDAO.GetInstance(); }
private SujetDAO() { _Database = SqlDataBaseDAO.GetInstance(); }
private ReponseDAO() { _Database = SqlDataBaseDAO.GetInstance(); }