/// <summary> /// Inserts the equipe. /// </summary> /// <param name="equipe">Equipe.</param> public int insertEquipe(Equipe objet) { int idInsere = -1; try { string requete = "insert into tblEquipe (Libelle,Commentaire,InformationEntrainements,"; requete = requete + " InformationResponsable,DateCreation,InformationDivision,LienClassement,Ordre, CheminCalendrier, CheminPhoto, CheminFicheEntrainement, isActif) "; requete = requete + " values ( '" + objet.Libelle.Replace("'", "''") + "'"; requete = requete + " , '" + objet.Commentaire.Replace("'", "''") + "'"; requete = requete + " , '" + objet.InformationsEntrainements.Replace("'", "''") + "'"; requete = requete + " , '" + objet.InformationsResponsable.Replace("'", "''") + "'"; requete = requete + " , '" + Commons.Utils.getFormatStringPourDateMySQL(objet.DateCreation) + "'"; requete = requete + " , '" + objet.InformationsDivision.Replace("'", "''") + "'"; requete = requete + " , '" + objet.LienClassement.Replace("'", "''") + "'"; requete = requete + " , " + objet.Ordre + ""; requete = requete + " , '" + objet.CheminCalendrier.Replace("'", "''") + "'"; requete = requete + " , '" + objet.CheminPhoto.Replace("'", "''") + "'"; requete = requete + " , '" + objet.CheminFicheEntrainement.Replace("'", "''") + "'"; requete = requete + " , 1"; requete = requete + " )"; bool result = db.executerRequete(requete); // On récupère ensuite le dernier id inséré en base en cas de succès de l'insertion. if (result) { idInsere = db.getLastInsertID(); } } catch (Exception e) { Commons.Logger.genererErreur(typeof(EquipeDAL), e.ToString()); } return(idInsere); }
/// <summary> /// Fonction permettant de mettre à jour les stats en incrémentant d'un unité la page visitée /// </summary> /// <param name="TypeStat">Type stat.</param> /// <param name="Mois">Mois.</param> public void majStat(string TypeStat, string Mois) { string requete; try { requete = "update tblStat "; requete = requete + " set " + TypeStat + "=" + TypeStat + "+1"; requete = requete + " where Mois= '" + Mois + "'"; db.executerRequete(requete); } catch (Exception e) { Commons.Logger.genererErreur(typeof(StatDAL), e.ToString()); } }
/// <summary> /// Fonction permettant de supprimer un document /// </summary> /// <returns><c>true</c>, if document was deleted, <c>false</c> otherwise.</returns> /// <param name="idDocument">Identifier document.</param> public bool deleteDocument(int idDocument) { bool success = false; try { string requete = "delete from tblDocument "; requete = requete + " where id=" + idDocument.ToString(); success = db.executerRequete(requete); } catch (Exception e) { success = false; string strIdDocument = idDocument.ToString(); Commons.Logger.genererErreur(typeof(DocumentDAL), "strIdDocument = " + strIdDocument + " /n " + e.ToString()); } return(success); }
/// <summary> /// Fonction permettant de supprimer une actualité /// </summary> /// <returns><c>true</c>, if actualite was deleted, <c>false</c> otherwise.</returns> /// <param name="idActualite">Identifier actualite.</param> public bool deleteActualite(int idActualite) { bool success = false; try { string requete = "delete from tblActualite "; requete = requete + " where id=" + idActualite.ToString(); success = db.executerRequete(requete); } catch (Exception e) { success = false; string stridActualite = idActualite.ToString(); Commons.Logger.genererErreur(typeof(ActualiteDAL), "strIdActualite = " + stridActualite + " : " + e.ToString()); } return(success); }