提交代码

This commit is contained in:
2025-03-20 14:39:47 +08:00
parent 34b53e8ebb
commit ed56cc00df
3 changed files with 86 additions and 15 deletions
@@ -100,6 +100,45 @@ namespace BLL
}
}
/// <summary>
/// 部位下拉框
/// </summary>
/// <param name="dropName">下拉框名字</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitAllPartDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
{
dropName.DataValueField = "Value";
dropName.DataTextField = "Text";
dropName.DataSource = GetAllPartListByProjectId(projectId);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 根据图纸Id获取部位下拉选择项
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static ListItem[] GetAllPartListByProjectId(string projectId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var q = (from x in db.QuantityManagement_Base
where x.ProjectId == projectId && x.State == BLL.Const.Base_Complete
orderby x.Part
select x.Part).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;
}
}
/// <summary>
/// 根据图纸Id获取部位下拉选择项
/// </summary>
@@ -139,6 +178,39 @@ namespace BLL
}
}
/// <summary>
/// 项目内容下拉框
/// </summary>
/// <param name="dropName">下拉框名字</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitAllProjectContentDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
{
dropName.DataValueField = "BaseId";
dropName.DataTextField = "ProjectContent";
dropName.DataSource = GetAllProjectContentListByProjectId(projectId);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 根据项目Id获取项目内容下拉选择项
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<Model.QuantityManagement_Base> 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();
}
}
/// <summary>
/// 根据图纸Id和部位获取项目内容下拉选择项
/// </summary>