提交代码

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>
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
/// </summary>
/// <param name="projectId"></param>
/// <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))
{
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;
}
}