Basf_TCC7/HJGL/BLL/WeldingProcess/PMI/PMIDelegation_Service.cs

63 lines
2.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class PMIDelegation_Service
{
/// <summary>
/// 查找后返回集合增加到列表
/// </summary>
/// <param name="hdItemsString"></param>
/// <returns></returns>
public static List<Model.View_PMI_DelegationDetails> GetPMI_DelegationAddItem(string hdItemsString)
{
var jointInfos = from x in Funs.DB.View_Pipeline_WeldJoint select x;
List<Model.View_PMI_DelegationDetails> returnViewMatch = new List<Model.View_PMI_DelegationDetails>();
if (!string.IsNullOrEmpty(hdItemsString))
{
List<string> 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;
}
/// <summary>
/// 返回视图列表集合
/// </summary>
public static List<Model.View_PMI_DelegationDetails> GetPMI_DelegationItem(string projectId, string pmiId)
{
List<Model.View_PMI_DelegationDetails> returnViewMatch = (from x in Funs.DB.View_PMI_DelegationDetails
where x.ProjectId == projectId && x.PMIId == pmiId
select x).ToList();
return returnViewMatch;
}
}
}