Example #1
0
 private void ShowDetailsManual(PmPersonEvaluationRow 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();
 }
Example #2
0
        private void ValidateDataDetailsManual(PmPersonEvaluationRow ARow)
        {
            TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection;

            TSharedPersonnelValidation_Personnel.ValidateProgressReportManual(this, ARow, ref VerificationResultCollection,
                                                                              FValidationControlsDict);
        }
Example #3
0
 /// <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(PmPersonEvaluationRow ARowToDelete,
                               bool AAllowDeletion,
                               bool ADeletionPerformed,
                               string ACompletionMessage)
 {
     if (ADeletionPerformed)
     {
         DoRecalculateScreenParts();
     }
 }
Example #4
0
 /// <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(PmPersonEvaluationRow 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},{0} {3} {4},{0} {5} {6})",
                                        Environment.NewLine,
                                        lblEvaluator.Text,
                                        txtEvaluator.Text,
                                        lblEvaluationDate.Text,
                                        dtpEvaluationDate.Date.Value.ToString("dd-MMM-yyyy").ToUpper(),
                                        lblEvaluationType.Text,
                                        cmbEvaluationType.GetSelectedString());
     return(true);
 }
Example #5
0
        private void NewRowManual(ref PmPersonEvaluationRow ARow)
        {
            DateTime EvaluationDate = DateTime.Now.Date;

            ARow.PartnerKey = FMainDS.PPerson[0].PartnerKey;
            ARow.Evaluator  = "";

            /* check if the primary key is already in use and otherwise decrease the initial evaluation date
             * which will then be modified by the user */
            if (FMainDS.PmPersonEvaluation.Rows.Find(new object[] { ARow.PartnerKey, EvaluationDate, ARow.Evaluator }) != null)
            {
                while (FMainDS.PmPersonEvaluation.Rows.Find(new object[] { ARow.PartnerKey, EvaluationDate, ARow.Evaluator }) != null)
                {
                    EvaluationDate = EvaluationDate.AddDays(-1);
                }
            }

            ARow.EvaluationDate = EvaluationDate;
        }
        private void NewRowManual(ref PmPersonEvaluationRow ARow)
        {
            DateTime EvaluationDate = DateTime.Now.Date;

            ARow.PartnerKey = FMainDS.PPerson[0].PartnerKey;
            ARow.Evaluator = "";

            /* check if the primary key is already in use and otherwise decrease the initial evaluation date
             * which will then be modified by the user */
            if (FMainDS.PmPersonEvaluation.Rows.Find(new object[] { ARow.PartnerKey, EvaluationDate, ARow.Evaluator }) != null)
            {
                while (FMainDS.PmPersonEvaluation.Rows.Find(new object[] { ARow.PartnerKey, EvaluationDate, ARow.Evaluator }) != null)
                {
                    EvaluationDate = EvaluationDate.AddDays(-1);
                }
            }

            ARow.EvaluationDate = EvaluationDate;
        }
        private void ValidateDataDetailsManual(PmPersonEvaluationRow ARow)
        {
            TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection;

            TSharedPersonnelValidation_Personnel.ValidateProgressReportManual(this, ARow, ref VerificationResultCollection,
                FValidationControlsDict);
        }
 private void ShowDetailsManual(PmPersonEvaluationRow 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();
 }
 /// <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(PmPersonEvaluationRow 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(PmPersonEvaluationRow 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},{0} {3} {4},{0} {5} {6})",
         Environment.NewLine,
         lblEvaluator.Text,
         txtEvaluator.Text,
         lblEvaluationDate.Text,
         dtpEvaluationDate.Date.Value.ToString("dd-MMM-yyyy").ToUpper(),
         lblEvaluationType.Text,
         cmbEvaluationType.GetSelectedString());
     return true;
 }
        /// <summary>
        /// Validates the progress report (evaluation) 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 ValidateProgressReportManual(object AContext, PmPersonEvaluationRow ARow,
            ref TVerificationResultCollection AVerificationResultCollection, TValidationControlsDict AValidationControlsDict)
        {
            DataColumn ValidationColumn;
            TValidationControlsData ValidationControlsData;
            TVerificationResult VerificationResult;

            // Don't validate deleted DataRows
            if (ARow.RowState == DataRowState.Deleted)
            {
                return;
            }

            // 'Evaluator' must have a value
            ValidationColumn = ARow.Table.Columns[PmPersonEvaluationTable.ColumnEvaluatorId];

            if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
            {
                VerificationResult = TStringChecks.StringMustNotBeEmpty(ARow.Evaluator,
                    ValidationControlsData.ValidationControlLabel,
                    AContext, ValidationColumn, ValidationControlsData.ValidationControl);

                // Handle addition to/removal from TVerificationResultCollection
                AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn);
            }

            // 'Evaluation Date' must have a value
            ValidationColumn = ARow.Table.Columns[PmPersonEvaluationTable.ColumnEvaluationDateId];

            if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
            {
                VerificationResult = TSharedValidationControlHelper.IsNotInvalidDate(ARow.EvaluationDate,
                    ValidationControlsData.ValidationControlLabel, AVerificationResultCollection, true,
                    AContext, ValidationColumn, ValidationControlsData.ValidationControl);

                // Handle addition to/removal from TVerificationResultCollection
                AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn);
            }

            // 'Next Evaluation Date' must have a value if evaluation type is not set to "Leaving"
            ValidationColumn = ARow.Table.Columns[PmPersonEvaluationTable.ColumnNextEvaluationDateId];

            if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
            {
                VerificationResult = null;

                if (ARow.EvaluationType != "Leaving")
                {
                    VerificationResult = TSharedValidationControlHelper.IsNotInvalidDate(ARow.NextEvaluationDate,
                        ValidationControlsData.ValidationControlLabel, AVerificationResultCollection, true,
                        AContext, ValidationColumn, ValidationControlsData.ValidationControl);
                }

                // Handle addition to/removal from TVerificationResultCollection
                AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn);
            }

            // 'Next Evaluation Date' must be later than 'Evaluation Date'
            ValidationColumn = ARow.Table.Columns[PmPersonEvaluationTable.ColumnNextEvaluationDateId];

            if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
            {
                VerificationResult = TDateChecks.FirstGreaterOrEqualThanSecondDate(ARow.NextEvaluationDate, ARow.EvaluationDate,
                    ValidationControlsData.ValidationControlLabel, ValidationControlsData.SecondValidationControlLabel,
                    AContext, ValidationColumn, ValidationControlsData.ValidationControl);

                // Handle addition to/removal from TVerificationResultCollection
                AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn);
            }

            // 'Report Type' must have a value
            ValidationColumn = ARow.Table.Columns[PmPersonEvaluationTable.ColumnEvaluationTypeId];

            if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
            {
                VerificationResult = TStringChecks.StringMustNotBeEmpty(ARow.EvaluationType,
                    ValidationControlsData.ValidationControlLabel,
                    AContext, ValidationColumn, ValidationControlsData.ValidationControl);

                // Handle addition to/removal from TVerificationResultCollection
                AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn);
            }
        }