| 
									
										
										
										
											2022-06-06 11:23:24 +08:00
										 |  |  |  | using BLL; | 
					
						
							|  |  |  |  | using Newtonsoft.Json.Linq; | 
					
						
							|  |  |  |  | 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.HJGL.FL | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class NdtList : PageBase | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 加载页面 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (!IsPostBack) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); | 
					
						
							|  |  |  |  |                 // 绑定表格 | 
					
						
							|  |  |  |  |                 this.BindGrid(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnGet_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  |             var HJGL_FL_NdtLists = from x in db.HJGL_FL_NdtList where x.ProjectId == this.CurrUser.LoginProjectId select x; | 
					
						
							|  |  |  |  |             if (HJGL_FL_NdtLists.Count() > 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 db.HJGL_FL_NdtList.DeleteAllOnSubmit(HJGL_FL_NdtLists); | 
					
						
							|  |  |  |  |                 db.SubmitChanges(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             var project = db.Base_Project.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId); | 
					
						
							|  |  |  |  |             if (project != null && !string.IsNullOrEmpty(project.HJProjectCode)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 //项目无损检测量 | 
					
						
							| 
									
										
										
										
											2025-01-16 11:24:15 +08:00
										 |  |  |  |                 var str5 = APIGetHttpService.Http("https://4dgd.cwcec.com:443/csm/third/getNdtList/" + project.HJProjectCode, "GET"); | 
					
						
							| 
									
										
										
										
											2022-06-06 11:23:24 +08:00
										 |  |  |  |                 if (!string.IsNullOrEmpty(str5)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     JArray arr1 = JArray.Parse(str5); | 
					
						
							|  |  |  |  |                     foreach (var item1 in arr1) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         Model.HJGL_FL_NdtList tq = new Model.HJGL_FL_NdtList(); | 
					
						
							|  |  |  |  |                         tq.NdtListId = SQLHelper.GetNewID(); | 
					
						
							|  |  |  |  |                         tq.ProjectId = project.ProjectId; | 
					
						
							|  |  |  |  |                         tq.DeviceName = item1["deviceName"].ToString(); | 
					
						
							|  |  |  |  |                         tq.DeviceNumber = item1["deviceCode"].ToString(); | 
					
						
							|  |  |  |  |                         tq.ZoneCode = item1["zoneCode"].ToString(); | 
					
						
							|  |  |  |  |                         tq.UnitName = item1["unitName"].ToString(); | 
					
						
							|  |  |  |  |                         tq.TheoreticalWeldedJointsTotal = item1["theoreticalWeldedJointsTotal"].ToString(); | 
					
						
							|  |  |  |  |                         tq.TestWeldAmount = item1["testWeldAmount"].ToString(); | 
					
						
							|  |  |  |  |                         tq.OnceQualifiedQuantity = item1["onceQualifiedQuantity"].ToString(); | 
					
						
							|  |  |  |  |                         tq.OneTimeFilmAmount = item1["oneTimeFilmAmount"].ToString(); | 
					
						
							|  |  |  |  |                         tq.OneTimeFilmQualifiedAmount = item1["oneTimeFilmQualifiedAmount"].ToString(); | 
					
						
							|  |  |  |  |                         db.HJGL_FL_NdtList.InsertOnSubmit(tq); | 
					
						
							|  |  |  |  |                         db.SubmitChanges(); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                     ShowNotify("获取成功!", MessageBoxIcon.Success); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 ShowNotify("请确认项目已使用4D系统,并已在项目信息中设置了对应的焊接软件项目编号!", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             this.BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-14 16:38:27 +08:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 内网进入软件 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnUrlN_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-04-08 09:51:43 +08:00
										 |  |  |  |             PageContext.RegisterStartupScript(String.Format("window.open('https://4dgd.cwcec.com/');")); | 
					
						
							| 
									
										
										
										
											2022-09-14 16:38:27 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-06 11:23:24 +08:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 绑定数据 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         private void BindGrid() | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-19 09:35:49 +08:00
										 |  |  |  |             string strSql = @"select *,
 | 
					
						
							|  |  |  |  |                             cast((case when c.TestWeldAmount='0' or c.TestWeldAmount='' then 0 when c.OnceQualifiedQuantity='0' or c.OnceQualifiedQuantity='' then 0 else 100.0 * cast(c.OnceQualifiedQuantity as DECIMAL(9,2))/(1.0 * cast(c.TestWeldAmount as DECIMAL(9,2))) end) AS DECIMAL(9,2)) as OneOKRate, | 
					
						
							|  |  |  |  |                             cast((case when c.OneTimeFilmAmount='0' or c.OneTimeFilmAmount='' then 0 when c.OneTimeFilmQualifiedAmount='0' or c.OneTimeFilmQualifiedAmount='' then 0 else 100.0 * cast(c.OneTimeFilmQualifiedAmount as DECIMAL(9,2))/(1.0 * cast(c.OneTimeFilmAmount as DECIMAL(9,2))) end) AS DECIMAL(9,2)) as OneOKFilmRate | 
					
						
							| 
									
										
										
										
											2022-06-06 11:23:24 +08:00
										 |  |  |  |                             from dbo.HJGL_FL_NdtList c  | 
					
						
							|  |  |  |  |                             where c.ProjectId=@ProjectId order by c.DeviceName,DeviceNumber,ZoneCode";
 | 
					
						
							|  |  |  |  |             List<SqlParameter> listStr = new List<SqlParameter>(); | 
					
						
							|  |  |  |  |             listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); | 
					
						
							|  |  |  |  |             SqlParameter[] parameter = listStr.ToArray(); | 
					
						
							|  |  |  |  |             DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); | 
					
						
							|  |  |  |  |             Grid1.RecordCount = tb.Rows.Count; | 
					
						
							|  |  |  |  |             //tb = GetFilteredTable(Grid1.FilteredData, tb); | 
					
						
							|  |  |  |  |             var table = this.GetPagedDataTable(Grid1, tb); | 
					
						
							|  |  |  |  |             Grid1.DataSource = table; | 
					
						
							|  |  |  |  |             Grid1.DataBind(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #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 ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 排序 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |