提交代码

This commit is contained in:
高飞 2025-03-20 14:53:41 +08:00
parent ed56cc00df
commit d609421334
1 changed files with 13 additions and 7 deletions

View File

@ -185,8 +185,8 @@ namespace BLL
/// <param name="isShowPlease">是否显示请选择</param> /// <param name="isShowPlease">是否显示请选择</param>
public static void InitAllProjectContentDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease) public static void InitAllProjectContentDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
{ {
dropName.DataValueField = "BaseId"; dropName.DataValueField = "Value";
dropName.DataTextField = "ProjectContent"; dropName.DataTextField = "Text";
dropName.DataSource = GetAllProjectContentListByProjectId(projectId); dropName.DataSource = GetAllProjectContentListByProjectId(projectId);
dropName.DataBind(); dropName.DataBind();
if (isShowPlease) if (isShowPlease)
@ -200,14 +200,20 @@ namespace BLL
/// </summary> /// </summary>
/// <param name="projectId"></param> /// <param name="projectId"></param>
/// <returns></returns> /// <returns></returns>
public static List<Model.QuantityManagement_Base> GetAllProjectContentListByProjectId(string projectId) public static ListItem[] GetAllProjectContentListByProjectId(string projectId)
{ {
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{ {
return (from x in db.QuantityManagement_Base var q = (from x in db.QuantityManagement_Base
where x.ProjectId == projectId && x.State == BLL.Const.Base_Complete where x.ProjectId == projectId && x.State == BLL.Const.Base_Complete
orderby x.ProjectContent orderby x.ProjectContent
select x).ToList(); 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;
} }
} }