Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        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;
        }
Esempio n. 5
0
        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;
        }
Esempio n. 6
0
        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;
        }
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
        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);
        }
Esempio n. 9
0
        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);
        }
Esempio n. 10
0
        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;
        }
Esempio n. 11
0
 private UtilisateurDAO()
 {
     _Database = SqlDataBaseDAO.GetInstance();
 }
Esempio n. 12
0
 private RubriqueDAO()
 {
     _Database = SqlDataBaseDAO.GetInstance();
 }
Esempio n. 13
0
 private SujetDAO()
 {
     _Database = SqlDataBaseDAO.GetInstance();
 }
Esempio n. 14
0
 private ReponseDAO()
 {
     _Database = SqlDataBaseDAO.GetInstance();
 }