using System; using System.Collections.Generic; using System.Linq; namespace BLL { /// /// 施工方案 /// public static class APIMaterialService { #region 获取施工方案列表信息 /// /// 获取施工方案列表信息 /// /// /// /// /// public static List 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 } }