private void ShowDetailsManual(PmPersonSkillRow ARow) { // In theory, the next Method call could be done in Methods NewRowManual; however, NewRowManual runs before // the Row is actually added and this would result in the Count to be one too less, so we do the Method call here, short // of a non-existing 'AfterNewRowManual' Method.... DoRecalculateScreenParts(); }
private void ValidateDataDetailsManual(PmPersonSkillRow ARow) { TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection; TSharedPersonnelValidation_Personnel.ValidateSkillManual(this, ARow, ref VerificationResultCollection, FValidationControlsDict); }
/// <summary> /// Code to be run after the deletion process /// </summary> /// <param name="ARowToDelete">the row that was/was to be deleted</param> /// <param name="AAllowDeletion">whether or not the user was permitted to delete</param> /// <param name="ADeletionPerformed">whether or not the deletion was performed successfully</param> /// <param name="ACompletionMessage">if specified, is the deletion completion message</param> private void PostDeleteManual(PmPersonSkillRow ARowToDelete, bool AAllowDeletion, bool ADeletionPerformed, string ACompletionMessage) { if (ADeletionPerformed) { DoRecalculateScreenParts(); } }
/// <summary> /// Performs checks to determine whether a deletion of the current /// row is permissable /// </summary> /// <param name="ARowToDelete">the currently selected row to be deleted</param> /// <param name="ADeletionQuestion">can be changed to a context-sensitive deletion confirmation question</param> /// <returns>true if user is permitted and able to delete the current row</returns> private bool PreDeleteManual(PmPersonSkillRow ARowToDelete, ref string ADeletionQuestion) { /*Code to execute before the delete can take place*/ ADeletionQuestion = Catalog.GetString("Are you sure you want to delete the current row?"); ADeletionQuestion += String.Format("{0}{0}({1} {2}, {3} {4})", Environment.NewLine, lblSkillCode.Text, cmbSkillCode.GetSelectedString(), lblDescriptEnglish.Text, txtDescriptEnglish.Text); return(true); }
private void NewRowManual(ref PmPersonSkillRow ARow) { ARow.PersonSkillKey = Convert.ToInt32(TRemote.MCommon.WebConnectors.GetNextSequence(TSequenceNames.seq_person_skill)); ARow.PartnerKey = FMainDS.PPerson[0].PartnerKey; // initialize skill level with first entry in cacheable table (to avoid runtime error) PtSkillLevelTable SkillLevelTable = (PtSkillLevelTable)TDataCache.TMPersonnel.GetCacheablePersonnelTable( TCacheablePersonTablesEnum.SkillLevelList); if (SkillLevelTable.Count > 0) { ARow.SkillLevel = ((PtSkillLevelRow)(SkillLevelTable.Rows[0])).Level; } else { ARow.SkillLevel = 0; } }
/// <summary> /// Validates the skill data of a Person. /// </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> /// <returns>void</returns> public static void ValidateSkillManual(object AContext, PmPersonSkillRow ARow, ref TVerificationResultCollection AVerificationResultCollection, TValidationControlsDict AValidationControlsDict) { DataColumn ValidationColumn; TValidationControlsData ValidationControlsData; TVerificationResult VerificationResult; // Don't validate deleted DataRows if (ARow.RowState == DataRowState.Deleted) { return; } // 'Skill Category' must not be unassignable ValidationColumn = ARow.Table.Columns[PmPersonSkillTable.ColumnSkillCategoryCodeId]; if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData)) { PtSkillCategoryTable CategoryTable; PtSkillCategoryRow CategoryRow = null; VerificationResult = null; if (!ARow.IsSkillCategoryCodeNull()) { CategoryTable = (PtSkillCategoryTable)TSharedDataCache.TMPersonnel.GetCacheablePersonnelTableDelegate( TCacheablePersonTablesEnum.SkillCategoryList); CategoryRow = (PtSkillCategoryRow)CategoryTable.Rows.Find(ARow.SkillCategoryCode); // 'Skill Category' must not be unassignable if ((CategoryRow != null) && CategoryRow.UnassignableFlag && (CategoryRow.IsUnassignableDateNull() || (CategoryRow.UnassignableDate <= DateTime.Today))) { // if 'Skill Category' is unassignable then check if the value has been changed or if it is a new record if (TSharedValidationHelper.IsRowAddedOrFieldModified(ARow, PmPersonSkillTable.GetSkillCategoryCodeDBName())) { VerificationResult = new TScreenVerificationResult(new TVerificationResult(AContext, ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_VALUEUNASSIGNABLE_WARNING, new string[] { ValidationControlsData.ValidationControlLabel, ARow.SkillCategoryCode })), ValidationColumn, ValidationControlsData.ValidationControl); } } } // Handle addition/removal to/from TVerificationResultCollection AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn); } // 'Skill Level' must not be unassignable ValidationColumn = ARow.Table.Columns[PmPersonSkillTable.ColumnSkillLevelId]; if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData)) { PtSkillLevelTable LevelTable; PtSkillLevelRow LevelRow = null; VerificationResult = null; if (!ARow.IsSkillLevelNull()) { LevelTable = (PtSkillLevelTable)TSharedDataCache.TMPersonnel.GetCacheablePersonnelTableDelegate( TCacheablePersonTablesEnum.SkillLevelList); LevelRow = (PtSkillLevelRow)LevelTable.Rows.Find(ARow.SkillLevel); // 'Skill Level' must not be unassignable if ((LevelRow != null) && LevelRow.UnassignableFlag && (LevelRow.IsUnassignableDateNull() || (LevelRow.UnassignableDate <= DateTime.Today))) { // if 'Skill Level' is unassignable then check if the value has been changed or if it is a new record if (TSharedValidationHelper.IsRowAddedOrFieldModified(ARow, PmPersonSkillTable.GetSkillLevelDBName())) { VerificationResult = new TScreenVerificationResult(new TVerificationResult(AContext, ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_VALUEUNASSIGNABLE_WARNING, new string[] { ValidationControlsData.ValidationControlLabel, ARow.SkillLevel.ToString() })), ValidationColumn, ValidationControlsData.ValidationControl); } } } else { // skill level must have a value VerificationResult = new TScreenVerificationResult(new TVerificationResult(AContext, ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_VALUE_NOT_ENTERED)), ValidationColumn, ValidationControlsData.ValidationControl); } // Handle addition/removal to/from TVerificationResultCollection AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn); } }
/// <summary> /// Performs checks to determine whether a deletion of the current /// row is permissable /// </summary> /// <param name="ARowToDelete">the currently selected row to be deleted</param> /// <param name="ADeletionQuestion">can be changed to a context-sensitive deletion confirmation question</param> /// <returns>true if user is permitted and able to delete the current row</returns> private bool PreDeleteManual(PmPersonSkillRow ARowToDelete, ref string ADeletionQuestion) { /*Code to execute before the delete can take place*/ ADeletionQuestion = Catalog.GetString("Are you sure you want to delete the current row?"); ADeletionQuestion += String.Format("{0}{0}({1} {2}, {3} {4})", Environment.NewLine, lblSkillCode.Text, cmbSkillCode.GetSelectedString(), lblDescriptEnglish.Text, txtDescriptEnglish.Text); return true; }