public IActionResult StepParamDelete(List <int> ids, int FKSN) { foreach (int SN in ids) { FlowStepParamModel model = new FlowStepParamModel(); model.SN = SN; int i = this.flowStepParamDAL.Delete(model); } return(StepParamList(FKSN)); }
public List <FlowStepModel> QueryOfParam(int fksn) { List <FlowStepModel> list = new List <FlowStepModel>(); string strSql = string.Format("select * from {0} where FKSN= {1} order by StepOrder", tableName, fksn); DataTable dt = db.FillTable(strSql); foreach (DataRow dataRow in dt.Rows) { FlowStepModel info = this.CreateModel <FlowStepModel>(dataRow); //加载步骤参数 string strSql1 = "select * from api_flow_step_param where fksn =" + info.SN.ToString(); info.Params = new List <FlowStepParamModel>(); string strFunParam = ""; string strFunTableParm = ""; foreach (DataRow dataRow1 in db.FillTable(strSql1).Rows) { FlowStepParamModel model1 = base.CreateModel <FlowStepParamModel>(dataRow1); string paraName = model1.ParamName; if (strFunParam != "") { strFunParam += ","; } if (strFunTableParm != "") { strFunTableParm += ","; } info.Params.Add(model1); strFunParam += "@" + paraName; strFunTableParm += paraName = "@" + paraName; } if (info.CommandType == "Fun") //标量函数 { info.CommandText = "select " + info.CommandText + "(" + strFunParam + ")"; } else if (info.CommandType == "FunTable") //表函数 { info.CommandText = "select * from " + info.CommandText; if (strFunTableParm != "") { info.CommandText += " where " + strFunParam; } } list.Add(info); } return(list); }
public IActionResult StepParamSave(FlowStepParamModel model) { if (model.SN > 0) { this.flowStepParamDAL.Update(model); } else { this.flowStepParamDAL.Insert(model); } return(StepParamList(model.FKSN)); }
public List <FlowStepParamModel> Query(int FKSN) { string cmdText = "select * from " + base.tableName + " where fksn =" + FKSN.ToString(); DataTable dt = base.db.FillTable(cmdText); List <FlowStepParamModel> list = new List <FlowStepParamModel>(); foreach (DataRow dataRow in dt.Rows) { FlowStepParamModel model = base.CreateModel <FlowStepParamModel>(dataRow); list.Add(model); } return(list); }