public IActionResult ConfigDelete(Config input)
        {
            BaseReturnAPI result = new BaseReturnAPI()
            {
                Data       = null,
                StatusCode = JsonApiStatusCodes.Default,
                Message    = JsonApiStatusCodes.MessageDefault
            };

            try
            {
                result = new BaseReturnAPI()
                {
                    Data       = _configService.Delete(input),
                    StatusCode = JsonApiStatusCodes.Success,
                    Message    = JsonApiStatusCodes.MessageSucceed
                };
            }
            catch (Exception ex)
            {
                var k = ex.ToString();
                result.StatusCode = JsonApiStatusCodes.Failed;
                result.Message    = k;
            }

            return(Ok(result));
        }
 public async Task <IActionResult> Delete(ParamConfigInfo param)
 {
     return(await ActionWrapAsync(async() =>
     {
         ResultData <bool> result = new ResultData <bool>();
         result.Data = await _configService.Delete(param);
         return result;
     }));
 }
 public HttpResponseMessage Delete(int id)
 {
     try
     {
         _configService.Delete(id);
         return(Request.CreateResponse(HttpStatusCode.OK, new SuccessResponse()));
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
     }
 }
Exemplo n.º 4
0
        public async Task <JsonResult> Delete(long id)
        {
            var config = await _configService.Get(id);

            var tem = await _templateService.Get(config.TemplateId);

            DisconfigCache.DeleteCache(AppId + tem.Version + EnvId, tem.Type, tem.Name);
            var log = new OperationLog();

            log.Content = "删除配置 请求内容:删除;" + config.Value;
            ConfigLog(log);
            return(Json(await _configService.Delete(id), JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 5
0
 protected void DeleteDataItem(object sender, EventArgs e)
 {
     try
     {
         _dataItemService.Delete(_dataModel._dataItem, VisitHelper.GetVisit());
         ResponseRedirect("../Secure/ConfigArgs.aspx");
     }
     catch (Exception ex)
     {
         LOG.Error(ex.Message, ex);
         divPageError.Visible   = true;
         divPageError.InnerText = UIUtility.ParseException(ex);
     }
 }
Exemplo n.º 6
0
 public Task <IResultModel> Delete([BindRequired] int id)
 {
     return(_service.Delete(id));
 }
Exemplo n.º 7
0
 public IActionResult Delete(string id)
 {
     _config.Delete(id);
     return(Ok());
 }
        public void ConfigService_Delete()
        {
            IConfigService service = this.GetService <IConfigService>();

            service.Delete(61);
        }