// DELETE api/Contact/id
 public bool Delete(int id)
 {
     if (id > 0)
     {
         return(_contactServices.DeleteContact(id));
     }
     return(false);
 }
        public ActionResult <bool> DeletedContactDetail(int Id)
        {
            var response = _contactServices.DeleteContact(Id);

            if (response)
            {
                return(Ok(response));
            }
            else
            {
                return(NotFound(response));
            }
        }
Esempio n. 3
0
        // DELETE: api/Contact/5
        /// <summary>
        ///  Delete contact information
        /// Created Date: 10 Apr 2018
        /// Created By : Omkar M.
        /// </summary>
        /// <returns></returns>
        public IHttpActionResult Delete(int id)
        {
            int status = _contactServices.DeleteContact(id);

            if (status > 0)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
Esempio n. 4
0
        //[ValidateAntiForgeryToken]
        public ActionResult Delete(int id)
        {
            int result = _contactServices.DeleteContact(id);

            if (result > 0)
            {
                return(Json(new { Status = "0", Message = "Data deleted  sucessfully." }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { Status = "1", Message = "Error Occur during processing." }, JsonRequestBehavior.AllowGet));
            }
        }
        public IHttpActionResult DeleteContact(int id)
        {
            ContactEntity contact;

            if (id > 0)
            {
                contact = _ContactServices.GetContactById(id);
                if (contact == null)
                {
                    return(NotFound());
                }
                return(Ok(_ContactServices.DeleteContact(id)));
            }
            return(BadRequest("Invalid Contact"));
        }