/// <summary> /// Handles a change to a Report record. /// </summary> /// <param name="sender">The object that originated the event.</param> /// <param name="e">The record change event arguments.</param> private void OnReportRowChanged(object sender, ReportRowChangeEventArgs e) { // The main idea here is to determin if this update is relevant for the currently displayed document. If it is, then the document needs to be // redrawn. if (e.Action == DataRowAction.Commit && e.Row.RowState != DataRowState.Detached) { // We want to find out what report is currently assigned to this blotter for displaying working orders. ReportTypeRow reportTypeRow = DataModel.ReportType.ReportTypeKeyReportTypeCode.Find(ReportType.WorkingOrder); if (reportTypeRow != null) { // This determines what report is used as a template based on the blotter being displayed and the need for a Working Order template. BlotterConfigurationRow blotterConfigurationRow = DataModel.BlotterConfiguration.BlotterConfigurationKeyBlotterIdReportTypeId.Find( this.blotterId, reportTypeRow.ReportTypeId); // Now taht we have the blotter configuration row we can check to see if the report that was changed was the one that is supposed to be // used by this report. Note that you can't use the 'reportId' member because that may not be set at this time. if (blotterConfigurationRow != null) { FluidTrade.Guardian.ReportRow reportRow = blotterConfigurationRow.ReportRow; if (reportRow != null && e.Row.ReportId == reportRow.ReportId) { this.reportId = Guid.Empty; LoadSource(); } } } } }
/// <summary> /// Handles the changing of a blotter configuration record. /// </summary> /// <param name="sender">The object that originated the event.</param> /// <param name="e">The event arguments.</param> private void OnBlotterConfigurationRowChanged(object sender, BlotterConfigurationRowChangeEventArgs e) { // The main idea here is to determin if this update is relevant for the currently displayed document. If it is, then the document needs to be // redrawn. if (e.Action == DataRowAction.Commit && e.Row.RowState != DataRowState.Detached) { // We want to find out what report is currently assigned to this blotter for displaying working orders. ReportTypeRow reportTypeRow = DataModel.ReportType.ReportTypeKeyReportTypeCode.Find(ReportType.WorkingOrder); if (reportTypeRow != null) { // This determines what report is used as a template based on the blotter being displayed and the need for a Working Order template. if (e.Row.ReportTypeId == reportTypeRow.ReportTypeId && e.Row.BlotterId == this.blotterId) { this.reportId = Guid.Empty; LoadSource(); } } } }