private void ValidateDataDetailsManual(PInterestRow ARow)
        {
            TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection;

            TSharedPartnerValidation_Partner.ValidateInterestSetupManual(this, ARow,
                                                                         ref VerificationResultCollection, FPetraUtilsObject.ValidationControlsDict);
        }
        private void ValidateDataDetailsManual(PInterestRow ARow)
        {
            TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection;

            TSharedPartnerValidation_Partner.ValidateInterestSetupManual(this, ARow,
                ref VerificationResultCollection, FPetraUtilsObject.ValidationControlsDict);
        }
Esempio n. 3
0
        /// <summary>
        /// todoComment
        /// </summary>
        /// <param name="AGrid"></param>
        /// <param name="tmpDT"></param>
        /// <param name="IsNew"></param>
        public void RefreshDataGrid(ref TSgrdDataGrid AGrid, DataTable tmpDT, Boolean IsNew)
        {
            DataRow             TheNewRow;
            PPartnerInterestRow tmpPartnerInterestRow;
            PInterestRow        tmpInterestRow = null; // todo: this needs to be assigned? says Timo while converting from delphi
            TRecalculateScreenPartsEventArgs RecalculateScreenPartsEventArgs;
            Int32            counter;
            StringCollection ACollection = new StringCollection();
            StringCollection SortedCollection;

            // AInterestRow : PInterestRow;
            MessageBox.Show("TmpDT count:" + tmpDT.Rows.Count.ToString());
            tmpPartnerInterestRow =
                ((PPartnerInterestRow)FMultiTableDS.PPartnerInterest.Rows.Find(new Object[] { FMultiTableDS.PPartner[0].PartnerKey, FInterestNumber }));

            // tmpPartnerInterestRow := tmpDT.rows[tmpDT.rows.count1] as PPartnerInterestRow;
            // tmpInterestRow := tmpDT.rows[tmpDT.rows.count1] as PInterestRow;
            // MessageBox.Show('Refreshgrid: '+tmpPartnerInterestRow.Interest);
            // AInterestRow := (FMultiTableDS.PInterest.Rows.Find(new Object[]{[tmpPartnerInterestRow.Interest]}) as PinterestRow);
            FPartnerInterestsGridTable = new DataTable();
            TheNewRow = FPartnerInterestsGridTable.NewRow();

            // TheNewRow['Category'] := AInterestROw.Category as System.Object;
            // TheNewRow['Category'] := 'DOG';
            TheNewRow["Interest"] = (System.Object)tmpPartnerInterestRow.Interest;
            TheNewRow["Country"]  = (System.Object)tmpPartnerInterestRow.Country;
            TheNewRow["Field"]    = (System.Object)tmpPartnerInterestRow.FieldKey;
            TheNewRow["Level"]    = (System.Object)tmpPartnerInterestRow.Level;
            TheNewRow["Comment"]  = (System.Object)tmpPartnerInterestRow.Comment;
            FPartnerInterestsGridTable.Rows.Add(TheNewRow);
            AGrid.DataSource = new DevAge.ComponentModel.BoundDataView(FPartnerInterestsGridTable.DefaultView);
            counter          = 0;

            foreach (DataRow tmpRow in FPartnerInterestsGridTable.Rows)
            {
                ACollection.Add(tmpRow[PInterestTable.GetCategoryDBName()].ToString());
            }

            SortedCollection = StringHelper.StrSort(ACollection);

            foreach (String AInterestString in SortedCollection)
            {
                counter = counter + 1;

                if (AInterestString == tmpInterestRow.Interest.ToString())
                {
                    break;
                }
            }

            RecalculateScreenPartsEventArgs            = new TRecalculateScreenPartsEventArgs();
            RecalculateScreenPartsEventArgs.ScreenPart = TScreenPartEnum.spCounters;
            OnRecalculateScreenParts(RecalculateScreenPartsEventArgs);
            AGrid.Selection.Focus(new Position(1, 1), true);
            AGrid.Selection.ResetSelection(false);
            AGrid.Selection.SelectRow(counter, true);
        }
        private void NewRowManual(ref PInterestRow ARow)
        {
            string newName        = Catalog.GetString("NEWINTEREST");
            Int32  countNewDetail = 0;

            if (FMainDS.PInterest.Rows.Find(new object[] { newName }) != null)
            {
                while (FMainDS.PInterest.Rows.Find(new object[] { newName + countNewDetail.ToString() }) != null)
                {
                    countNewDetail++;
                }

                newName += countNewDetail.ToString();
            }

            ARow.Interest = newName;
        }
        private void NewRowManual(ref PInterestRow ARow)
        {
            string newName = Catalog.GetString("NEWINTEREST");
            Int32 countNewDetail = 0;

            if (FMainDS.PInterest.Rows.Find(new object[] { newName }) != null)
            {
                while (FMainDS.PInterest.Rows.Find(new object[] { newName + countNewDetail.ToString() }) != null)
                {
                    countNewDetail++;
                }

                newName += countNewDetail.ToString();
            }

            ARow.Interest = newName;
        }
Esempio n. 6
0
        /// <summary>
        /// Validates the Partner Interest Setup 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 ValidateInterestSetupManual(object AContext, PInterestRow ARow,
            ref TVerificationResultCollection AVerificationResultCollection, TValidationControlsDict AValidationControlsDict)
        {
            DataColumn ValidationColumn;
            TValidationControlsData ValidationControlsData;
            TVerificationResult VerificationResult = null;

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

            // 'Category' must not be null
            ValidationColumn = ARow.Table.Columns[PInterestTable.ColumnCategoryId];

            if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
            {
                VerificationResult = TGeneralChecks.ValueMustNotBeNullOrEmptyString(ARow.Category, Catalog.GetString("Category"),
                    AContext, ValidationColumn, ValidationControlsData.ValidationControl);

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