void export_subModelExportCompletedEvent(object sender, SubModelExportCompletedEventHandlerArgs args) { if (subModelExportCompletedEvent != null) { subModelExportCompletedEvent(sender, args); } }
void DataExportUC_subModelExportCompletedEvent(object sender, SubModelExportCompletedEventHandlerArgs e) { this.pbarSub.Value++; this.blblSub.Text = this.pbarSub.Value + " / " + this.pbarSub.Maximum; if (subModelExportCompletedEvent != null) { this.subModelExportCompletedEvent(sender, e); } System.Threading.Thread.Sleep(50); Application.DoEvents(); }
public void SubModelExported(object sender, SubModelExportCompletedEventHandlerArgs e) { int indexOfRawid = GetIndexOfColumn("CHART_ID"); if (indexOfRawid < 0) { return; } for (int i = 0; i < bSpread.ActiveSheet.Rows.Count; i++) { if (bSpread.ActiveSheet.Cells[i, indexOfRawid].Text == e.SubModelRawID) { bSpread.ActiveSheet.Rows[i].BackColor = Color.LightGreen; } } }
internal int Export(string filePath, string startDtts, string endDtts) { exportedSubModel = 0; if (modelExportStartedEvent != null) { var ModelStartedArgs = new ModelExportStartedEventHandlerArgs(); modelExportStartedEvent(this, ModelStartedArgs); } bool hasData = false; using (ExcelWriter writer = new ExcelWriter(filePath)) { writer.WriteStartDocument(); // write a main chart DataTable rawData = GetRawData(startDtts, endDtts, this.ChartID); rawData.TableName = this.ChartID; RemoveSuperflousColumns(rawData); if (rawData.Rows.Count > 0) { hasData = true; writer.WriteSheet("Main-" + ChartID, rawData); exportedSubModel++; } rawData.Dispose(); if (subModelExportCompletedEvent != null) { var subArgs = new SubModelExportCompletedEventHandlerArgs(); subArgs.SubModelRawID = ChartID; subModelExportCompletedEvent(this, subArgs); } // write sub charts foreach (SPCModel sub in this.SubModels) { rawData = GetRawData(startDtts, endDtts, sub.ChartID); rawData.TableName = sub.ChartID; RemoveSuperflousColumns(rawData); if (rawData.Rows.Count > 0) { hasData = true; writer.WriteSheet(sub.ChartID, rawData); exportedSubModel++; } rawData.Dispose(); if (subModelExportCompletedEvent != null) { var subArgs = new SubModelExportCompletedEventHandlerArgs(); subArgs.SubModelRawID = sub.ChartID; subModelExportCompletedEvent(this, subArgs); } } writer.WriteEndDocument(); writer.Close(); } var modelArgs = new ModelExportCompletedEventHandlerArgs(); modelArgs.SPCModelName = this.SPCModelName; modelArgs.exportedModelNum = exportedSubModel; modelArgs.filePath = filePath; if (hasData == false) { System.IO.File.Delete(filePath); modelArgs.filePath = string.Empty; } if (modelExportCompletedEvent != null) { modelExportCompletedEvent(this, modelArgs); } return(exportedSubModel); }
public void SubModelExported(object sender, SubModelExportCompletedEventHandlerArgs e) { this.spcModelUC1.SubModelExported(sender, e); }