private void ValidateDataDetailsManual(PtArrivalPointRow ARow) { TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection; TSharedValidation_CacheableDataTables.ValidateArrivalDeparturePoint(this, ARow, ref VerificationResultCollection, FPetraUtilsObject.ValidationControlsDict); }
private void NewRowManual(ref PtArrivalPointRow ARow) { // Deal with primary key. AssignmentTypeCode is unique and is 8 characters. string newName = Catalog.GetString("NEWCODE"); Int32 countNewDetail = 0; if (FMainDS.PtArrivalPoint.Rows.Find(new object[] { newName }) != null) { while (FMainDS.PtArrivalPoint.Rows.Find(new object[] { newName + countNewDetail.ToString() }) != null) { countNewDetail++; } newName += countNewDetail.ToString(); } ARow.Code = newName; }
/// <summary> /// Validates the MPersonnel Arrival/Departure Point screen data. /// </summary> /// <param name="AContext">Context that describes where the data validation failed.</param> /// <param name="ARow">The <see cref="DataRow" /> which holds the the data against which the validation is run.</param> /// <param name="AVerificationResultCollection">Will be filled with any <see cref="TVerificationResult" /> items if /// data validation errors occur.</param> /// <param name="AValidationControlsDict">A <see cref="TValidationControlsDict" /> containing the Controls that /// display data that is about to be validated.</param> public static void ValidateArrivalDeparturePoint(object AContext, PtArrivalPointRow ARow, ref TVerificationResultCollection AVerificationResultCollection, TValidationControlsDict AValidationControlsDict) { DataColumn ValidationColumn; TValidationControlsData ValidationControlsData; TVerificationResult VerificationResult = null; // Don't validate deleted DataRows if (ARow.RowState == DataRowState.Deleted) { return; } // 'AssignableDate' must not be empty if the flag is set ValidationColumn = ARow.Table.Columns[PtArrivalPointTable.ColumnUnassignableDateId]; if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData)) { if (ARow.UnassignableFlag) { VerificationResult = TSharedValidationControlHelper.IsNotInvalidDate(ARow.UnassignableDate, ValidationControlsData.ValidationControlLabel, AVerificationResultCollection, true, AContext, ValidationColumn, ValidationControlsData.ValidationControl); } // Handle addition to/removal from TVerificationResultCollection AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn); } }