private void OnContractSettingsEdit(object sender, OpenLinkEventArgs e) { e.Handled = true; using (var form = new FormContractSettings()) { form.checkEditShowSignatureLine.Checked = _editedSection.ContractSettings.ShowSignatureLine; form.checkEditShowRatesExpiration.Checked = _editedSection.ContractSettings.RateExpirationDate.HasValue; form.checkEditShowDisclaimer.Checked = _editedSection.ContractSettings.ShowDisclaimer; form.dateEditRatesExpirationDate.EditValue = _editedSection.ContractSettings.RateExpirationDate; if (form.ShowDialog() != DialogResult.OK) return; _editedSection.ContractSettings.ShowSignatureLine = form.checkEditShowSignatureLine.Checked; _editedSection.ContractSettings.ShowDisclaimer = form.checkEditShowDisclaimer.Checked; _editedSection.ContractSettings.RateExpirationDate = (DateTime?)form.dateEditRatesExpirationDate.EditValue; RaiseSettingsChanged(new SettingsChangedEventArgs { ChangedSettingsType = ScheduleSettingsType.Contract }); } }
private void OnContractSettingsEdit(object sender, OpenLinkEventArgs e) { e.Handled = true; using (var form = new FormContractSettings()) { switch (_selectedEditorType) { case SnapshotEditorType.Schedule: case SnapshotEditorType.DigitalInfo: form.checkEditShowSignatureLine.Checked = _editedSnapshot.ContractSettings.ShowSignatureLine; form.checkEditShowRatesExpiration.Checked = _editedSnapshot.ContractSettings.RateExpirationDate.HasValue; form.checkEditShowDisclaimer.Checked = _editedSnapshot.ContractSettings.ShowDisclaimer; form.dateEditRatesExpirationDate.EditValue = _editedSnapshot.ContractSettings.RateExpirationDate; break; case SnapshotEditorType.Summary: form.checkEditShowSignatureLine.Checked = _editedContent.SnapshotSummary.ContractSettings.ShowSignatureLine; form.checkEditShowRatesExpiration.Checked = _editedContent.SnapshotSummary.ContractSettings.RateExpirationDate.HasValue; form.checkEditShowDisclaimer.Checked = _editedContent.SnapshotSummary.ContractSettings.ShowDisclaimer; form.dateEditRatesExpirationDate.EditValue = _editedContent.SnapshotSummary.ContractSettings.RateExpirationDate; break; default: return; } if (form.ShowDialog() != DialogResult.OK) return; switch (_selectedEditorType) { case SnapshotEditorType.Schedule: case SnapshotEditorType.DigitalInfo: _editedSnapshot.ContractSettings.ShowSignatureLine = form.checkEditShowSignatureLine.Checked; _editedSnapshot.ContractSettings.ShowDisclaimer = form.checkEditShowDisclaimer.Checked; _editedSnapshot.ContractSettings.RateExpirationDate = (DateTime?)form.dateEditRatesExpirationDate.EditValue; if (_editedContent.SnapshotSummary.ApplySettingsForAll) { foreach (var Snapshot in _editedContent.Snapshots.Where(os => os.UniqueID != _editedSnapshot.UniqueID)) { Snapshot.ContractSettings.ShowSignatureLine = _editedSnapshot.ContractSettings.ShowSignatureLine; Snapshot.ContractSettings.ShowDisclaimer = _editedSnapshot.ContractSettings.ShowDisclaimer; Snapshot.ContractSettings.RateExpirationDate = _editedSnapshot.ContractSettings.RateExpirationDate; } } break; case SnapshotEditorType.Summary: _editedContent.SnapshotSummary.ContractSettings.ShowSignatureLine = form.checkEditShowSignatureLine.Checked; _editedContent.SnapshotSummary.ContractSettings.ShowDisclaimer = form.checkEditShowDisclaimer.Checked; _editedContent.SnapshotSummary.ContractSettings.RateExpirationDate = (DateTime?)form.dateEditRatesExpirationDate.EditValue; break; default: return; } RaiseSettingsChanged(new SettingsChangedEventArgs { ChangedSettingsType = SnapshotSettingsType.Contract }); } }