336 lines
		
	
	
		
			14 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			336 lines
		
	
	
		
			14 KiB
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						|||
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using System.Text;
							 | 
						|||
| 
								 | 
							
								using System.Threading.Tasks;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace BLL
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    /// <summary>
							 | 
						|||
| 
								 | 
							
								    /// 管线管理
							 | 
						|||
| 
								 | 
							
								    /// </summary>
							 | 
						|||
| 
								 | 
							
								    public class PW_IsoInfoService
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据管线ID获取管线信息
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="isoInfoName"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        public static Model.PW_IsoInfo GetIsoInfoByIsoInfoId(string isoInfoId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            return Funs.DB.PW_IsoInfo.FirstOrDefault(e => e.ISO_ID == isoInfoId);
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据管线号和工区号获取管线信息
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="isoNo"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        public static bool IsExistIsoInfoCode(string isoNo, string area)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            var q = from x in Funs.DB.PW_IsoInfo where x.ISO_IsoNo == isoNo && x.WorkAreaId == area select x;
							 | 
						|||
| 
								 | 
							
								            if (q.Count() > 0)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                return true;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            else
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                return false;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 添加作业管线
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="isoInfo"></param>
							 | 
						|||
| 
								 | 
							
								        public static void AddIsoInfo(Model.PW_IsoInfo isoInfo)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            Model.PW_IsoInfo newIsoInfo = new Model.PW_IsoInfo();
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_ID = isoInfo.ISO_ID;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ProjectId = isoInfo.ProjectId;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.UnitId = isoInfo.UnitId;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.TestMediumId = isoInfo.TestMediumId;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.DetectionRateId = isoInfo.DetectionRateId;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.DetectionTypeId = isoInfo.DetectionTypeId;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.WorkAreaId = isoInfo.WorkAreaId;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_IsoNo = isoInfo.ISO_IsoNo;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_SysNo = isoInfo.ISO_SysNo;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_FileName = isoInfo.ISO_FileName;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_SubSysNo = isoInfo.ISO_SubSysNo;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_CwpNo = isoInfo.ISO_CwpNo;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_IsoNumber = isoInfo.ISO_IsoNumber;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_Rev = isoInfo.ISO_Rev;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_Sheet = isoInfo.ISO_Sheet;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_PipeQty = isoInfo.ISO_PipeQty;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_TotalDin = isoInfo.ISO_TotalDin;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_Paint = isoInfo.ISO_Paint;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_Insulator = isoInfo.ISO_Insulator;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.MaterialId = isoInfo.MaterialId;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_HardnessRate = isoInfo.ISO_HardnessRate;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_Executive = isoInfo.ISO_Executive;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_Specification = isoInfo.ISO_Specification;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_Modifier = isoInfo.ISO_Modifier;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_ModifyDate = isoInfo.ISO_ModifyDate;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_Creator = isoInfo.ISO_Creator;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_CreateDate = isoInfo.ISO_CreateDate;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_JointQty = isoInfo.ISO_JointQty;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_DesignPress = isoInfo.ISO_DesignPress;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_DesignTemperature = isoInfo.ISO_DesignTemperature;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_TestPress = isoInfo.ISO_TestPress;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_TestTemperature = isoInfo.ISO_TestTemperature;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_NDTClass = isoInfo.ISO_NDTClass;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_PTRate = isoInfo.ISO_PTRate;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.PipingClassId = isoInfo.PipingClassId;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_PTClass = isoInfo.ISO_PTClass;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_IfPickling = isoInfo.ISO_IfPickling;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_IfChasing = isoInfo.ISO_IfChasing;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.ISO_Remark = isoInfo.ISO_Remark;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.Is_Standard = isoInfo.Is_Standard;
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.DeviceName = isoInfo.DeviceName;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.CHT_CheckNo = isoInfo.CHT_CheckNo;
							 | 
						|||
| 
								 | 
							
								            string projectCode = string.Empty;
							 | 
						|||
| 
								 | 
							
								            string installionCode = string.Empty;
							 | 
						|||
| 
								 | 
							
								            string workAreaCode = string.Empty;
							 | 
						|||
| 
								 | 
							
								            Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(isoInfo.ProjectId);
							 | 
						|||
| 
								 | 
							
								            if (project != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                projectCode = project.ProjectCode;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            //Model.ProjectData_WorkArea workArea = BLL.WorkAreaService.getWorkAreaByWorkAreaId(isoInfo.WorkAreaId);
							 | 
						|||
| 
								 | 
							
								            Model.ProjectData_WorkArea workArea = Funs.DB.ProjectData_WorkArea.Where(x => x.WorkAreaId == isoInfo.WorkAreaId).FirstOrDefault();
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            if (workArea != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                workAreaCode = workArea.WorkAreaCode;
							 | 
						|||
| 
								 | 
							
								                Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(workArea.InstallationId.ToString());
							 | 
						|||
| 
								 | 
							
								                if (installation != null)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    installionCode = installation.InstallationCode;
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            newIsoInfo.FileName = projectCode + "/" + installionCode + "/" + workAreaCode + "/" + isoInfo.ISO_IsoNo + ".dwg";
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            Funs.DB.PW_IsoInfo.InsertOnSubmit(newIsoInfo);
							 | 
						|||
| 
								 | 
							
								            Funs.DB.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 修改作业管线
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="isoInfo"></param>
							 | 
						|||
| 
								 | 
							
								        public static void UpdateIsoInfo(Model.PW_IsoInfo isoInfo)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            Model.PW_IsoInfo newIsoInfo = Funs.DB.PW_IsoInfo.FirstOrDefault(e => e.ISO_ID == isoInfo.ISO_ID);
							 | 
						|||
| 
								 | 
							
								            if (newIsoInfo != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                //newIsoInfo.UnitId = isoInfo.UnitId;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.TestMediumId = isoInfo.TestMediumId;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.DetectionRateId = isoInfo.DetectionRateId;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.DetectionTypeId = isoInfo.DetectionTypeId;
							 | 
						|||
| 
								 | 
							
								                //newIsoInfo.WorkAreaId = isoInfo.WorkAreaId;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.Is_Standard = isoInfo.Is_Standard;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_IsoNo = isoInfo.ISO_IsoNo;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_SysNo = isoInfo.ISO_SysNo;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_FileName = isoInfo.ISO_FileName;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_SubSysNo = isoInfo.ISO_SubSysNo;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_CwpNo = isoInfo.ISO_CwpNo;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_IsoNumber = isoInfo.ISO_IsoNumber;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_Rev = isoInfo.ISO_Rev;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_Sheet = isoInfo.ISO_Sheet;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_PipeQty = isoInfo.ISO_PipeQty;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_TotalDin = isoInfo.ISO_TotalDin;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_HardnessRate = isoInfo.ISO_HardnessRate;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_Paint = isoInfo.ISO_Paint;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_Insulator = isoInfo.ISO_Insulator;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.MaterialId = isoInfo.MaterialId;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_Executive = isoInfo.ISO_Executive;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_Specification = isoInfo.ISO_Specification;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_Modifier = isoInfo.ISO_Modifier;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_ModifyDate = isoInfo.ISO_ModifyDate;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_Creator = isoInfo.ISO_Creator;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_CreateDate = isoInfo.ISO_CreateDate;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_JointQty = isoInfo.ISO_JointQty;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_DesignPress = isoInfo.ISO_DesignPress;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_DesignTemperature = isoInfo.ISO_DesignTemperature;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_TestPress = isoInfo.ISO_TestPress;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_TestTemperature = isoInfo.ISO_TestTemperature;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_NDTClass = isoInfo.ISO_NDTClass;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_PTRate = isoInfo.ISO_PTRate;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.PipingClassId = isoInfo.PipingClassId;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_PTClass = isoInfo.ISO_PTClass;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_IfPickling = isoInfo.ISO_IfPickling;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_IfChasing = isoInfo.ISO_IfChasing;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_Remark = isoInfo.ISO_Remark;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.CHT_CheckNo = isoInfo.CHT_CheckNo;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.DeviceName = isoInfo.DeviceName;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                Funs.DB.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 修改作业管线
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="isoInfo"></param>
							 | 
						|||
| 
								 | 
							
								        public static void UpdateExportIso(Model.PW_IsoInfo isoInfo)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            Model.PW_IsoInfo newIsoInfo = Funs.DB.PW_IsoInfo.FirstOrDefault(e => e.ISO_ID == isoInfo.ISO_ID);
							 | 
						|||
| 
								 | 
							
								            if (newIsoInfo != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.MaterialId = isoInfo.MaterialId;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.DetectionRateId = isoInfo.DetectionRateId;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_Specification = isoInfo.ISO_Specification;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_TestPress = isoInfo.ISO_TestPress;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.TestMediumId = isoInfo.TestMediumId;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_IsoNumber = isoInfo.ISO_IsoNumber;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_DesignTemperature = isoInfo.ISO_DesignTemperature;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_DesignPress = isoInfo.ISO_DesignPress;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.PipingClassId = isoInfo.PipingClassId;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.ISO_HardnessRate = isoInfo.ISO_HardnessRate;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								                Funs.DB.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据作业管线Id删除一个作业管线信息
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="isoInfoId"></param>
							 | 
						|||
| 
								 | 
							
								        public static void DeleteIsoInfo(string isoInfoId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            Model.PW_IsoInfo isoInfo = Funs.DB.PW_IsoInfo.FirstOrDefault(e => e.ISO_ID == isoInfoId);
							 | 
						|||
| 
								 | 
							
								            if (isoInfo != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Funs.DB.PW_IsoInfo.DeleteOnSubmit(isoInfo);
							 | 
						|||
| 
								 | 
							
								                Funs.DB.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据单位Id获取管线数
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="unitId"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        public static int GetIsoInfoByUnitId(string unitId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            var q = (from x in Funs.DB.PW_IsoInfo where x.UnitId == unitId select x).ToList();
							 | 
						|||
| 
								 | 
							
								            return q.Count();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据介质Id获取管线数
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="serId"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        public static int GetIsoInfoBySerID(string serId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            var q = (from x in Funs.DB.PW_IsoInfo where x.TestMediumId == serId select x).ToList();
							 | 
						|||
| 
								 | 
							
								            return q.Count();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据探伤比例获取管线数
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="ndtrId"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        public static int GetIsoInfoByNDTRID(string ndtrId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            var q = (from x in Funs.DB.PW_IsoInfo where x.DetectionRateId == ndtrId select x).ToList();
							 | 
						|||
| 
								 | 
							
								            return q.Count();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								         /// 根据探伤类型获取管线数
							 | 
						|||
| 
								 | 
							
								         /// </summary>
							 | 
						|||
| 
								 | 
							
								         /// <param name="ndtId"></param>
							 | 
						|||
| 
								 | 
							
								         /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        public static int GetIsoInfoByNDTID(string ndtId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            var q = (from x in Funs.DB.PW_IsoInfo where x.DetectionTypeId == ndtId select x).ToList();
							 | 
						|||
| 
								 | 
							
								            return q.Count();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据区域获取管线数
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="bawId"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        public static int GetIsoInfoByBawId(string bawId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            var q = (from x in Funs.DB.PW_IsoInfo where x.WorkAreaId == bawId select x).ToList();
							 | 
						|||
| 
								 | 
							
								            return q.Count();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据材质获取管线数
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="steId"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        public static int GetIsoInfoBySteId(string steId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            var q = (from x in Funs.DB.PW_IsoInfo where x.MaterialId == steId select x).ToList();
							 | 
						|||
| 
								 | 
							
								            return q.Count();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据管道等级获取管线
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="iscId"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        public static int GetIsoInfoByISCID(string iscId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            var q = (from x in Funs.DB.PW_IsoInfo where x.PipingClassId == iscId select x).ToList();
							 | 
						|||
| 
								 | 
							
								            return q.Count();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据单位Id获取管线信息
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="unitId"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        //public static List<Model.View_IsoInfoReportSearch> GetIsoInfoViewListByUnitId(string projectId, string unitId, string workearId)
							 | 
						|||
| 
								 | 
							
								        //{
							 | 
						|||
| 
								 | 
							
								        //    var iso = from x in Funs.DB.View_IsoInfoReportSearch
							 | 
						|||
| 
								 | 
							
								        //              where x.BSU_ID == unitId && x.BAW_ID == workearId && x.ProjectId == projectId
							 | 
						|||
| 
								 | 
							
								        //              orderby x.ISO_IsoNo
							 | 
						|||
| 
								 | 
							
								        //              select x;
							 | 
						|||
| 
								 | 
							
								        //    if (iso.Count() > 0)
							 | 
						|||
| 
								 | 
							
								        //    {
							 | 
						|||
| 
								 | 
							
								        //        return iso.ToList();
							 | 
						|||
| 
								 | 
							
								        //    }
							 | 
						|||
| 
								 | 
							
								        //    else
							 | 
						|||
| 
								 | 
							
								        //    {
							 | 
						|||
| 
								 | 
							
								        //        return null;
							 | 
						|||
| 
								 | 
							
								        //    }
							 | 
						|||
| 
								 | 
							
								        //}
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 修改作业管线CAD修改情况
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="isoInfo"></param>
							 | 
						|||
| 
								 | 
							
								        public static void UpdateIsoInfoSaveCAD(Model.PW_IsoInfo isoInfo)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            Model.PW_IsoInfo newIsoInfo = Funs.DB.PW_IsoInfo.FirstOrDefault(e => e.ISO_ID == isoInfo.ISO_ID);
							 | 
						|||
| 
								 | 
							
								            if (newIsoInfo != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.SaveNum = isoInfo.SaveNum;
							 | 
						|||
| 
								 | 
							
								                newIsoInfo.FirstSaveDate = isoInfo.FirstSaveDate;
							 | 
						|||
| 
								 | 
							
								                Funs.DB.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据区域Id获取某条管线上的寸径总和
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="workareaId"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        //public static string getSumSize(string workareaId)
							 | 
						|||
| 
								 | 
							
								        //{
							 | 
						|||
| 
								 | 
							
								            //var sumSize = (from x in Funs.DB.PW_JointInfo join y in Funs.DB.PW_IsoInfo on x.ISO_ID equals y.ISO_ID where y.BAW_ID == workareaId select x.JOT_Size).Sum().ToString();
							 | 
						|||
| 
								 | 
							
								            //return sumSize;
							 | 
						|||
| 
								 | 
							
								        //}
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |