/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ADataValidationProcessingMode">Set to TErrorProcessingMode.Epm_All if data validation errors should be shown to the /// user, otherwise set it to TErrorProcessingMode.Epm_None.</param> /// <param name="AValidateSpecificControl">Pass in a Control to restrict Data Validation error checking to a /// specific Control for which Data Validation errors might have been recorded. (Default=null). /// <para> /// This is useful for restricting Data Validation error checking to the current TabPage of a TabControl in order /// to only display Data Validation errors that pertain to the current TabPage. To do this, pass in a TabControl in /// this Argument. /// </para> /// </param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(TErrorProcessingMode ADataValidationProcessingMode, Control AValidateSpecificControl = null) { bool ReturnValue = true; if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucIndividualData)) { TUC_IndividualData UCIndividualData = (TUC_IndividualData)FTabSetup[TDynamicLoadableUserControls.dlucIndividualData]; if (!UCIndividualData.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucApplications)) { TUC_ApplicationData UCApplicationData = (TUC_ApplicationData)FTabSetup[TDynamicLoadableUserControls.dlucApplications]; if (!UCApplicationData.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } return(ReturnValue); }
/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ADataValidationProcessingMode">Set to TErrorProcessingMode.Epm_All if data validation errors should be shown to the /// user, otherwise set it to TErrorProcessingMode.Epm_None.</param> /// <param name="AValidateSpecificControl">Pass in a Control to restrict Data Validation error checking to a /// specific Control for which Data Validation errors might have been recorded. (Default=null). /// <para> /// This is useful for restricting Data Validation error checking to the current TabPage of a TabControl in order /// to only display Data Validation errors that pertain to the current TabPage. To do this, pass in a TabControl in /// this Argument. /// </para> /// </param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(TErrorProcessingMode ADataValidationProcessingMode, Control AValidateSpecificControl = null) { bool ReturnValue = true; ReturnValue = ucoApplications.ValidateAllData(true, ADataValidationProcessingMode, AValidateSpecificControl); return(ReturnValue); }
/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ARecordChangeVerification">Set to true if the data validation happens when the user is changing /// to another record, otherwise set it to false.</param> /// <param name="ADataValidationProcessingMode">Set to TErrorProcessingMode.Epm_All if data validation errors should be shown to the /// user, otherwise set it to TErrorProcessingMode.Epm_None.</param> /// <param name="AValidateSpecificControl">Pass in a Control to restrict Data Validation error checking to a /// specific Control for which Data Validation errors might have been recorded. (Default=this.ActiveControl). /// <para> /// This is useful for restricting Data Validation error checking to the current TabPage of a TabControl in order /// to only display Data Validation errors that pertain to the current TabPage. To do this, pass in a TabControl in /// this Argument. /// </para> /// </param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(bool ARecordChangeVerification, TErrorProcessingMode ADataValidationProcessingMode, Control AValidateSpecificControl = null) { bool ReturnValue = true; // TODO // bool ReturnValue = false; // Control ControlToValidate; // PSubscriptionRow CurrentRow; // // CurrentRow = GetSelectedDetailRow(); // // if (CurrentRow != null) // { // if (AValidateSpecificControl != null) // { // ControlToValidate = AValidateSpecificControl; // } // else // { // ControlToValidate = this.ActiveControl; // } // // GetDetailsFromControls(CurrentRow); // // // TODO Generate automatic validation of data, based on the DB Table specifications (e.g. 'not null' checks) // ValidateDataDetailsManual(CurrentRow); // // if (ADataValidationProcessingMode != TErrorProcessingMode.Epm_None) // { // // Only process the Data Validations here if ControlToValidate is not null. // // It can be null if this.ActiveControl yields null - this would happen if no Control // // on this UserControl has got the Focus. // if(ControlToValidate.FindUserControlOrForm(true) == this) // { // ReturnValue = TDataValidation.ProcessAnyDataValidationErrors(false, FPetraUtilsObject.VerificationResultCollection, // this.GetType(), ControlToValidate.FindUserControlOrForm(true).GetType()); // } // else // { // ReturnValue = true; // } // } // } // else // { // ReturnValue = true; // } // // if(ReturnValue) // { // // Remove a possibly shown Validation ToolTip as the data validation succeeded // FPetraUtilsObject.ValidationToolTip.RemoveAll(); // } return(ReturnValue); }
/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ADataValidationProcessingMode">Set to TErrorProcessingMode.Epm_All if data validation errors should be shown to the /// user, otherwise set it to TErrorProcessingMode.Epm_None.</param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(TErrorProcessingMode ADataValidationProcessingMode) { bool ReturnValue = true; ReturnValue = ucoPartnerTabSet.ValidateAllData(ADataValidationProcessingMode); if (!ucoPersonnelTabSet.ValidateAllData(ADataValidationProcessingMode)) { ReturnValue = false; } return(ReturnValue); }
/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ADataValidationProcessingMode">Set to Epm_All if data validation errors should be shown to the /// user, otherwise set it to Epm_None.</param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(TErrorProcessingMode ADataValidationProcessingMode) { bool ReturnValue = true; if (!ucoField.ValidateAllData(ADataValidationProcessingMode)) { ReturnValue = false; } if (!ucoApplicant.ValidateAllData(ADataValidationProcessingMode)) { ReturnValue = false; } return(ReturnValue); }
/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ADataValidationProcessingMode">Set to TErrorProcessingMode.Epm_All if data validation errors should be shown to the /// user, otherwise set it to TErrorProcessingMode.Epm_None.</param> /// <param name="AValidateSpecificControl">Pass in a Control to restrict Data Validation error checking to a /// specific Control for which Data Validation errors might have been recorded. (Default=null). /// <para> /// This is useful for restricting Data Validation error checking to the current TabPage of a TabControl in order /// to only display Data Validation errors that pertain to the current TabPage. To do this, pass in a TabControl in /// this Argument. /// </para> /// </param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(TErrorProcessingMode ADataValidationProcessingMode, Control AValidateSpecificControl = null) { bool ReturnValue = true; switch (GetPartnerDetailsVariableUC()) { case TDynamicLoadableUserControls.dlucPartnerDetailsPerson: if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucPartnerDetailsPerson)) { TUC_PartnerDetails_Person UCPartnerDetailsPerson = (TUC_PartnerDetails_Person)FTabSetup[TDynamicLoadableUserControls.dlucPartnerDetailsPerson]; if (!UCPartnerDetailsPerson.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } break; case TDynamicLoadableUserControls.dlucPartnerDetailsFamily: if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucPartnerDetailsFamily)) { TUC_PartnerDetails_Family UCPartnerDetailsFamily = (TUC_PartnerDetails_Family)FTabSetup[TDynamicLoadableUserControls.dlucPartnerDetailsFamily]; if (!UCPartnerDetailsFamily.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } break; case TDynamicLoadableUserControls.dlucPartnerDetailsOrganisation: if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucPartnerDetailsOrganisation)) { TUC_PartnerDetails_Organisation UCPartnerDetailsOrganisation = (TUC_PartnerDetails_Organisation)FTabSetup[TDynamicLoadableUserControls.dlucPartnerDetailsOrganisation]; if (!UCPartnerDetailsOrganisation.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } break; case TDynamicLoadableUserControls.dlucPartnerDetailsChurch: // Special case: The Church UserControl needs to always be initialised in order for the Validation to work also when the Tab was never switched to // (for checking for empty DenominationList CacheableDataTable)! if (!FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucPartnerDetailsChurch)) { SetupVariableUserControlForTabPagePartnerDetails(); } TUC_PartnerDetails_Church UCPartnerDetailsChurch = (TUC_PartnerDetails_Church)FTabSetup[TDynamicLoadableUserControls.dlucPartnerDetailsChurch]; if (!UCPartnerDetailsChurch.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } break; case TDynamicLoadableUserControls.dlucPartnerDetailsUnit: if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucPartnerDetailsUnit)) { TUC_PartnerDetails_Unit UCPartnerDetailsUnit = (TUC_PartnerDetails_Unit)FTabSetup[TDynamicLoadableUserControls.dlucPartnerDetailsUnit]; if (!UCPartnerDetailsUnit.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } break; case TDynamicLoadableUserControls.dlucPartnerDetailsVenue: if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucPartnerDetailsVenue)) { TUC_PartnerDetails_Venue UCPartnerDetailsVenue = (TUC_PartnerDetails_Venue)FTabSetup[TDynamicLoadableUserControls.dlucPartnerDetailsVenue]; if (!UCPartnerDetailsVenue.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } break; case TDynamicLoadableUserControls.dlucPartnerDetailsBank: if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucPartnerDetailsBank)) { TUC_PartnerDetails_Bank UCPartnerDetailsBank = (TUC_PartnerDetails_Bank)FTabSetup[TDynamicLoadableUserControls.dlucPartnerDetailsBank]; if (!UCPartnerDetailsBank.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } break; } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucAddresses)) { TUC_PartnerAddresses UCPartnerAddresses = (TUC_PartnerAddresses)FTabSetup[TDynamicLoadableUserControls.dlucAddresses]; if (!UCPartnerAddresses.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucContacts)) { TUC_Contacts UCContactLogs = (TUC_Contacts)FTabSetup[TDynamicLoadableUserControls.dlucContacts]; if (!UCContactLogs.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucContactDetails)) { TUC_ContactDetails UCContactDetails = (TUC_ContactDetails)FTabSetup[TDynamicLoadableUserControls.dlucContactDetails]; if (!UCContactDetails.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } if (!UCContactDetails.GetOverallContactSettingsDataFromControls()) { ReturnValue = false; } } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucSubscriptions)) { TUC_Subscriptions UCSubscriptions = (TUC_Subscriptions)FTabSetup[TDynamicLoadableUserControls.dlucSubscriptions]; if (!UCSubscriptions.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucPartnerTypes)) { TUCPartnerTypes UCPartnerTypes = (TUCPartnerTypes)FTabSetup[TDynamicLoadableUserControls.dlucPartnerTypes]; if (!UCPartnerTypes.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucPartnerRelationships)) { TUC_PartnerRelationships UCRelationships = (TUC_PartnerRelationships)FTabSetup[TDynamicLoadableUserControls.dlucPartnerRelationships]; if (!UCRelationships.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucFamilyMembers)) { TUC_FamilyMembers UCFamilyMembers = (TUC_FamilyMembers)FTabSetup[TDynamicLoadableUserControls.dlucFamilyMembers]; if (!UCFamilyMembers.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucNotes)) { TUC_PartnerNotes UCNotes = (TUC_PartnerNotes)FTabSetup[TDynamicLoadableUserControls.dlucNotes]; if (!UCNotes.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucFinanceDetails)) { TUC_FinanceDetails UCFinanceDetails = (TUC_FinanceDetails)FTabSetup[TDynamicLoadableUserControls.dlucFinanceDetails]; // enable extra validation on tab change UCFinanceDetails.ValidateBankingDetailsExtra = true; if (!UCFinanceDetails.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } if (!UCFinanceDetails.GetPartnerDataFromControls()) { ReturnValue = false; } } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucOfficeSpecific)) { TUC_LocalPartnerData UCLocalPartnerData = (TUC_LocalPartnerData)FTabSetup[TDynamicLoadableUserControls.dlucOfficeSpecific]; if (!UCLocalPartnerData.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucInterests)) { TUC_PartnerInterests UCPartnerInterests = (TUC_PartnerInterests)FTabSetup[TDynamicLoadableUserControls.dlucInterests]; if (!UCPartnerInterests.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } return ReturnValue; }
/// <summary> /// implement dummy functions so that we can use this control on a yaml form /// </summary> public void ValidateAllData(bool ARecordChangeVerification, TErrorProcessingMode ADataValidationProcessingMode) { // not implemented }
/// <summary> /// // Doesn't do anything, but needs to be present as the Template requires this Method to be present... /// </summary> /// <param name="ARecordChangeVerification"></param> /// <param name="ADataValidationProcessingMode"></param> /// <returns></returns> public bool ValidateAllData(bool ARecordChangeVerification, TErrorProcessingMode ADataValidationProcessingMode) { // Doesn't do anything, but needs to be present as the Template requires this Method to be present... return true; }
/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ADataValidationProcessingMode">Set to TErrorProcessingMode.Epm_All if data validation errors should be shown to the /// user, otherwise set it to TErrorProcessingMode.Epm_None.</param> /// <param name="AValidateSpecificControl">Pass in a Control to restrict Data Validation error checking to a /// specific Control for which Data Validation errors might have been recorded. (Default=this.ActiveControl). /// <para> /// This is useful for restricting Data Validation error checking to the current TabPage of a TabControl in order /// to only display Data Validation errors that pertain to the current TabPage. To do this, pass in a TabControl in /// this Argument. /// </para> /// </param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(TErrorProcessingMode ADataValidationProcessingMode, Control AValidateSpecificControl = null) { bool ReturnValue = true; // TODO // bool ReturnValue = false; // Control ControlToValidate; // if (AValidateSpecificControl != null) // { // ControlToValidate = AValidateSpecificControl; // } // else // { // ControlToValidate = this.ActiveControl; // } // // GetDataFromControls(FMainDS.PSubscription[0]); // // // TODO Generate automatic validation of data, based on the DB Table specifications (e.g. 'not null' checks) // ValidateDataManual(FMainDS.PSubscription[0]); // // if (ADataValidationProcessingMode != TErrorProcessingMode.Epm_None) // { // // Only process the Data Validations here if ControlToValidate is not null. // // It can be null if this.ActiveControl yields null - this would happen if no Control // // on this UserControl has got the Focus. // if (ControlToValidate != null) // { // if(ControlToValidate.FindUserControlOrForm(true) == this) // { // ReturnValue = TDataValidation.ProcessAnyDataValidationErrors(false, FPetraUtilsObject.VerificationResultCollection, // this.GetType(), ControlToValidate.FindUserControlOrForm(true).GetType()); // } // else // { // ReturnValue = true; // } // } // } // // if(ReturnValue) // { // // Remove a possibly shown Validation ToolTip as the data validation succeeded // FPetraUtilsObject.ValidationToolTip.RemoveAll(); // } return ReturnValue; }
/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ADataValidationProcessingMode">Set to TErrorProcessingMode.Epm_All if data validation errors should be shown to the /// user, otherwise set it to TErrorProcessingMode.Epm_None.</param> /// <param name="AValidateSpecificControl">Pass in a Control to restrict Data Validation error checking to a /// specific Control for which Data Validation errors might have been recorded. (Default=null). /// <para> /// This is useful for restricting Data Validation error checking to the current TabPage of a TabControl in order /// to only display Data Validation errors that pertain to the current TabPage. To do this, pass in a TabControl in /// this Argument. /// </para> /// </param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(TErrorProcessingMode ADataValidationProcessingMode, Control AValidateSpecificControl = null) { bool ReturnValue = true; ReturnValue = ucoApplications.ValidateAllData(true, ADataValidationProcessingMode, AValidateSpecificControl); return ReturnValue; }
private bool ValidateAllData(UserControl ASpecificControl, bool ARecordChangeVerification, TErrorProcessingMode ADataValidationProcessingMode) { FSpecificControlToValidate = ASpecificControl; return ValidateAllData(ARecordChangeVerification, ADataValidationProcessingMode); }
private bool ValidateAllData(UserControl ASpecificControl, bool ARecordChangeVerification, TErrorProcessingMode ADataValidationProcessingMode) { FSpecificControlToValidate = ASpecificControl; return(ValidateAllData(ARecordChangeVerification, ADataValidationProcessingMode)); }
/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ARecordChangeVerification">Set to true if the data validation happens when the user is changing /// to another record, otherwise set it to false.</param> /// <param name="ADataValidationProcessingMode">Set to TErrorProcessingMode.Epm_All if data validation errors should be shown to the /// user, otherwise set it to TErrorProcessingMode.Epm_None.</param> /// <param name="AValidateSpecificControl">Pass in a Control to restrict Data Validation error checking to a /// specific Control for which Data Validation errors might have been recorded. (Default=this.ActiveControl). /// <para> /// This is useful for restricting Data Validation error checking to the current TabPage of a TabControl in order /// to only display Data Validation errors that pertain to the current TabPage. To do this, pass in a TabControl in /// this Argument. /// </para> /// </param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(bool ARecordChangeVerification, TErrorProcessingMode ADataValidationProcessingMode, Control AValidateSpecificControl = null) { bool ReturnValue = true; int DuplicateFamilyID = -1; DataColumn ValidationColumn = null; TValidationControlsData ValidationControlsData = new TValidationControlsData(); TVerificationResult VerificationResult = null; if (FMainDS.PPartner[0].PartnerClass != SharedTypes.PartnerClassEnumToString(TPartnerClass.FAMILY)) { // Validation only needed when displayed on FAMILY screen (as Family ID can only be modified there) return true; } // Same 'Family ID' must only exist once across all family members for (int Counter = 0; Counter <= (GetNumberOfRows() - 1); Counter += 1) { for (int Counter2 = Counter + 1; Counter2 <= (GetNumberOfRows() - 1); Counter2 += 1) { if (FFamilyMembersDV[Counter].Row[PartnerEditTDSFamilyMembersTable.GetFamilyIdDBName()].ToString() == FFamilyMembersDV[Counter2].Row[PartnerEditTDSFamilyMembersTable.GetFamilyIdDBName()].ToString()) { DuplicateFamilyID = (int)FFamilyMembersDV[Counter].Row[PartnerEditTDSFamilyMembersTable.GetFamilyIdDBName()]; break; } } } if (DuplicateFamilyID >= 0) { VerificationResult = new TScreenVerificationResult(new TVerificationResult(this, ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_DUPLICATE_FAMILY_ID, new string[] { DuplicateFamilyID.ToString() })), ValidationColumn, ValidationControlsData.ValidationControl); ReturnValue = false; // Handle addition to/removal from TVerificationResultCollection. FPetraUtilsObject.VerificationResultCollection.Auto_Add_Or_AddOrRemove(this, VerificationResult, ValidationColumn); } if (ADataValidationProcessingMode != TErrorProcessingMode.Epm_None) { ReturnValue = TDataValidation.ProcessAnyDataValidationErrors(false, FPetraUtilsObject.VerificationResultCollection, this.GetType()); } return ReturnValue; }
/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ADataValidationProcessingMode">Set to Epm_All if data validation errors should be shown to the /// user, otherwise set it to Epm_None.</param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(TErrorProcessingMode ADataValidationProcessingMode) { bool ReturnValue = true; if (!ucoField.ValidateAllData(ADataValidationProcessingMode)) { ReturnValue = false; } if (!ucoApplicant.ValidateAllData(ADataValidationProcessingMode)) { ReturnValue = false; } return ReturnValue; }
/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ADataValidationProcessingMode">Set to TErrorProcessingMode.Epm_All if data validation errors should be shown to the /// user, otherwise set it to TErrorProcessingMode.Epm_None.</param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(TErrorProcessingMode ADataValidationProcessingMode) { bool ReturnValue = true; ReturnValue = ucoPartnerTabSet.ValidateAllData(ADataValidationProcessingMode); if (!ucoPersonnelTabSet.ValidateAllData(ADataValidationProcessingMode)) { ReturnValue = false; } return ReturnValue; }
/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ADataValidationProcessingMode">Set to TErrorProcessingMode.Epm_All if data validation errors should be shown to the /// user, otherwise set it to TErrorProcessingMode.Epm_None.</param> /// <param name="AValidateSpecificControl">Pass in a Control to restrict Data Validation error checking to a /// specific Control for which Data Validation errors might have been recorded. (Default=null). /// <para> /// This is useful for restricting Data Validation error checking to the current TabPage of a TabControl in order /// to only display Data Validation errors that pertain to the current TabPage. To do this, pass in a TabControl in /// this Argument. /// </para> /// </param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(TErrorProcessingMode ADataValidationProcessingMode, Control AValidateSpecificControl = null) { bool ReturnValue = true; if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucIndividualData)) { TUC_IndividualData UCIndividualData = (TUC_IndividualData)FTabSetup[TDynamicLoadableUserControls.dlucIndividualData]; if (!UCIndividualData.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } if (FTabSetup.ContainsKey(TDynamicLoadableUserControls.dlucApplications)) { TUC_ApplicationData UCApplicationData = (TUC_ApplicationData)FTabSetup[TDynamicLoadableUserControls.dlucApplications]; if (!UCApplicationData.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } return ReturnValue; }
/// <summary> /// Performs data validation. /// </summary> /// <remarks>May be called by the Form that hosts this UserControl to invoke the data validation of /// the UserControl.</remarks> /// <param name="ADataValidationProcessingMode">Set to TErrorProcessingMode.Epm_All if data validation errors should be shown to the /// user, otherwise set it to TErrorProcessingMode.Epm_None.</param> /// <param name="AValidateSpecificControl">Pass in a Control to restrict Data Validation error checking to a /// specific Control for which Data Validation errors might have been recorded. (Default=null). /// <para> /// This is useful for restricting Data Validation error checking to the current TabPage of a TabControl in order /// to only display Data Validation errors that pertain to the current TabPage. To do this, pass in a TabControl in /// this Argument. /// </para> /// </param> /// <returns>True if data validation succeeded or if there is no current row, otherwise false.</returns> public bool ValidateAllData(TErrorProcessingMode ADataValidationProcessingMode, Control AValidateSpecificControl = null) { bool ReturnValue = true; if (FUserControlSetup != null) { // Special Needs if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucSpecialNeeds)) { TUC_IndividualData_SpecialNeeds UCSpecialNeeds = (TUC_IndividualData_SpecialNeeds)FUserControlSetup[TDynamicLoadableUserControls.dlucSpecialNeeds]; if (!UCSpecialNeeds.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } // Personal Languages if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucPersonalLanguages)) { TUC_IndividualData_PersonalLanguages UCPersonalLanguage = (TUC_IndividualData_PersonalLanguages)FUserControlSetup[TDynamicLoadableUserControls.dlucPersonalLanguages]; if (!UCPersonalLanguage.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } // Abilities if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucPersonalAbilities)) { TUC_IndividualData_Abilities UCAbilities = (TUC_IndividualData_Abilities)FUserControlSetup[TDynamicLoadableUserControls.dlucPersonalAbilities]; if (!UCAbilities.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } //Passport Details if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucPassportDetails)) { TUC_IndividualData_Passport UCPassport = (TUC_IndividualData_Passport)FUserControlSetup[TDynamicLoadableUserControls.dlucPassportDetails]; if (!UCPassport.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } //Personal Data if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucPersonalData)) { TUC_IndividualData_PersonalData UCPersonalData = (TUC_IndividualData_PersonalData)FUserControlSetup[TDynamicLoadableUserControls.dlucPersonalData]; if (!UCPersonalData.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } //Emergency Data if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucEmergencyData)) { TUC_IndividualData_EmergencyData UCEmergencyData = (TUC_IndividualData_EmergencyData)FUserControlSetup[TDynamicLoadableUserControls.dlucEmergencyData]; if (!UCEmergencyData.ValidateAllData(ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } // Progress Reports (Person Evaluations) if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucProgressReports)) { TUC_IndividualData_ProgressReports UCProgressReport = (TUC_IndividualData_ProgressReports)FUserControlSetup[TDynamicLoadableUserControls.dlucProgressReports]; if (!UCProgressReport.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } // Commitment Periods if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucCommitmentPeriods)) { TUC_IndividualData_CommitmentPeriods UCCommitmentPeriod = (TUC_IndividualData_CommitmentPeriods)FUserControlSetup[TDynamicLoadableUserControls.dlucCommitmentPeriods]; if (!UCCommitmentPeriod.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } // Person Skills if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucPersonSkills)) { TUC_IndividualData_PersonSkills UCPersonSkill = (TUC_IndividualData_PersonSkills)FUserControlSetup[TDynamicLoadableUserControls.dlucPersonSkills]; if (!UCPersonSkill.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } // Previous Experience // dluc corresponds to enum above, UCPreviousExperience to UC_IndividualData_PreviousExperience.ManualCode, // PmPastExperienceTable to the DB table name if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucPreviousExperience)) { TUC_IndividualData_PreviousExperience UCPreviousExperience = (TUC_IndividualData_PreviousExperience)FUserControlSetup[TDynamicLoadableUserControls.dlucPreviousExperience]; if (!UCPreviousExperience.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } // Personal Documents if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucPersonalDocuments)) { TUC_IndividualData_PersonalDocuments UCPersonalDocuments = (TUC_IndividualData_PersonalDocuments)FUserControlSetup[TDynamicLoadableUserControls.dlucPersonalDocuments]; if (!UCPersonalDocuments.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } // Job Assignments if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucJobAssignments)) { TUC_IndividualData_JobAssignments UCJobAssignments = (TUC_IndividualData_JobAssignments)FUserControlSetup[TDynamicLoadableUserControls.dlucJobAssignments]; if (!UCJobAssignments.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) { ReturnValue = false; } } // Local Personnel Data if (FUserControlSetup.ContainsKey(TDynamicLoadableUserControls.dlucLocalPersonnelData)) { // TUC_IndividualData_LocalPersonnelData UCLocalPersonnelData = // (TUC_IndividualData_LocalPersonnelData)FUserControlSetup[TDynamicLoadableUserControls.dlucLocalPersonnelData]; //TODO: no proper validation in place yet for local personnel data control //if (!UCLocalPersonnelData.ValidateAllData(false, ADataValidationProcessingMode, AValidateSpecificControl)) //{ // ReturnValue = false; //} } } return ReturnValue; }