| 
									
										
										
										
											2024-04-18 15:04:08 +08:00
										 |  |  |  | using Aspose.Words; | 
					
						
							|  |  |  |  | using BLL; | 
					
						
							|  |  |  |  | using Org.BouncyCastle.Asn1.Ocsp; | 
					
						
							|  |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.Data; | 
					
						
							|  |  |  |  | using System.Data.SqlClient; | 
					
						
							|  |  |  |  | using System.IO; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Text; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace FineUIPro.Web.DataShow | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class InspectionManagementItem : PageBase | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         #region 加载页面 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 加载页面 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (!IsPostBack) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 string projectId = Request.Params["projectId"]; | 
					
						
							|  |  |  |  |                 this.txtProject.Text = ProjectService.GetProjectNameByProjectId(projectId); | 
					
						
							|  |  |  |  |                 Funs.DropDownPageSize(this.ddlPageSize); | 
					
						
							|  |  |  |  |                 btnClose.OnClientClick = ActiveWindow.GetHideReference(); | 
					
						
							|  |  |  |  |                 ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); | 
					
						
							|  |  |  |  |                 // 绑定表格t | 
					
						
							|  |  |  |  |                 BindGrid(); | 
					
						
							|  |  |  |  |                 this.Panel1.Title = "质量共检数据(" + BLL.UnitService.GetUnitNameByUnitId(BLL.Const.UnitId_CWCEC) + ")"; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 绑定数据 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         private void BindGrid() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             string strSql = @"SELECT distinct P.InspectionId, 
 | 
					
						
							|  |  |  |  |                                     P.ProjectId, | 
					
						
							|  |  |  |  |                                     P.UnitId, | 
					
						
							|  |  |  |  |                                     P.CNProfessionalId, | 
					
						
							|  |  |  |  |                                     P.UnitWorkId, | 
					
						
							|  |  |  |  |                                     U.UnitName, | 
					
						
							|  |  |  |  |                                     C.ProfessionalName, | 
					
						
							|  |  |  |  |                                     P.NoticeCode, | 
					
						
							|  |  |  |  |                                     UnitWork.UnitWorkName, | 
					
						
							|  |  |  |  |                                     DP.DivisionName AS Branch, | 
					
						
							|  |  |  |  |                                     BP.BreakdownName AS ControlPointType, | 
					
						
							|  |  |  |  |                                     BP.Class, | 
					
						
							|  |  |  |  |                                     P.AcceptanceSite, | 
					
						
							|  |  |  |  |                                     P.AcceptanceCheckMan, | 
					
						
							| 
									
										
										
										
											2025-10-24 18:27:46 +08:00
										 |  |  |  |                                     (CASE WHEN IsOnceQualified='True' THEN '是' ELSE '否' END)AS IsOnceQualified, | 
					
						
							| 
									
										
										
										
											2024-04-18 15:04:08 +08:00
										 |  |  |  |                                     P.InspectionCode, | 
					
						
							|  |  |  |  |                                     P.InspectionDate"
 | 
					
						
							|  |  |  |  |                             + @" FROM ProcessControl_InspectionManagementDetail AS D" | 
					
						
							|  |  |  |  |                             + @" LEFT JOIN ProcessControl_InspectionManagement AS P on P.InspectionId=D.InspectionId" | 
					
						
							|  |  |  |  |                             + @" LEFT JOIN Base_Unit AS U ON U.UnitId = P.UnitId" | 
					
						
							|  |  |  |  |                             + @" LEFT JOIN Base_CNProfessional C ON C.CNProfessionalId = P.CNProfessionalId" | 
					
						
							|  |  |  |  |                             + @" LEFT JOIN WBS_UnitWork AS UnitWork ON UnitWork.UnitWorkId = P.UnitWorkId" | 
					
						
							|  |  |  |  |                             + @" LEFT JOIN WBS_DivisionProject AS DP ON DP.DivisionProjectId = P.Branch" | 
					
						
							|  |  |  |  |                             + @" LEFT JOIN WBS_BreakdownProject AS BP ON BP.BreakdownProjectId = P.ControlPointType" | 
					
						
							|  |  |  |  |                             + @" WHERE P.ProjectId=@ProjectId  "; | 
					
						
							|  |  |  |  |             List<SqlParameter> listStr = new List<SqlParameter>(); | 
					
						
							|  |  |  |  |             listStr.Add(new SqlParameter("@ProjectId", Request.Params["projectId"])); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             strSql += " AND (P.InspectionDate>=@startTime or @startTime='') and (P.InspectionDate<=@endTime or @endTime='') "; | 
					
						
							|  |  |  |  |             listStr.Add(new SqlParameter("@startTime", !string.IsNullOrEmpty(txtStartTime.Text.Trim()) ? txtStartTime.Text.Trim() + " 00:00:00" : "")); | 
					
						
							|  |  |  |  |             listStr.Add(new SqlParameter("@endTime", !string.IsNullOrEmpty(txtEndTime.Text.Trim()) ? txtEndTime.Text.Trim() + "  23:59:59" : "")); | 
					
						
							|  |  |  |  |             SqlParameter[] parameter = listStr.ToArray(); | 
					
						
							|  |  |  |  |             DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); | 
					
						
							|  |  |  |  |             Grid1.RecordCount = tb.Rows.Count; | 
					
						
							|  |  |  |  |             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 TextBox_TextChanged(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 表排序、分页、关闭窗口 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 分页 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 排序 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Grid1_Sort(object sender, GridSortEventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 分页显示条数下拉框 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							| 
									
										
										
										
											2024-04-19 15:48:37 +08:00
										 |  |  |  |        | 
					
						
							| 
									
										
										
										
											2024-04-18 15:04:08 +08:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取检查人名称 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="CarryUnitIds"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         protected string ConvertCheckMan(object CarryUnitIds) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             var uname = BLL.UserService.getUserNamesUserIds(CarryUnitIds); | 
					
						
							|  |  |  |  |             if (string.IsNullOrEmpty(uname)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 uname = CarryUnitIds.ToString(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             return uname; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |