コード例 #1
0
        /// <summary>
        /// Ajoute un abonne
        /// </summary>
        /// <param name="abonne"></param>
        /// <returns></returns>
        // POST: api/Abonne
        public long Post([FromBody] Abonne abonne)
        {
            AbonnePersistance ap = new AbonnePersistance();
            long res             = ap.SaveAbonne(abonne);

            return(res);
        }
コード例 #2
0
        public HttpResponseMessage Post([FromBody] Commentaire value, string password)
        {
            AbonnePersistance ap = new AbonnePersistance();

            if (ap.GetAbonne(value.Id_abonne, password))
            {
                CommentairePersistance cp = new CommentairePersistance();
                cp.saveCommentaire(value);
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created);
                return(response);
            }
            else
            {
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Forbidden);
                return(response);
            }
        }
コード例 #3
0
        public Boolean Get(int identifiant, string password)
        {
            AbonnePersistance ap = new AbonnePersistance();

            return(ap.GetAbonne(identifiant, password));
        }