/// <summary> /// 设置传出值,并启动详细信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _fpPreWaringLastedValue_CellClick(object sender, CellClickEventArgs e) { //当选择行的数据是预警结果属于正常时,锁定单元格。检测到单元格锁定时,返回,屏蔽窗体弹出 if (cells[e.Row, e.Column].Locked) { return; } if (e.Row < 5) { return; } // 第14列是预警结果详细信息 if (e.Column == 14) { // 第0列是工作面名称 var workface = cells[e.Row, COLUMN_INDEX_WORKFACE_NAME].Text; // 第17列是巷道Id var tunnelId = cells[e.Row, COLUMN_INDEX_HIDE_TUNNEL_ID].Text; // 第18列是日期时间 var dateTime = cells[e.Row, COLUMN_INDEX_HIDE_DATETIME].Text; // 第19列是班次 var shift = cells[e.Row, COLUMN_INDEX_HIDE_SHIFT].Text; // 预警id var warningIdList = new List <string>(); warningIdList = PreWarningLastedResultQueryBLL.GetWarningIdListWithTunnelId(tunnelId); //warningIdList.Add(cells[e.Row, COLUMN_INDEX_HIDE_OVERLIMIT_WARNING_ID].Text); //warningIdList.Add(cells[e.Row, COLUMN_INDEX_HIDE_OUTBURST_WARNING_ID].Text); if (workface == "" || dateTime == "" || shift == "" || tunnelId == "") { return; } // 处理状态 var sHandleStatus = cells[e.Row, COLUMN_INDEX_HIDE_OUTBURST_HANDLE_STATUS].Text; //设置传出值 //工作面名称 OutInfo.WarkingFaceName = workface; //日期 OutInfo.DateTime = dateTime; //班次 OutInfo.DateShift = shift; //巷道ID OutInfo.TunnelId = tunnelId; OutInfo.WarningIdList = warningIdList; var pwrdq = new PreWarningResultDetailsQuery(OutInfo, false); pwrdq.ShowDialog(); //pwrdq.Show();//不能用Show,否则点击详细信息按钮时会弹回至实时预警 } }
//预警结果详细信息按钮触发事件 private void _fpPreWarningDetials_CellClick(object sender, CellClickEventArgs e) { if (e.Column == 2) { var rowIndex = 0; if (e != null) { rowIndex = e.Row; } else { return; } if (_fpPreWarningDetials.ActiveSheet.Cells[rowIndex, 1].Value == null) { return; } var warningtype = ""; var warningitem = ""; //取出选择的项对应的类型 //枚举中的项个数 var warningItemCount = Enum.GetNames(typeof(WarningReasonItems)).Length; #region 取出选择的项对应的值 if (rowIndex >= _iDetailsRowHeaderCount && rowIndex <= _iDetailsRowHeaderCount + warningItemCount) { warningtype = WarningTypeCHN.超限预警.ToString(); } else if (rowIndex >= 2 * _iDetailsRowHeaderCount + warningItemCount && rowIndex <= 2 * _iDetailsRowHeaderCount + 2 * warningItemCount) { warningtype = WarningTypeCHN.突出预警.ToString(); } if (rowIndex == (int)WarningReasonItems.瓦斯 + _iDetailsRowHeaderCount || rowIndex == (int)WarningReasonItems.瓦斯 + _iDetailsRowHeaderCount * 2 + warningItemCount) { warningitem = WarningReasonItems.瓦斯.ToString(); } else if (rowIndex == (int)WarningReasonItems.煤层赋存 + _iDetailsRowHeaderCount || rowIndex == (int)WarningReasonItems.煤层赋存 + _iDetailsRowHeaderCount * 2 + warningItemCount) { warningitem = WarningReasonItems.煤层赋存.ToString(); } else if (rowIndex == (int)WarningReasonItems.地质构造 + _iDetailsRowHeaderCount || rowIndex == (int)WarningReasonItems.地质构造 + _iDetailsRowHeaderCount * 2 + warningItemCount) { warningitem = WarningReasonItems.地质构造.ToString(); } else if (rowIndex == (int)WarningReasonItems.通风 + _iDetailsRowHeaderCount || rowIndex == (int)WarningReasonItems.通风 + _iDetailsRowHeaderCount * 2 + warningItemCount) { warningitem = WarningReasonItems.通风.ToString(); } else if (rowIndex == (int)WarningReasonItems.管理因素 + _iDetailsRowHeaderCount || rowIndex == (int)WarningReasonItems.管理因素 + _iDetailsRowHeaderCount * 2 + warningItemCount) { warningitem = WarningReasonItems.管理因素.ToString(); } else if (rowIndex == (int)WarningReasonItems.其他 + _iDetailsRowHeaderCount || rowIndex == (int)WarningReasonItems.其他 + _iDetailsRowHeaderCount * 2 + warningItemCount) { warningitem = WarningReasonItems.其他.ToString(); } #endregion //设置传出值 //预警类型 sOutWarningType = warningtype; //预警依据 sOutWarningItem = warningitem; var pwrdq = new PreWarningResultDetailsQuery("-1", sOutWorkface, sOutDate, sOutShift, sOutWarningResult, sOutWarningType, sOutWarningItem, true); pwrdq.ShowDialog(); } }