예제 #1
0
        public HttpResponseMessage Delete(int Id)
        {
            _faqService.Delete(Id);
            SuccessResponse response = new SuccessResponse();

            return(Request.CreateResponse(HttpStatusCode.OK, new SuccessResponse()));
        }
예제 #2
0
 public ActionResult Delete(int id)
 {
     faqService.Delete(id);
     faqService.Commit();
     SuccessMessage(FormMessages.DeleteSuccess);
     return(RedirectToAction("Index"));
 }
예제 #3
0
        public async Task <IActionResult> Delete(string id)
        {
            var result = await _faqService.Delete(CurrentUser.TenantId, id);

            if (result.Code <= 0)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
예제 #4
0
        public void Delete(Guid id, string searchQueryId = null)
        {
            using (var transaction = ContextManager.NewTransaction())
            {
                faqService.Delete(id);
                transaction.Commit();
            }

            RefreshGridItem(searchQueryId, null, model => model.Id == id);
        }
예제 #5
0
        public IActionResult Delete(string id)
        {
            var entity = _manager.GetByPrimaryKey(id);

            if (entity == null)
            {
                return(NoResult());
            }
            _manager.Delete(entity);
            return(ResponseJson(entity));
        }
예제 #6
0
        public HttpResponseMessage Delete(int id)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }
            SucessResponse response = new SucessResponse();

            _faqService.Delete(id);

            return(Request.CreateResponse(response));
        }
 public HttpResponseMessage Delete(int id)
 {
     try
     {
         _faqService.Delete(id);
         return(Request.CreateResponse(HttpStatusCode.OK, new SuccessResponse()));
     }
     catch (Exception ex)
     {
         _errorService.LogError(ex);
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
     }
 }
        public ActionResult Delete(int id)
        {
            Faq faq = faqService.Get(id);

            if (faq != null)
            {
                faqService.Delete(faq);
                faqService.Commit();

                SuccessMessage(FormMessages.DeleteSuccess);
            }

            return(RedirectToAction("Index"));
        }
예제 #9
0
        public ActionResult <SuccessResponse> Delete(int id)
        {
            int          responseCode = 200;
            BaseResponse responseData = null;

            try
            {
                _service.Delete(id);
                responseData = new SuccessResponse();
            }
            catch (Exception exception)
            {
                responseCode = 500;
                responseData = new ErrorResponse(exception.Message);
                base.Logger.LogError(exception.ToString());
            }

            return(StatusCode(responseCode, responseData));
        }
예제 #10
0
 public RedirectToRouteResult Delete_POST(Faq item)
 {
     _faqService.Delete(item);
     return(RedirectToAction("Edit", "Webpage", new { id = item.ShowFaqs.Id }));
 }
예제 #11
0
        public ActionResult Delete(int id)
        {
            var result = _faqService.Delete(id);

            return(Json(Server.FormatResultToJson(result)));
        }