private void spdData_CellClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e) { if (e.Column == 6) { string strOper = spdData.ActiveSheet.Cells[e.Row, 1].Value.ToString(); string strLotId = spdData.ActiveSheet.Cells[e.Row, 6].Value.ToString(); string strStartTime = spdData.ActiveSheet.Cells[e.Row, 4].Value.ToString(); string strPattern = spdData.ActiveSheet.Cells[e.Row, 2].Value.ToString(); DataTable dt = CmnFunction.oComm.GetFuncDataTable("DYNAMIC", LotIDStringForPopup(strOper, strLotId, strStartTime, strPattern)); if (dt != null && dt.Rows.Count > 0) { System.Windows.Forms.Form frm = new PQC031002_P1(strLotId, dt); frm.ShowDialog(); } } }
private Boolean fnDataFind(char cStep) { /**************************************************** * comment : 검색조건에 맞는 데이터를 검색한다. * * created by : bee-jae jung(2010-08-10-화요일) * * modified by : bee-jae jung(2010-08-10-화요일) ****************************************************/ FarPoint.Win.Spread.CellType.ButtonCellType ButtonCellType = new FarPoint.Win.Spread.CellType.ButtonCellType(); String QRY = ""; DataTable DT = null; try { Cursor.Current = Cursors.WaitCursor; LoadingPopUp.LoadIngPopUpShow(this); switch (cStep) { case '1': // 2010-08-10-정비재 : 입력한 검색조건의 데이터를 조회한다. GridColumnInit(SS); SS.Sheets[0].RowCount = 0; // 2010-08-10-정비재 : 검색조건에 따른 Open의 온도이력을 조회한다. QRY = "SELECT A.RES_ID AS RES_ID \n" + " , A.OPER AS OPER \n" + " , TO_CHAR(TO_DATE(A.MIN_TIME, 'YYYYMMDDHH24MISS'), 'YYYY-MM-DD HH24:MI:SS') AS MIN_TIME \n" + " , TO_CHAR(TO_DATE(A.MAX_TIME, 'YYYYMMDDHH24MISS'), 'YYYY-MM-DD HH24:MI:SS') AS MAX_TIME \n" + " , A.LOT_ID AS LOT_ID \n" + " , '↓' \n" + " , A.MAT_ID AS MAT_ID \n" + " , A.PATTERN_NO AS PATTERN_NO \n" + " , A.MIN_TIME AS START_TIME \n" + " FROM (SELECT RES_ID AS RES_ID \n" + " , OPER AS OPER \n" + " , PATTERN_NO AS PATTERN_NO \n" + " , MIN(TEMP_TIME) AS MIN_TIME \n" + " , MAX(TEMP_TIME) AS MAX_TIME \n" + " , LOT_ID AS LOT_ID \n" + " , MAT_ID AS MAT_ID \n" + " , ' ' AS FILE_NAME \n" // 2014-04-01-KJY: Change Database Source (MESMGR -> OVNMGR) //+ " FROM MRASLOTOVN@RPTTOMES \n" + " FROM OVNMGR.MRASLOTOVN \n" + " WHERE FACTORY " + cdvFactory.SelectedValueToQueryString + "\n" + " AND TEMP_TIME >= '" + cdvFromToDate.ExactFromDate + "' \n" + " AND TEMP_TIME <= '" + cdvFromToDate.ExactToDate + "' \n" + " AND OPER LIKE '" + (cdvStep.Text == "ALL" ? "%" : cdvStep.Text) + "' || '%' \n" + " AND RES_ID LIKE '" + (cdvOven.Text == "ALL" ? "%" : cdvOven.Text) + "' || '%' \n" + " AND MAT_ID LIKE '" + txtProduct.Text + "' || '%' \n" + " AND LOT_ID LIKE '" + txtLotID.Text + "' || '%' \n" + " GROUP BY RES_ID, MAT_ID, OPER, LOT_ID, PATTERN_NO) A \n" + " ORDER BY A.RES_ID, A.OPER, A.MIN_TIME, A.LOT_ID"; DT = CmnFunction.oComm.GetFuncDataTable("DYNAMIC", QRY); if (DT.Rows.Count <= 0) { DT.Dispose(); LoadingPopUp.LoadingPopUpHidden(); CmnFunction.ShowMsgBox(RptMessages.GetMessage("STD010", GlobalVariable.gcLanguage)); return(false); } SS.DataSource = DT; SS.RPT_AutoFit(false); // 2010-09-16-정비재 : SS의 Columns 항목을 Button으로 변경한다. ButtonCellType.Text = "↓"; SS.Sheets[0].Columns[5].CellType = ButtonCellType; break; case '2': QRY = "SELECT DEF.OPER \n" + " , DECODE(DEF.MARK, '', LAG(DEF.MARK) OVER(ORDER BY ROWNUM), DEF.MARK) AS MARK \n" + " , DECODE(REAL.REAL_DATA, '', DECODE(DEF.MARK, '', LAG(DEF.MARK) OVER(ORDER BY ROWNUM), DEF.MARK), REAL.REAL_DATA) AS REAL_DATA \n" + " FROM (SELECT OPER \n" + " , 0 AS MARK \n" + " , MAX(REAL) AS REAL_DATA \n" + " FROM (SELECT (TRUNC(MOD((TO_DATE(TEMP_TIME, 'YYYYMMDDHH24MISS') - TO_DATE('" + SS.Sheets[0].Cells[SS_ActiveIndex, 8].Text + "', 'YYYYMMDDHH24MISS')), 1) * 24) * 60) \n" + " + (TRUNC(MOD((TO_DATE(TEMP_TIME, 'YYYYMMDDHH24MISS') - TO_DATE('" + SS.Sheets[0].Cells[SS_ActiveIndex, 8].Text + "', 'YYYYMMDDHH24MISS')) * 24, 1) * 60)) AS OPER \n" + " , 0 AS MARK \n" + " , TEMP AS REAL \n" + " FROM OVNMGR.MRASLOTOVN \n" + " WHERE FACTORY " + cdvFactory.SelectedValueToQueryString + "\n" + " AND LOT_ID = '" + SS.Sheets[0].Cells[SS_ActiveIndex, 4].Text + "' \n" + " AND OPER = '" + SS.Sheets[0].Cells[SS_ActiveIndex, 1].Text + "') \n" + " GROUP BY OPER) REAL \n" + " , (SELECT OPER \n" + " , NVL(ROUND(FROM_TEMP + (TO_TEMP - FROM_TEMP) / TIME_GAP * (OPER - FROM_TIME)), TO_TEMP) AS MARK \n" + " , 0 AS REAL_DATA \n" + " FROM (SELECT NVL(LAG(TIME) OVER(ORDER BY SEQUENCE), 0) AS FROM_TIME \n" + " , TIME AS TO_TIME \n" + " , TIME_GAP AS TIME_GAP \n" + " , NVL(LAG(TEMP) OVER(ORDER BY SEQUENCE), 25) AS FROM_TEMP \n" + " , TEMP AS TO_TEMP \n" + " FROM (SELECT SEQUENCE, SUM(TIME) OVER(ORDER BY SEQUENCE ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS TIME \n" + " , TIME AS TIME_GAP \n" + " , TEMP AS TEMP \n" + " FROM MRASOVNDEF@RPTTOMES \n" + " WHERE PATTERN_NO = '" + SS.Sheets[0].Cells[SS_ActiveIndex, 7].Text + "')) DEF \n" + " , (SELECT OPER AS OPER \n" + " FROM (SELECT 0 AS OPER FROM DUAL \n" + " UNION ALL \n" + " SELECT LEVEL AS OPER FROM DUAL \n" + " WHERE LEVEL >= 0 \n" + " CONNECT BY LEVEL <= (SELECT MAX(TIME) AS TIME \n" + " FROM (SELECT SUM(TIME) OVER(ORDER BY SEQUENCE ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS TIME \n" + " FROM MRASOVNDEF@RPTTOMES \n" + " WHERE PATTERN_NO = '" + SS.Sheets[0].Cells[SS_ActiveIndex, 7].Text + "')))) TIME \n" + " WHERE TIME.OPER >= DEF.FROM_TIME(+) \n" + " AND TIME.OPER < DEF.TO_TIME(+)) DEF \n" + " WHERE REAL.OPER(+) = DEF.OPER \n" + " ORDER BY DEF.OPER"; DT = CmnFunction.oComm.GetFuncDataTable("DYNAMIC", QRY); if (DT != null && DT.Rows.Count > 0) { Form frmChart = new PQC031002_P1(SS.Sheets[0].Cells[SS_ActiveIndex, 4].Text, DT); LoadingPopUp.LoadingPopUpHidden(); frmChart.ShowDialog(); } break; } return(true); } catch (Exception ex) { LoadingPopUp.LoadingPopUpHidden(); CmnFunction.ShowMsgBox(ex.Message); return(false); } finally { LoadingPopUp.LoadingPopUpHidden(); Cursor.Current = Cursors.Default; } }