using BLL; using Model; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace FineUIPro.Web.WeldingProcess.TestPackageManage { public partial class selectJointCode : PageBase { private string rowId=string.Empty; private string jointcode=string.Empty; private string ptpId=string.Empty; protected void Page_Load(object sender, EventArgs e) { this.rowId = Request.Params["rowId"]; this.jointcode = Request.Params["jointcode"]; this.ptpId = Request.Params["ptpId"]; if (string.IsNullOrEmpty(this.rowId)) { ShowNotify("请先选择某条管线信息!", MessageBoxIcon.Warning); return; } if (!IsPostBack) { btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.BindGridDataSource(); this.InitGridDataChecked(); } } void InitGridDataChecked() { List list = new List(); if (!string.IsNullOrEmpty(this.jointcode)) { string[] arr=this.jointcode.Split(','); for (int i = 0;i GetDataJointGrid2(string PipelineID) { List listData = new List(); var tempData = Funs.DB.PTP_PipelineList.Where(t => t.PipelineId == PipelineID && t.IsAll == false) .AsQueryable(); if (!string.IsNullOrEmpty(this.ptpId)) { tempData = tempData.Where(t => t.PTP_ID != this.ptpId); } var newData = tempData.Select(t => t.WeldJonintCode).ToList(); foreach (var item in newData) { if (!string.IsNullOrEmpty(item)) { string[] strcode = item.Split(','); for (int i = 0; i < strcode.Length; i++) { if (!listData.Contains(strcode[i])) { listData.Add(strcode[i]); } } } } var query = Funs.DB.Pipeline_WeldJoint.Where(t => t.PipelineId == PipelineID) .OrderBy(t => t.WeldJointCode).AsQueryable(); if (listData.Count>0 ) { query = query.Where(t => !listData.Contains(t.WeldJointCode)); } return query.OrderBy(t=>t.WeldJointCode).ToList(); } } }