private void Click_EXCEL_EXPORT_Button() { try { DataTable dt = this.dtDataSource.Copy(); if (dt.Columns.Contains(Definition.CHART_COLUMN.TIME2)) { dt.Columns.Remove(Definition.CHART_COLUMN.TIME2); } this.bSpread1.ActiveSheet.RowCount = 0; this.bSpread1.ActiveSheet.ColumnCount = 0; this.bSpread1.ClearHead(); this.bSpread1.AddHeadComplete(); this.bSpread1.UseSpreadEdit = false; this.bSpread1.AutoGenerateColumns = true; this.bSpread1.DataSource = dt; this.bSpread1_Sheet1.SheetName = this.Name; this.bSpread1.Export(false); } catch (Exception ex) { MSGHandler.DisplayMessage(MSGType.Error, ex.ToString()); EESUtil.DebugLog("BTeeChart", "ExportDataForExcel", ex); } }
public string SetSummaryModel(byte[] baData) { //string sSuccess = ""; string sResult = ""; try { LinkedList llstData = new LinkedList(); llstData.SetSerialData(baData); string sEQPID = ""; if (llstData[Definition.CONDITION_KEY_EQP_ID] != null) { sEQPID = llstData[Definition.CONDITION_KEY_EQP_ID].ToString(); } EESMessage eesmessage = new EESMessage(); eesmessage.ServiceID = MESSAGE._SERVICE_ID; eesmessage.Target = sEQPID; eesmessage.ReplySubject = ""; eesmessage.Tid = "0"; eesmessage.Source = MESSAGE._SOURCE; eesmessage.User = llstData[Definition.CONDITION_KEY_USER_ID].ToString(); eesmessage.EESTid = ""; eesmessage.Pid = ""; eesmessage.Type = "T"; eesmessage.MethodID = MESSAGE._METHOD_ID_SET_SUMMARY_MODEL; eesmessage.AddValue(MESSAGE._EES_DATA_KEY_EQP_ID, sEQPID); int iTimeOut = MESSAGE._TIME_OUT; string sSendMessage = eesmessage.ToString(); if (_MsgBusType.Equals(Definition.TARGET_MSG_BUS_INFO_TIB)) { TIBInterface tibinterface = new TIBInterface(); tibinterface.ParentSQLHandler = this; //tibinterface.SetTragetConfig(); tibinterface.Send(sSendMessage, eesmessage); } else if (_MsgBusType.Equals(Definition.TARGET_MSG_BUS_INFO_AMQ)) { ActiveMQInterface amqinterface = new ActiveMQInterface(); amqinterface.Send(sSendMessage); } } catch (Exception ex) { EESUtil.ThrowExceptionMessage(ex.Message, ex.StackTrace); } finally { } return(sResult); }
private void Chart_MouseLeave(object sender, EventArgs e) { try { BaseChart baseChart = FindSPCChart((Control)sender); Annotation ann; if (baseChart is DefaultChart) { for (int i = 0; i < baseChart.SPCChart.Chart.Tools.Count; i++) { if (baseChart.SPCChart.Chart.Tools[i].GetType() == typeof(Annotation)) { ann = baseChart.SPCChart.Chart.Tools[i] as Annotation; if (ann.Active) { ann.Active = false; } } } } } catch (Exception ex) { EESUtil.DebugLog(ex); } }
private void SPCChart_ClickSeries(object sender, Series s, int valueIndex, MouseEventArgs e) { try { SeriesInfo seriesInfo = ((ChartSeriesGroup)sender).GetSeriesInfo(s); if (seriesInfo == null || !seriesInfo.SeriesData.Columns.Contains(CommonChart.COLUMN_NAME_SEQ_INDEX)) { return; } #region ToolTip BaseChart baseChart = FindSPCChart((Control)sender); if (baseChart is DefaultChart) { this._chartInfomationUI.InfomationSpreadReSet(this._dataManager.RawDataTable.Rows[valueIndex]); _valueIndex = valueIndex; string strCol = s.Title; if (strCol == Definition.CHART_COLUMN.USL_LSL) { strCol = Definition.CHART_COLUMN.USL; } else if (strCol == Definition.CHART_COLUMN.UCL_LCL) { strCol = Definition.CHART_COLUMN.UCL; } string strValue = seriesInfo.SeriesData.Rows[valueIndex][strCol].ToString(); for (int i = 0; i < baseChart.SPCChart.Chart.Tools.Count; i++) { if (baseChart.SPCChart.Chart.Tools[i].GetType() == typeof(Steema.TeeChart.Tools.Annotation)) { Annotation ann = (Annotation)baseChart.SPCChart.Chart.Tools[i]; this._chartUtil.ShowAnnotate(baseChart.SPCChart.Chart, ann, e.X, e.Y, CreateToolTipString(strCol, strValue, valueIndex, baseChart.NAME)); break; } } } #endregion } catch (Exception ex) { EESUtil.DebugLog(ex); _valueIndex = -1; } }
/// <summary> /// It makes XmlDocument from 'queryxml' parameter of the requested URL /// </summary> /// <returns>If it is success, return XmlDocument /// If it is not needed to proceess, return null /// If not matched functionName or if parameters of the requested url is invalid, return null</returns> public XmlDocument GetXmlDocFromQueryXmlOfRequestedUrl(string functionName) { if (!this.CheckIfNeedToProcessURLQuery(functionName)) { return(null); } NameValueCollection nvcQueryString = EESUtil.ParsingHttpQueryString(EESUtil.GetHttpQueryString()); XmlDocument xmldocQueryXml = new XmlDocument(); try { xmldocQueryXml.LoadXml(nvcQueryString["queryxml"]); } catch { return(null); } return(xmldocQueryXml); }
/// <summary> /// It check if the page is to needed to process parameters of the requsted URL. /// Example of a url needed to process : http://192.168.1.94/ees/EES.application?func=SPCChartViewUC&dllname=eSPC/BISTel.eSPC.Page.dll&classname=BISTel.eSPC.Page.Report.SPCChartViewUC /// &queryxml=%3Cees_querystring%3E%3Cpage_info%3E%3Cdll%3EeSPC%2FBISTel.eSPC.Page.dll%3C%2Fdll%3E%3Cclass%3EBISTel.eSPC.Page.Report.SPCChartViewUC%3C%2Fclass%3E%3Cpage%3ESPCChartViewUC /// %3C%2Fpage%3E%3CpageTitle%3ESPCChartData%3C%2FpageTitle%3E%3Cpage_type%3Elink%3C%2Fpage_type%3E%3C%2Fpage_info%3E%3Crequest%3E%3CMODEL_CONFIG_RAWID%3E%3Cvalue%3E600104%3C%2Fvalue /// %3E%3C%2FMODEL_CONFIG_RAWID%3E%3CCHART_TYPE%3E%3Cvalue%3ERAW%3C%2Fvalue%3E%3C%2FCHART_TYPE%3E%3COCAP_RAWID%3E%3Cvalue%3E100037977%3C%2Fvalue%3E%3C%2FOCAP_RAWID%3E%3COCAP_DTTS /// %3E%3Cvalue%3E2010-06-09+10%3A55%3A46.508%3C%2Fvalue%3E%3C%2FOCAP_DTTS%3E%3C%2Frequest%3E%3C%2Fees_querystring%3E /// </summary> /// <param name="functionName">Function name of page</param> /// <returns>Wheather it is needed to process</returns> public bool CheckIfNeedToProcessURLQuery(string functionName) { if (string.IsNullOrEmpty(EESUtil.GetHttpQueryString())) { return(false); } NameValueCollection nvcQueryString = EESUtil.ParsingHttpQueryString(EESUtil.GetHttpQueryString()); if (String.IsNullOrEmpty(nvcQueryString["func"]) || String.IsNullOrEmpty(nvcQueryString["queryxml"])) { return(false); } if (functionName != nvcQueryString["func"]) { return(false); } return(true); }
public string SetRevokeWorkflow_ModelGroup(byte[] baData) { string sResult = ""; try { LinkedList llstData = new LinkedList(); llstData.SetSerialData(baData); string sEQPID = string.Empty; if (llstData[Definition.CONDITION_KEY_EQP_ID] != null) { sEQPID = llstData[Definition.CONDITION_KEY_EQP_ID].ToString(); } EESMessage eesmessage = new EESMessage(); eesmessage.ServiceID = MESSAGE._SERVICE_ID; eesmessage.Target = sEQPID; eesmessage.ReplySubject = ""; eesmessage.Tid = "1"; eesmessage.Source = MESSAGE._SOURCE; eesmessage.User = llstData[Definition.CONDITION_KEY_USER_ID].ToString(); eesmessage.EESTid = ""; eesmessage.Pid = ""; eesmessage.Type = "T"; eesmessage.MethodID = MESSAGE._METHOD_ID_REVOKEWORKFLOW; eesmessage.AddValue("name", "SPC:ModelGroup"); int iTimeOut = MESSAGE._TIME_OUT; string sSendMessage = eesmessage.ToString(); if (_MsgBusType.Equals(Definition.TARGET_MSG_BUS_INFO_TIB)) { TIBInterface tibinterface = new TIBInterface(); tibinterface.ParentSQLHandler = this; //tibinterface.SetTragetConfig(); tibinterface.Send(sSendMessage, eesmessage); } else if (_MsgBusType.Equals(Definition.TARGET_MSG_BUS_INFO_AMQ)) { ActiveMQInterface amqinterface = new ActiveMQInterface(); amqinterface.Send(sSendMessage); } BISTel.PeakPerformance.Client.CommonLibrary.LogHandler.ClientLogWrite(sSendMessage); } catch (Exception ex) { EESUtil.ThrowExceptionMessage(ex.Message, ex.StackTrace); } finally { } return(sResult); }
public string SetSPCModel(byte[] baData) { string sResult = ""; try { LinkedList llstData = new LinkedList(); llstData.SetSerialData(baData); string sEQPID = string.Empty; string sConfigRawID = string.Empty; string sMainYN = string.Empty; string sFunction = string.Empty; string sModelRawID = string.Empty; if (llstData[Definition.CONDITION_KEY_EQP_ID] != null) { sEQPID = llstData[Definition.CONDITION_KEY_EQP_ID].ToString(); } if (llstData[Definition.CONDITION_KEY_MODEL_CONFIG_RAWID] != null) { sConfigRawID = llstData[Definition.CONDITION_KEY_MODEL_CONFIG_RAWID].ToString(); } if (llstData[Definition.CONDITION_KEY_MAIN_YN] != null) { sMainYN = llstData[Definition.CONDITION_KEY_MAIN_YN].ToString(); } if (llstData[Definition.CONDITION_KEY_FUNCTION] != null) { sFunction = llstData[Definition.CONDITION_KEY_FUNCTION].ToString(); } if (llstData[Definition.CONDITION_KEY_MODEL_RAWID] != null) { sModelRawID = llstData[Definition.CONDITION_KEY_MODEL_RAWID].ToString(); } EESMessage eesmessage = new EESMessage(); eesmessage.ServiceID = MESSAGE._SERVICE_ID; eesmessage.Target = sEQPID; eesmessage.ReplySubject = ""; eesmessage.Tid = "1"; eesmessage.Source = MESSAGE._SOURCE; eesmessage.User = llstData[Definition.CONDITION_KEY_USER_ID].ToString(); eesmessage.EESTid = ""; eesmessage.Pid = ""; eesmessage.Type = "T"; eesmessage.MethodID = MESSAGE._METHOD_ID_SET_SPC_MODEL; eesmessage.AddValue("model_rawid", sModelRawID); eesmessage.AddValue("model_config_rawid", sConfigRawID); eesmessage.AddValue("is_main_model", sMainYN); eesmessage.AddValue("function", sFunction); int iTimeOut = MESSAGE._TIME_OUT; string sSendMessage = eesmessage.ToString(); if (_MsgBusType.Equals(Definition.TARGET_MSG_BUS_INFO_TIB)) { TIBInterface tibinterface = new TIBInterface(); tibinterface.ParentSQLHandler = this; //tibinterface.SetTragetConfig(); tibinterface.Send(sSendMessage, eesmessage); } else if (_MsgBusType.Equals(Definition.TARGET_MSG_BUS_INFO_AMQ)) { ActiveMQInterface amqinterface = new ActiveMQInterface(); amqinterface.Send(sSendMessage); } } catch (Exception ex) { EESUtil.ThrowExceptionMessage(ex.Message, ex.StackTrace); } finally { } return(sResult); }
private void Click_EXCEL_EXPORT_Button() { try { DataTable dt = this._dtChartData.Copy(); if (dt.Columns.Contains(Definition.CHART_COLUMN.TIME2)) { dt.Columns.Remove(Definition.CHART_COLUMN.TIME2); } if (dt.Columns.Contains("TIME")) { dt.Columns.Remove("TIME"); } if (dt.Columns.Contains(CommonChart.COLUMN_NAME_SEQ_INDEX)) { dt.Columns.Remove(CommonChart.COLUMN_NAME_SEQ_INDEX); } this.bSpread1.ActiveSheet.RowCount = 0; this.bSpread1.ActiveSheet.ColumnCount = 0; this.bSpread1.ClearHead(); this.bSpread1.AddHeadComplete(); this.bSpread1.UseSpreadEdit = false; this.bSpread1.AutoGenerateColumns = true; this.bSpread1.DataSource = dt; this.bSpread1_Sheet1.SheetName = this.bTChrt_RawData.Name; string file = ""; bool bProtect = this.bSpread1.ActiveSheet.Protect; this.bSpread1.ActiveSheet.Protect = false; SaveFileDialog openDlg = new SaveFileDialog(); openDlg.Filter = "Excel Files (*.xls)|*.xls"; openDlg.FileName = ""; openDlg.DefaultExt = ".xls"; openDlg.CheckFileExists = false; openDlg.CheckPathExists = true; DialogResult res = openDlg.ShowDialog(); if (res != DialogResult.OK) { return; } file = openDlg.FileName; FarPoint.Win.Spread.SheetView spread_Sheet1 = new FarPoint.Win.Spread.SheetView(); spread_Sheet1.SheetName = "_ExcelExportSheet"; FarPoint.Win.Spread.FpSpread spread = new FarPoint.Win.Spread.FpSpread(); spread.Sheets.Add(spread_Sheet1); spread_Sheet1.Visible = true; spread.ActiveSheet = spread_Sheet1; byte[] buffer = null; System.IO.MemoryStream stream = null; this.bSpread1.SetFilterVisible(false); try { stream = new System.IO.MemoryStream(); this.bSpread1.Save(stream, false); buffer = stream.ToArray(); stream.Close(); } catch (Exception ex) { throw ex; } finally { if (stream != null) { stream.Dispose(); stream = null; } } stream = new System.IO.MemoryStream(buffer); spread.Open(stream); if (stream != null) { stream.Dispose(); stream = null; } for (int i = spread.ActiveSheet.Columns.Count - 1; i >= 0; i--) { if (!spread.ActiveSheet.Columns[i].Visible) { spread.ActiveSheet.Columns[i].Remove(); } } spread.SaveExcel(file, FarPoint.Win.Spread.Model.IncludeHeaders.ColumnHeadersCustomOnly); this.bSpread1.ActiveSheet.Protect = bProtect; string strMessage = "It was saved successfully. Do you open saved file?"; DialogResult result = MessageBox.Show(strMessage, "Open", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Classes\Applications\EXCEL.EXE"); if (key == null) { MSGHandler.DisplayMessage(MSGType.Error, "SPC_INFO_NEED_MS_OFFICE", null, null); } else { System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo.FileName = file; process.Start(); } } //this.bSpread1.Export(false); } catch (Exception ex) { MSGHandler.DisplayMessage(MSGType.Error, ex.ToString()); EESUtil.DebugLog("BTeeChart", "ExportDataForExcel", ex); } }
private void AddModuleNode(TreeNode tnCurrent, string dcpRawid) { try { if (tnCurrent.Nodes.Count > 0) { return; } LinkedList llstData = new LinkedList(); llstData.Add(Definition.DynamicCondition_Condition_key.LINE_RAWID, this.LineRawid); llstData.Add(Definition.DynamicCondition_Condition_key.AREA_RAWID, this.AreaRawid); llstData.Add(Definition.DynamicCondition_Condition_key.EQP_ID, this.EqpID); llstData.Add(Definition.DynamicCondition_Condition_key.DCP_ID, this.DcpID); llstData.Add(Definition.DynamicCondition_Condition_key.MODULE_ID, this.EqpID); byte[] baData = llstData.GetSerialData(); DataSet ds = _wsSPC.GetModuleByEQP(baData); if (ds == null || ds.Tables.Count <= 0) { return; } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string sModule = ds.Tables[0].Rows[i][Definition.DynamicCondition_Condition_key.ALIAS].ToString(); string sModuleID = ds.Tables[0].Rows[i][Definition.DynamicCondition_Condition_key.MODULE_ID].ToString(); string sParentModuleID = ds.Tables[0].Rows[i]["parent_moduleid"].ToString(); string sRawID = ds.Tables[0].Rows[i][Definition.DynamicCondition_Condition_key.RAWID].ToString(); if (sParentModuleID == string.Empty) { _sMainModuleRawid = sModuleID; } BTreeNode btn = TreeDCUtil.CreateBTreeNode(Definition.DynamicCondition_Search_key.MODULE, sModuleID, sModule); btn.IsVisibleCheckBox = this.IsShowCheck; btn.IsFolder = false; btn.IsVisibleNodeType = true; btn.ImageIndexList.Add((int)ImageLoader.TREE_IMAGE_INDEX.MODULE); btn.ImageIndex = (int)ImageLoader.TREE_IMAGE_INDEX.MODULE; DCValueOfTree dcValue = TreeDCUtil.GetDCValue(btn); dcValue.AdditionalValue.Add(Definition.DynamicCondition_Search_key.ADDTIONALVALUEDATA, sRawID); dcValue.Tag = sModuleID; if (this.IsLastNode) { if (_sMainModuleRawid != sModule) { if (llstData.Contains(Definition.DynamicCondition_Condition_key.MODULE_ID)) { llstData[Definition.DynamicCondition_Condition_key.MODULE_ID] = sModuleID; } else { llstData.Add(Definition.DynamicCondition_Condition_key.MODULE_ID, sModuleID); } byte[] data = llstData.GetSerialData(); DataSet dsSubModule = _wsSPC.GetSubModuleByEQP(data); if (dsSubModule.Tables.Count > 0 && dsSubModule.Tables[0].Rows.Count > 0) { btn.Nodes.Add(BTreeView.CreateDummyNode()); } } } else { btn.Nodes.Add(BTreeView.CreateDummyNode()); } tnCurrent.Nodes.Add(btn); } } catch (Exception ex) { EESUtil.DebugLog(ex); } }