public void GetProcedureComboTree_Base(HttpContext context, string btn) { string emptyComboTree = "[{\"id\":0,\"text\":\"\"}]"; if (btn != "show") { context.Response.Write(emptyComboTree); return; } try { BLL.Base.base_Procedure bll = new BLL.Base.base_Procedure(); StringBuilder strWhere = new StringBuilder(); string NoHistory = RequestHelper.GetString("NoHistory").Trim(); if (NoHistory != "") { strWhere.Append(" and a.ID<>" + Utils.StrToInt(NoHistory, 0) + " and ','+a.SupList not like '%," + Utils.StrToInt(NoHistory, 0) + ",%' "); } string fields = "NumType"; string[] extendField = fields.Split(','); DataSet ds = bll.GetList(strWhere.ToString()); DataTable dt = ds.Tables[0]; string ProcedureComboTreeData = DtToTreeJson(dt, "ID", "ProcedureName", "SupId", "SupList", "0", "0", extendField); context.Response.Write(ProcedureComboTreeData); } catch { context.Response.Write(emptyComboTree); } }
public void GetProcedureComboTree(HttpContext context, string btn) { string emptyComboTree = "[{\"id\":0,\"text\":\"\"}]"; if (btn != "show") { context.Response.Write(emptyComboTree); return; } try { string MachineModel = RequestHelper.GetString("MachineModel"); string NoHistory = RequestHelper.GetString("NoHistory").Trim(); string AssignmentIdList = RequestHelper.GetString("AssignmentIdList").Trim(); string IsCommon = RequestHelper.GetString("IsCommon").Trim(); if (MachineModel == "") { context.Response.Write(emptyComboTree); return; } if (IsCommon == "1") { AssignmentIdList = ""; } BLL.Base.base_Procedure bll = new BLL.Base.base_Procedure(); StringBuilder strWhere = new StringBuilder(); string fields = "NumType,MachineLevelNat"; string[] extendField = fields.Split(','); if (NoHistory != "") { strWhere.Append(" and a.ID<>" + Utils.StrToInt(NoHistory, 0) + " and ','+a.SupList not like '%," + Utils.StrToInt(NoHistory, 0) + ",%' "); } if (AssignmentIdList != "") { strWhere.Append(" and a.ID not in(select ProcedureId from Repair_Assignment_Procedure where FlagDel=0 and AssignmentId in(" + AssignmentIdList + "))"); } //-------------- strWhere.Append(" or a.ID in(179,176,177,178,165) "); //-------------- DataSet ds = bll.GetList(strWhere.ToString(), MachineModel); DataTable dt = ds.Tables[0]; string ProcedureComboTreeData = DtToTreeJson(dt, "ID", "ProcedureName", "SupId", "SupList", "0", "0", extendField); context.Response.Write(ProcedureComboTreeData); } catch { context.Response.Write(emptyComboTree); } }