public BasicResponse DeleteJC_Analysistemplate(AnalysisTemplateDeleteRequest jC_Analysistemplaterequest) { TransactionsManager.BeginTransaction(() => { foreach (var item in jC_Analysistemplaterequest.Ids) { _Repository.DeleteJC_Analysistemplate(item); //1.删除表达式 //根据模板ID 查询表达式信息 //global_AnalyticalExpressionService_GetAnalyticalExpressionListByTempleteId _analyticalExpressionRepository.DeleteJC_AnalyticalexpressionByTempleteId(item); //2.删除分析模板配置表 _analysisTemplateConfigRepository.DeleteJC_AnalysistemplateconfigByTempleteId(item); //3.删除表达式配置表 _expressionConfigRepository.DeleteJC_ExpressionconfigByTempleteId(item); } }); var jC_Analysistemplateresponse = new BasicResponse(); return(jC_Analysistemplateresponse); }
public BasicResponse DeleteJC_Analysistemplate(AnalysisTemplateDeleteRequest jC_Analysistemplaterequest) { return(_analysisTemplateService.DeleteJC_Analysistemplate(jC_Analysistemplaterequest)); }
/// <summary> /// 删除分析模板 /// </summary> /// <param name="id">模板ID</param> /// <returns></returns> public string DeleteAnalysisTemplateConfig(List <delAnalysisTemplateModel> ids) { try { //验证模板是否被使用 //分析模型配置表 //JC_LargedataAnalysisConfig //调用接口 StringBuilder returnSbError = new StringBuilder(); foreach (var item in ids) { Basic.Framework.Web.BasicResponse <List <JC_LargedataAnalysisConfigInfo> > largedataAnalysisConfigResult = largedataAnalysisConfigService.GetLargeDataAnalysisConfigListByTempleteId(new LargedataAnalysisConfigGetRequest() { TempleteId = item.id }); if (largedataAnalysisConfigResult.IsSuccess == true) { if (largedataAnalysisConfigResult.Data != null && largedataAnalysisConfigResult.Data.Count > 0) { returnSbError.Append("["); returnSbError.Append(item.name); returnSbError.Append("]"); } } else { return(largedataAnalysisConfigResult.Message); } } if (!string.IsNullOrWhiteSpace(returnSbError.ToString())) { return("模板" + returnSbError.ToString() + "已被使用,不能删除。"); } List <string> lstID = new List <string>(); foreach (var item in ids) { lstID.Add(item.id); } //1.模板 AnalysisTemplateDeleteRequest analysisTemplateDeleteRequest = new AnalysisTemplateDeleteRequest(); analysisTemplateDeleteRequest.Ids = lstID; //调用接口 Basic.Framework.Web.BasicResponse analysisTemplateResult = analysisTemplateService.DeleteJC_Analysistemplate(analysisTemplateDeleteRequest); if (analysisTemplateResult.IsSuccess == false) { return(analysisTemplateResult.Message); } else { if (analysisTemplateResult.Code != 100) { return(analysisTemplateResult.Message); } else { return("100"); } } } catch (Exception ex) { return("-100"); } }
public BasicResponse DeleteJC_Analysistemplate(AnalysisTemplateDeleteRequest jC_Analysistemplaterequest) { var responseStr = HttpClientHelper.Post(Webapi + "/v1/AnalysisTemplate/DeleteJC_Analysistemplate?token=" + Token, JSONHelper.ToJSONString(jC_Analysistemplaterequest)); return(JSONHelper.ParseJSONString <BasicResponse>(responseStr)); }