From d609421334840d7ceeffd560fcc4e9ef9133d6f4 Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Thu, 20 Mar 2025 14:53:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CQMS/QuantityManagement/BaseService.cs | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/SGGL/BLL/CQMS/QuantityManagement/BaseService.cs b/SGGL/BLL/CQMS/QuantityManagement/BaseService.cs index 8061f8d..2695f8e 100644 --- a/SGGL/BLL/CQMS/QuantityManagement/BaseService.cs +++ b/SGGL/BLL/CQMS/QuantityManagement/BaseService.cs @@ -185,8 +185,8 @@ namespace BLL /// 是否显示请选择 public static void InitAllProjectContentDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease) { - dropName.DataValueField = "BaseId"; - dropName.DataTextField = "ProjectContent"; + dropName.DataValueField = "Value"; + dropName.DataTextField = "Text"; dropName.DataSource = GetAllProjectContentListByProjectId(projectId); dropName.DataBind(); if (isShowPlease) @@ -200,14 +200,20 @@ namespace BLL /// /// /// - public static List GetAllProjectContentListByProjectId(string projectId) + public static ListItem[] GetAllProjectContentListByProjectId(string projectId) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { - return (from x in db.QuantityManagement_Base - where x.ProjectId == projectId && x.State == BLL.Const.Base_Complete - orderby x.ProjectContent - select x).ToList(); + var q = (from x in db.QuantityManagement_Base + where x.ProjectId == projectId && x.State == BLL.Const.Base_Complete + orderby x.ProjectContent + select x.ProjectContent).Distinct().ToList(); + ListItem[] list = new ListItem[q.Count()]; + for (int i = 0; i < list.Count(); i++) + { + list[i] = new ListItem(q[i] ?? "", q[i]); + } + return list; } }