500 lines
23 KiB
C#
500 lines
23 KiB
C#
|
using BLL;
|
|||
|
using Model;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Data;
|
|||
|
using System.Data.SqlClient;
|
|||
|
using System.Linq;
|
|||
|
using System.Web;
|
|||
|
using System.Web.UI;
|
|||
|
using System.Web.UI.WebControls;
|
|||
|
|
|||
|
namespace FineUIPro.Web.TestRun.BeforeTestRun
|
|||
|
{
|
|||
|
public partial class InspectTailTermEdit : PageBase
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 主键
|
|||
|
/// </summary>
|
|||
|
public string TailTermId
|
|||
|
{
|
|||
|
get { return (string)ViewState["TailTermId"]; }
|
|||
|
set { ViewState["TailTermId"] = value; }
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 是否查看
|
|||
|
/// </summary>
|
|||
|
public bool IsView
|
|||
|
{
|
|||
|
get { return (bool)ViewState["IsView"]; }
|
|||
|
set { ViewState["IsView"] = value; }
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 问题图片是否可编辑
|
|||
|
/// </summary>
|
|||
|
public int QuestionEditImg
|
|||
|
{
|
|||
|
get { return (int)ViewState["QuestionEditImg"]; }
|
|||
|
set { ViewState["QuestionEditImg"] = value; }
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 整改图片是否可编辑
|
|||
|
/// </summary>
|
|||
|
public int RectifyEditImg
|
|||
|
{
|
|||
|
get { return (int)ViewState["RectifyEditImg"]; }
|
|||
|
set { ViewState["RectifyEditImg"] = value; }
|
|||
|
}
|
|||
|
|
|||
|
protected void Page_Load(object sender, EventArgs e)
|
|||
|
{
|
|||
|
if (!IsPostBack)
|
|||
|
{
|
|||
|
this.TailTermId = Request["TailTermId"];
|
|||
|
//是否查看
|
|||
|
this.IsView = string.IsNullOrWhiteSpace(Request["IsView"]) ? false : bool.Parse(Request["IsView"]);
|
|||
|
//数据绑定
|
|||
|
PageInit();
|
|||
|
//审批已经绑定
|
|||
|
gvApproveBrid();
|
|||
|
//判断是否查看
|
|||
|
if (IsView)
|
|||
|
{
|
|||
|
btnSave.Hidden = true;
|
|||
|
btnSubmit.Hidden = true;
|
|||
|
QuestionEditImg = -1;
|
|||
|
RectifyEditImg = -1;
|
|||
|
txtTailTermCode.Enabled = false;
|
|||
|
ddlConstructionUnit.Enabled = false;
|
|||
|
ddlProblemType.Enabled = false;
|
|||
|
ddlQuestionTechnologyId.Enabled = false;
|
|||
|
ddlTermItemId.Enabled = false;
|
|||
|
txtQuestionDesc.Enabled = false;
|
|||
|
txtRectifyOpinion.Enabled = false;
|
|||
|
txtRectifyTime.Enabled = false;
|
|||
|
ddlInspectUser.Enabled = false;
|
|||
|
ddlApproveUser.Enabled = false;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 默认绑定
|
|||
|
/// </summary>
|
|||
|
public void PageInit()
|
|||
|
{
|
|||
|
QuestionEditImg = 0;
|
|||
|
RectifyEditImg = 0;
|
|||
|
//施工单位
|
|||
|
UnitService.InitUnitByProjectIdUnitTypeDropDownList(ddlConstructionUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, false);
|
|||
|
//获取用户信息
|
|||
|
var users = from user in Funs.DB.Sys_User
|
|||
|
join projectrole in Funs.DB.Project_ProjectUser on user.UserId equals projectrole.UserId
|
|||
|
where projectrole.ProjectId == this.CurrUser.LoginProjectId
|
|||
|
select user;
|
|||
|
//检查人和审核人
|
|||
|
if (users.Count() > 0)
|
|||
|
{
|
|||
|
//检查人
|
|||
|
ddlInspectUser.DataTextField = "UserName";
|
|||
|
ddlInspectUser.DataValueField = "UserId";
|
|||
|
ddlInspectUser.DataSource = users;
|
|||
|
ddlInspectUser.DataBind();
|
|||
|
//审核人
|
|||
|
ddlApproveUser.DataTextField = "UserName";
|
|||
|
ddlApproveUser.DataValueField = "UserId";
|
|||
|
ddlApproveUser.DataSource = users;
|
|||
|
ddlApproveUser.DataBind();
|
|||
|
}
|
|||
|
var model = Funs.DB.PreRun_InspectTailTerm.FirstOrDefault(x => x.TailTermId == this.TailTermId);
|
|||
|
if (model != null)
|
|||
|
{
|
|||
|
//项目名称
|
|||
|
txtProjectName.Text = model.ProjectName;
|
|||
|
//巡检编号
|
|||
|
txtTailTermCode.Text = model.TailTermCode;
|
|||
|
//施工单位
|
|||
|
ddlConstructionUnit.SelectedValue = model.ConstructionUnit;
|
|||
|
//问题类别
|
|||
|
ddlProblemType.SelectedValue = model.ProblemType.ToString();
|
|||
|
//绑定管道或者设备
|
|||
|
if (model.ProblemType == 1)
|
|||
|
{
|
|||
|
var sysPipingData = from proper in Funs.DB.PreRun_PropertySysPiping
|
|||
|
join selectproper in Funs.DB.PreRun_SubPropertySelect on proper.PropertyId equals selectproper.PropertyId
|
|||
|
join termitem in Funs.DB.PreRun_SubInspectTermItem on proper.PropertyId equals termitem.PropertyTechnologyId
|
|||
|
where termitem.InspectionResults == 0 && termitem.InspectedUser == this.CurrUser.UserId
|
|||
|
group proper by new { proper.PropertyId, proper.PipingCode } into t
|
|||
|
select new
|
|||
|
{
|
|||
|
Id = t.Key.PropertyId,
|
|||
|
Code = $"管道:({t.Key.PipingCode})"
|
|||
|
};
|
|||
|
if (sysPipingData.Count() > 0)
|
|||
|
{
|
|||
|
ddlQuestionTechnologyId.DataTextField = "Code";
|
|||
|
ddlQuestionTechnologyId.DataValueField = "Id";
|
|||
|
ddlQuestionTechnologyId.DataSource = sysPipingData;
|
|||
|
ddlQuestionTechnologyId.DataBind();
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
var sysPipingData = from technology in Funs.DB.PreRun_TechnologySysPiping
|
|||
|
join selecttechnology in Funs.DB.PreRun_SubTechnologySelect on technology.TechnologyId equals selecttechnology.TechnologyId
|
|||
|
join termitem in Funs.DB.PreRun_SubInspectTermItem on technology.TechnologyId equals termitem.PropertyTechnologyId
|
|||
|
where termitem.InspectionResults == 0 && termitem.InspectedUser == this.CurrUser.UserId
|
|||
|
group technology by new { technology.TechnologyId, technology.TagNumber } into t
|
|||
|
select new
|
|||
|
{
|
|||
|
Id = t.Key.TechnologyId,
|
|||
|
Code = $"设备:({t.Key.TagNumber})"
|
|||
|
};
|
|||
|
if (sysPipingData.Count() > 0)
|
|||
|
{
|
|||
|
ddlQuestionTechnologyId.DataTextField = "Code";
|
|||
|
ddlQuestionTechnologyId.DataValueField = "Id";
|
|||
|
ddlQuestionTechnologyId.DataSource = sysPipingData;
|
|||
|
ddlQuestionTechnologyId.DataBind();
|
|||
|
}
|
|||
|
}
|
|||
|
//管道/设备
|
|||
|
ddlQuestionTechnologyId.SelectedValue = model.QuestionTechnologyId;
|
|||
|
//绑定检查项
|
|||
|
if (!string.IsNullOrWhiteSpace(ddlQuestionTechnologyId.SelectedValue))
|
|||
|
{
|
|||
|
var TermItemIds = Funs.DB.PreRun_InspectTailTerm.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.TailTermId != this.TailTermId).Select(a => a.TermItemId).ToList();
|
|||
|
var list = new List<PreRun_SubInspectTermItem>();
|
|||
|
if (TermItemIds.Count > 0)
|
|||
|
{
|
|||
|
list = Funs.DB.PreRun_SubInspectTermItem.Where(x => x.InspectionResults == 0 && x.PropertyTechnologyId == ddlQuestionTechnologyId.SelectedValue && !TermItemIds.Contains(x.TermItemId)).ToList();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
list = Funs.DB.PreRun_SubInspectTermItem.Where(x => x.InspectionResults == 0 && x.PropertyTechnologyId == ddlQuestionTechnologyId.SelectedValue).ToList();
|
|||
|
}
|
|||
|
if (list.Count() > 0)
|
|||
|
{
|
|||
|
ddlTermItemId.DataTextField = "WorkInspectName";
|
|||
|
ddlTermItemId.DataValueField = "TermItemId";
|
|||
|
ddlTermItemId.DataSource = list;
|
|||
|
ddlTermItemId.DataBind();
|
|||
|
}
|
|||
|
}
|
|||
|
//检查项
|
|||
|
ddlTermItemId.SelectedValue = model.TermItemId;
|
|||
|
//问题描述
|
|||
|
txtQuestionDesc.Text = model.QuestionDesc;
|
|||
|
//整改意见
|
|||
|
txtRectifyOpinion.Text = model.RectifyOpinion;
|
|||
|
//整改时间
|
|||
|
txtRectifyTime.Text = model.RectifyTime != null ? model.RectifyTime.Value.ToString("yyyy-MM-dd hh:mm:ss") : string.Empty;
|
|||
|
//检查人
|
|||
|
ddlInspectUser.SelectedValue = model.InspectUser;
|
|||
|
//审核人
|
|||
|
ddlApproveUser.SelectedValue = model.ApproveUser;
|
|||
|
if (model.ApproveState > 1)
|
|||
|
{
|
|||
|
QuestionEditImg = -1;
|
|||
|
RectifyEditImg = -1;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
this.TailTermId = Guid.NewGuid().ToString();
|
|||
|
var projectModel = Funs.DB.Base_Project.FirstOrDefault(e => e.ProjectId == this.CurrUser.LoginProjectId);
|
|||
|
if (projectModel != null)
|
|||
|
{
|
|||
|
txtProjectName.Text = projectModel.ProjectName;
|
|||
|
string code = projectModel.ProjectCode + "-06-CM03-XJ-";
|
|||
|
txtTailTermCode.Text = SQLHelper.RunProcNewId("SpGetNewCode5", "dbo.PreRun_InspectTailTerm", "TailTermCode", code);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 审批意见绑定
|
|||
|
/// </summary>
|
|||
|
public void gvApproveBrid()
|
|||
|
{
|
|||
|
string strSql = @"select a.InspectTermId,a.ApproveOpinion,a.ApproveTime,a.ApproveState,(case a.ApproveState when 0 then '退回' when 1 then '通过' else '' end) as ApproveStateName,a.AddUser,a.AddTime from PreRun_InspectTermApproveRecords as a inner join PreRun_InspectTailTerm as b on a.TailTermId=b.TailTermId inner join PreRun_SubInspectTermItem as c on c.TermItemId=a.TermItemId where 1=1 and a.ProjectId=@ProjectId and a.TailTermId=@TailTermId ";
|
|||
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|||
|
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
|||
|
listStr.Add(new SqlParameter("@TailTermId", this.TailTermId));
|
|||
|
strSql += " order by a.AddTime asc";
|
|||
|
SqlParameter[] parameter = listStr.ToArray();
|
|||
|
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|||
|
gvApprove.DataSource = tb;
|
|||
|
gvApprove.DataBind();
|
|||
|
}
|
|||
|
|
|||
|
#region 按钮
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 保存
|
|||
|
/// </summary>
|
|||
|
protected void btnSave_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
if (string.IsNullOrWhiteSpace(ddlConstructionUnit.SelectedValue))
|
|||
|
{
|
|||
|
ShowNotify("请选择施工单位!", MessageBoxIcon.Warning);
|
|||
|
return;
|
|||
|
}
|
|||
|
if (string.IsNullOrWhiteSpace(ddlProblemType.SelectedValue))
|
|||
|
{
|
|||
|
ShowNotify("请选择问题类别!", MessageBoxIcon.Warning);
|
|||
|
return;
|
|||
|
}
|
|||
|
if (string.IsNullOrWhiteSpace(ddlQuestionTechnologyId.SelectedValue))
|
|||
|
{
|
|||
|
ShowNotify("请选择管道/设备!", MessageBoxIcon.Warning);
|
|||
|
return;
|
|||
|
}
|
|||
|
if (string.IsNullOrWhiteSpace(ddlTermItemId.SelectedValue))
|
|||
|
{
|
|||
|
ShowNotify("请选择检查项!", MessageBoxIcon.Warning);
|
|||
|
return;
|
|||
|
}
|
|||
|
if (string.IsNullOrWhiteSpace(ddlInspectUser.SelectedValue))
|
|||
|
{
|
|||
|
ShowNotify("请选择检查人!", MessageBoxIcon.Warning);
|
|||
|
return;
|
|||
|
}
|
|||
|
if (string.IsNullOrWhiteSpace(ddlApproveUser.SelectedValue))
|
|||
|
{
|
|||
|
ShowNotify("请选择审核人!", MessageBoxIcon.Warning);
|
|||
|
return;
|
|||
|
}
|
|||
|
var isAdd = false;
|
|||
|
var model = Funs.DB.PreRun_InspectTailTerm.FirstOrDefault(x => x.TailTermId == this.TailTermId);
|
|||
|
if (model == null)
|
|||
|
{
|
|||
|
isAdd = true;
|
|||
|
model = new PreRun_InspectTailTerm();
|
|||
|
model.TailTermId = this.TailTermId;
|
|||
|
model.ProjectId = this.CurrUser.LoginProjectId;
|
|||
|
}
|
|||
|
model.ProjectName = txtProjectName.Text;
|
|||
|
model.TailTermCode = txtTailTermCode.Text;
|
|||
|
model.ConstructionUnit = ddlConstructionUnit.SelectedValue;
|
|||
|
model.ProblemType = int.Parse(ddlProblemType.SelectedValue);
|
|||
|
model.QuestionTechnologyId = ddlQuestionTechnologyId.SelectedValue;
|
|||
|
model.TermItemId = ddlTermItemId.SelectedValue;
|
|||
|
model.QuestionDesc = txtQuestionDesc.Text.Trim();
|
|||
|
model.RectifyOpinion = txtRectifyOpinion.Text.Trim();
|
|||
|
model.RectifyTime = DateTime.Parse(txtRectifyTime.Text);
|
|||
|
model.InspectUser = ddlInspectUser.SelectedValue;
|
|||
|
model.ApproveUser = ddlApproveUser.SelectedValue;
|
|||
|
model.ApproveState = 0;
|
|||
|
model.AddUser = this.CurrUser.LoginProjectId;
|
|||
|
model.AddTime = DateTime.Now;
|
|||
|
var workPack = Funs.DB.PreRun_SubInspectTermItem.FirstOrDefault(x => x.TermItemId == model.TermItemId);
|
|||
|
if (workPack != null)
|
|||
|
{
|
|||
|
model.WorkPackId = workPack.WorkPackId;
|
|||
|
}
|
|||
|
if (isAdd)
|
|||
|
{
|
|||
|
Funs.DB.PreRun_InspectTailTerm.InsertOnSubmit(model);
|
|||
|
}
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
ShowNotify("操作成功!", MessageBoxIcon.Success);
|
|||
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 保存并提交
|
|||
|
/// </summary>
|
|||
|
protected void btnSubmit_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
if (string.IsNullOrWhiteSpace(ddlConstructionUnit.SelectedValue))
|
|||
|
{
|
|||
|
ShowNotify("请选择施工单位!", MessageBoxIcon.Warning);
|
|||
|
return;
|
|||
|
}
|
|||
|
if (string.IsNullOrWhiteSpace(ddlProblemType.SelectedValue))
|
|||
|
{
|
|||
|
ShowNotify("请选择问题类别!", MessageBoxIcon.Warning);
|
|||
|
return;
|
|||
|
}
|
|||
|
if (string.IsNullOrWhiteSpace(ddlQuestionTechnologyId.SelectedValue))
|
|||
|
{
|
|||
|
ShowNotify("请选择管道/设备!", MessageBoxIcon.Warning);
|
|||
|
return;
|
|||
|
}
|
|||
|
if (string.IsNullOrWhiteSpace(ddlTermItemId.SelectedValue))
|
|||
|
{
|
|||
|
ShowNotify("请选择检查项!", MessageBoxIcon.Warning);
|
|||
|
return;
|
|||
|
}
|
|||
|
if (string.IsNullOrWhiteSpace(ddlInspectUser.SelectedValue))
|
|||
|
{
|
|||
|
ShowNotify("请选择检查人!", MessageBoxIcon.Warning);
|
|||
|
return;
|
|||
|
}
|
|||
|
if (string.IsNullOrWhiteSpace(ddlApproveUser.SelectedValue))
|
|||
|
{
|
|||
|
ShowNotify("请选择审核人!", MessageBoxIcon.Warning);
|
|||
|
return;
|
|||
|
}
|
|||
|
var isAdd = false;
|
|||
|
var model = Funs.DB.PreRun_InspectTailTerm.FirstOrDefault(x => x.TailTermId == this.TailTermId);
|
|||
|
if (model == null)
|
|||
|
{
|
|||
|
isAdd = true;
|
|||
|
model = new PreRun_InspectTailTerm();
|
|||
|
model.TailTermId = this.TailTermId;
|
|||
|
model.ProjectId = this.CurrUser.LoginProjectId;
|
|||
|
}
|
|||
|
model.ProjectName = txtProjectName.Text;
|
|||
|
model.TailTermCode = txtTailTermCode.Text;
|
|||
|
model.ConstructionUnit = ddlConstructionUnit.SelectedValue;
|
|||
|
model.ProblemType = int.Parse(ddlProblemType.SelectedValue);
|
|||
|
model.QuestionTechnologyId = ddlQuestionTechnologyId.SelectedValue;
|
|||
|
model.TermItemId = ddlTermItemId.SelectedValue;
|
|||
|
model.QuestionDesc = txtQuestionDesc.Text.Trim();
|
|||
|
model.RectifyOpinion = txtRectifyOpinion.Text.Trim();
|
|||
|
model.RectifyTime = DateTime.Parse(txtRectifyTime.Text);
|
|||
|
model.InspectUser = ddlInspectUser.SelectedValue;
|
|||
|
model.ApproveUser = ddlApproveUser.SelectedValue;
|
|||
|
model.ApproveState = 2;
|
|||
|
model.AddUser = this.CurrUser.LoginProjectId;
|
|||
|
model.AddTime = DateTime.Now;
|
|||
|
var workPack = Funs.DB.PreRun_SubInspectTermItem.FirstOrDefault(x => x.TermItemId == model.TermItemId);
|
|||
|
if (workPack != null)
|
|||
|
{
|
|||
|
model.WorkPackId = workPack.WorkPackId;
|
|||
|
}
|
|||
|
if (isAdd)
|
|||
|
{
|
|||
|
Funs.DB.PreRun_InspectTailTerm.InsertOnSubmit(model);
|
|||
|
}
|
|||
|
Funs.DB.SubmitChanges();
|
|||
|
ShowNotify("操作成功!", MessageBoxIcon.Success);
|
|||
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 问题图片
|
|||
|
/// </summary>
|
|||
|
protected void imgBtnQuestionFile_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/CheckControl&menuId={2}", QuestionEditImg, this.TailTermId + "q", Const.InspectTailTerm)));
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 整改图片
|
|||
|
/// </summary>
|
|||
|
protected void imgBtnRectifyFile_Click(object sender, EventArgs e)
|
|||
|
{
|
|||
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/CheckControl&menuId={2}", RectifyEditImg, this.TailTermId + "h", Const.InspectTailTerm)));
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region 事件
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 问题类别事件
|
|||
|
/// </summary>
|
|||
|
protected void ddlProblemType_SelectedIndexChanged(object sender, EventArgs e)
|
|||
|
{
|
|||
|
if (!string.IsNullOrWhiteSpace(ddlProblemType.SelectedValue))
|
|||
|
{
|
|||
|
if (ddlProblemType.SelectedValue == "1")
|
|||
|
{
|
|||
|
var sysPipingData = from proper in Funs.DB.PreRun_PropertySysPiping
|
|||
|
join selectproper in Funs.DB.PreRun_SubPropertySelect on proper.PropertyId equals selectproper.PropertyId
|
|||
|
join termitem in Funs.DB.PreRun_SubInspectTermItem on proper.PropertyId equals termitem.PropertyTechnologyId
|
|||
|
where termitem.InspectionResults == 0 && termitem.InspectedUser == this.CurrUser.UserId
|
|||
|
group proper by new { proper.PropertyId, proper.PipingCode } into t
|
|||
|
select new
|
|||
|
{
|
|||
|
Id = t.Key.PropertyId,
|
|||
|
Code = $"管道:({t.Key.PipingCode})"
|
|||
|
};
|
|||
|
ddlQuestionTechnologyId.Items.Clear();
|
|||
|
if (sysPipingData.Count() > 0)
|
|||
|
{
|
|||
|
ddlQuestionTechnologyId.DataTextField = "Code";
|
|||
|
ddlQuestionTechnologyId.DataValueField = "Id";
|
|||
|
ddlQuestionTechnologyId.DataSource = sysPipingData;
|
|||
|
ddlQuestionTechnologyId.DataBind();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
ddlQuestionTechnologyId.Items.Insert(0, new ListItem("==无数据==", ""));
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
var sysPipingData = from technology in Funs.DB.PreRun_TechnologySysPiping
|
|||
|
join selecttechnology in Funs.DB.PreRun_SubTechnologySelect on technology.TechnologyId equals selecttechnology.TechnologyId
|
|||
|
join termitem in Funs.DB.PreRun_SubInspectTermItem on technology.TechnologyId equals termitem.PropertyTechnologyId
|
|||
|
where termitem.InspectionResults == 0 && termitem.InspectedUser == this.CurrUser.UserId
|
|||
|
group technology by new { technology.TechnologyId, technology.TagNumber } into t
|
|||
|
select new
|
|||
|
{
|
|||
|
Id = t.Key.TechnologyId,
|
|||
|
Code = $"设备:({t.Key.TagNumber})"
|
|||
|
};
|
|||
|
ddlQuestionTechnologyId.Items.Clear();
|
|||
|
if (sysPipingData.Count() > 0)
|
|||
|
{
|
|||
|
ddlQuestionTechnologyId.DataTextField = "Code";
|
|||
|
ddlQuestionTechnologyId.DataValueField = "Id";
|
|||
|
ddlQuestionTechnologyId.DataSource = sysPipingData;
|
|||
|
ddlQuestionTechnologyId.DataBind();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
ddlQuestionTechnologyId.Items.Insert(0, new ListItem("==无数据==", ""));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 管道/设备
|
|||
|
/// </summary>
|
|||
|
protected void ddlQuestionTechnologyId_SelectedIndexChanged(object sender, EventArgs e)
|
|||
|
{
|
|||
|
if (string.IsNullOrWhiteSpace(ddlQuestionTechnologyId.SelectedValue)) return;
|
|||
|
var TermItemIds = Funs.DB.PreRun_InspectTailTerm.Where(x => x.ProjectId == this.CurrUser.LoginProjectId && x.TailTermId != this.TailTermId).Select(a => a.TermItemId).ToList();
|
|||
|
var list = new List<PreRun_SubInspectTermItem>();
|
|||
|
if (TermItemIds.Count > 0)
|
|||
|
{
|
|||
|
list = Funs.DB.PreRun_SubInspectTermItem.Where(x => x.InspectionResults == 0 && x.PropertyTechnologyId == ddlQuestionTechnologyId.SelectedValue && !TermItemIds.Contains(x.TermItemId)).ToList();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
list = Funs.DB.PreRun_SubInspectTermItem.Where(x => x.InspectionResults == 0 && x.PropertyTechnologyId == ddlQuestionTechnologyId.SelectedValue).ToList();
|
|||
|
}
|
|||
|
ddlTermItemId.Items.Clear();
|
|||
|
if (list.Count() > 0)
|
|||
|
{
|
|||
|
ddlTermItemId.DataTextField = "WorkInspectName";
|
|||
|
ddlTermItemId.DataValueField = "TermItemId";
|
|||
|
ddlTermItemId.DataSource = list;
|
|||
|
ddlTermItemId.DataBind();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
ddlTermItemId.Items.Insert(0, new ListItem("==无数据==", ""));
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|