using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BLL { public class PMIDelegation_Service { /// /// 查找后返回集合增加到列表 /// /// /// public static List GetPMI_DelegationAddItem(string hdItemsString) { var jointInfos = from x in Funs.DB.View_Pipeline_WeldJoint select x; List returnViewMatch = new List(); if (!string.IsNullOrEmpty(hdItemsString)) { List jotIds = Funs.GetStrListByStr(hdItemsString, '|'); foreach (var jotItem in jotIds) { string[] strs = jotItem.Split(','); var jotInfo = jointInfos.FirstOrDefault(x => x.WeldJointId == strs[0]); Model.View_PMI_DelegationDetails newItem = new Model.View_PMI_DelegationDetails(); newItem.Id = SQLHelper.GetNewID(typeof(Model.View_PMI_DelegationDetails)); newItem.WeldJointId = jotInfo.WeldJointId; newItem.WeldJointCode = jotInfo.WeldJointCode; newItem.PipelineCode = jotInfo.PipelineCode; newItem.Specification = jotInfo.Specification; newItem.MaterialCode = jotInfo.Material1Code; newItem.QualityNo = string.Empty; newItem.Acceptance = string.Empty; newItem.Status = 0; newItem.PMIId = string.Empty; newItem.WorkAreaId = jotInfo.WorkAreaId; newItem.CheckTime = DateTime.Now; newItem.ReportTime= DateTime.Now; newItem.DelegationDate= DateTime.Now; newItem.DelegationNo = string.Empty; returnViewMatch.Add(newItem); } } return returnViewMatch; } /// /// 返回视图列表集合 /// public static List GetPMI_DelegationItem(string projectId, string pmiId) { List returnViewMatch = (from x in Funs.DB.View_PMI_DelegationDetails where x.ProjectId == projectId && x.PMIId == pmiId select x).ToList(); return returnViewMatch; } } }