158 lines
7.9 KiB
C#
158 lines
7.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Data.SqlClient;
|
|
using System.Data;
|
|
using BLL;
|
|
|
|
namespace FineUIPro.Web.HJGL.RepairManage
|
|
{
|
|
public partial class QualityRatingView : PageBase
|
|
{
|
|
#region 定义量
|
|
/// <summary>
|
|
/// 返修委托明细主键
|
|
/// </summary>
|
|
private string CH_RepairItemId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["CH_RepairItemId"];
|
|
}
|
|
set
|
|
{
|
|
|
|
ViewState["CH_RepairItemId"] = value;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 加载
|
|
/// <summary>
|
|
/// 加载页面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
this.CH_RepairItemId = Request.Params["repairItemId"];
|
|
|
|
if (!string.IsNullOrEmpty(this.CH_RepairItemId))
|
|
{
|
|
//根据类型不同,显示不同的缺陷
|
|
var repairItem = BLL.HJGL_RepairItemService.GetRepairItemByID(this.CH_RepairItemId);
|
|
if (repairItem != null)
|
|
{
|
|
var repair = BLL.HJGL_RepairService.GetCH_RepairByID(repairItem.CH_RepairID);
|
|
if (repair != null)
|
|
{
|
|
if (!string.IsNullOrEmpty(repair.NDT_ID))
|
|
{
|
|
var ndt = BLL.HJGL_TestingService.GetTestingByTestingId(repair.NDT_ID);
|
|
if (ndt != null)
|
|
{
|
|
if (ndt.NDT_Code == "RT")
|
|
{
|
|
Grid1.Columns[8].Hidden = false;//裂纹
|
|
Grid1.Columns[9].Hidden = false;//未熔合
|
|
Grid1.Columns[10].Hidden = false;//未焊透
|
|
Grid1.Columns[11].Hidden = false;//条状缺陷
|
|
Grid1.Columns[12].Hidden = false;//圆形缺陷
|
|
Grid1.Columns[13].Hidden = false;//深孔缺陷
|
|
Grid1.Columns[14].Hidden = false;//根部内凹
|
|
Grid1.Columns[15].Hidden = false;//根部咬边
|
|
Grid1.Columns[18].Hidden = true;//缺陷定量
|
|
Grid1.Columns[21].Hidden = false;//缺陷位置(定量)
|
|
Grid1.Columns[21].HeaderText = "超标缺陷部位";
|
|
}
|
|
else if (ndt.NDT_Code == "UT")
|
|
{
|
|
Grid1.Columns[4].Hidden = true;
|
|
Grid1.Columns[17].Hidden = false;//检测长度
|
|
Grid1.Columns[18].Hidden = false;//峰值波幅
|
|
Grid1.Columns[21].Hidden = false;//缺陷位置
|
|
Grid1.Columns[24].Hidden = false;//缺陷深度
|
|
Grid1.Columns[27].Hidden = false;//指示长度
|
|
}
|
|
else if (ndt.NDT_Code == "MT" || ndt.NDT_Code == "PT")
|
|
{
|
|
Grid1.Columns[4].Hidden = true;
|
|
Grid1.Columns[19].Hidden = false;//缺陷性质
|
|
Grid1.Columns[21].Hidden = false;//缺陷位置
|
|
Grid1.Columns[22].Hidden = false;//缺陷尺寸
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
BindGrid();
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 数据绑定
|
|
/// <summary>
|
|
/// 数据绑定
|
|
/// </summary>
|
|
private void BindGrid()
|
|
{
|
|
string strSql = @"SELECT QualityRating.QualityRatingRepairId,QualityRating.CH_RepairItemId,QualityRating.ISO_ID,QualityRating.DefectRation,
|
|
QualityRating.Remake,QualityRating.RemakeResult,QualityRating.JOT_ID,QualityRating.FilmNum,
|
|
RepairItemRecord.RepairMark, QualityRating.Cack,QualityRating.NotFusion,QualityRating.NotPenetration,
|
|
QualityRating.StripDefects,QualityRating.CircularDefects,QualityRating.DeepHoleDefects,
|
|
QualityRating.RootsConcave,QualityRating.RootsBiteEdge,QualityRating.PseudoDefects,
|
|
QualityRating.DefectLength,QualityRating.DefectResult,QualityRating.SignMan,
|
|
QualityRating.SignDate,QualityRating.Remark,IsoInfo.ISO_IsoNo,JointInfo.JOT_JointNo,
|
|
repair.ProjectId,Project.ProjectCode,Welder.WED_Code,
|
|
QualityRating.DetectLength,
|
|
QualityRating.PeakAmplitude,
|
|
QualityRating.DefectLocation,
|
|
QualityRating.DepthDefect,
|
|
QualityRating.IndicatingLength,
|
|
QualityRating.DefectHeight,
|
|
QualityRating.DefectsHighSide,
|
|
QualityRating.DefectSize,
|
|
QualityRating.DefectNature,
|
|
QualityRating.IsPass
|
|
FROM dbo.HJGL_BO_QualityRatingRepair QualityRating
|
|
LEFT JOIN dbo.HJGL_CH_RepairItem AS repairItem ON repairItem.CH_RepairItemId = QualityRating.CH_RepairItemId
|
|
LEFT JOIN dbo.HJGL_CH_Repair AS repair ON repair.CH_RepairID = repairItem.CH_RepairID
|
|
LEFT JOIN dbo.HJGL_PW_IsoInfo AS IsoInfo ON IsoInfo.ISO_ID = QualityRating.ISO_ID
|
|
LEFT JOIN dbo.HJGL_PW_JointInfo AS JointInfo ON JointInfo.JOT_ID = QualityRating.JOT_ID
|
|
LEFT JOIN dbo.Base_Project AS Project ON Project.ProjectId = repair.ProjectId
|
|
LEFT JOIN dbo.HJGL_CH_RepairItemRecord AS RepairItemRecord ON RepairItemRecord.RepairItemRecordId = repairItem.RepairItemRecordId
|
|
LEFT JOIN dbo.HJGL_BS_Welder AS Welder ON Welder.WED_ID = RepairItemRecord.JOT_CellWelder
|
|
WHERE QualityRating.CH_RepairItemId = @CH_RepairItemId";
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|
listStr.Add(new SqlParameter("@CH_RepairItemId", this.CH_RepairItemId));
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|
// 2.获取当前分页数据
|
|
//var table = this.GetPagedDataTable(Grid1, tb1);
|
|
Grid1.RecordCount = tb.Rows.Count;
|
|
tb = GetFilteredTable(Grid1.FilteredData, tb);
|
|
var table = this.GetPagedDataTable(Grid1, tb);
|
|
Grid1.DataSource = table;
|
|
Grid1.DataBind();
|
|
}
|
|
#endregion
|
|
|
|
#region 排序
|
|
/// <summary>
|
|
/// 排序
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
|
{
|
|
BindGrid();
|
|
}
|
|
#endregion
|
|
}
|
|
} |