48 lines
2.0 KiB
C#
48 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace BLL
|
|
{
|
|
/// <summary>
|
|
/// 施工方案
|
|
/// </summary>
|
|
public static class APIMaterialService
|
|
{
|
|
|
|
#region 获取施工方案列表信息
|
|
/// <summary>
|
|
/// 获取施工方案列表信息
|
|
/// </summary>
|
|
/// <param name="projectId"></param>
|
|
/// <param name="unitId"></param>
|
|
/// <param name="strParam"></param>
|
|
/// <returns></returns>
|
|
public static List<Model.MaterialItem> getMaterialList(string projectId, string strParam )
|
|
{
|
|
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
|
{
|
|
var getConstructSolution = from x in db.HSSE_Material
|
|
where x.ProjectId == projectId
|
|
where strParam==""||x.Name.Contains(strParam)
|
|
orderby x.PublishDate descending
|
|
select new Model.MaterialItem
|
|
{
|
|
MaterialId = x.MaterialId,
|
|
ProjectId = x.ProjectId,
|
|
PublishMan = x.PublishMan,
|
|
PublishManName = db.Sys_User.First(u => u.UserId == x.PublishMan).UserName,
|
|
Name = x.Name,
|
|
PublishDate = string.Format("{0:yyyy-MM-dd}", x.PublishDate),
|
|
Remark = x.Remark,
|
|
AttachUrl = db.AttachFile.FirstOrDefault(z => z.ToKeyId == x.MaterialId).AttachUrl.Replace('\\', '/'),
|
|
};
|
|
return getConstructSolution.ToList();
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
}
|
|
}
|