コード例 #1
0
        public ActionResult Delete(int id)
        {
            var complaint = _complaintService.GetbyId(id);

            _complaintService.Delete(complaint);
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        // DELETE api/Complaint/5
        public IHttpActionResult Delete(int id)
        {
            complaintService = new ComplaintService();
            var response = complaintService.Delete(id);

            if (response.Success)
            {
                return(Ok(id));
            }

            return(Content(HttpStatusCode.BadRequest, response.Message));
        }
コード例 #3
0
        public IActionResult Delete(ComplaintModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _service.Delete(model.Id);
                    return(Ok());
                }

                return(BadRequest(ModelState));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
コード例 #4
0
 public IActionResult Delete(int id)
 {
     _complaintService.Delete(id);
     return(Ok(new { message = "Complaint Deleted Successfully." }));
 }