Пример #1
0
        /// constructor (use this one!)
        public TFrmGiftDestination(Form AParentForm, long APartnerKey) : base()
        {
            FPartnerKey = APartnerKey;

            TSearchCriteria[] Search = new TSearchCriteria[1];
            Search[0] = new TSearchCriteria(PPartnerGiftDestinationTable.GetPartnerKeyDBName(), FPartnerKey);

            Initialize(AParentForm, Search);
        }
Пример #2
0
        /// <summary>
        /// Will be called by TFormsList to inform any Form that is registered in TFormsList
        /// about any 'Forms Messages' that are broadcasted.
        /// </summary>
        /// <remarks>Theis screen 'listens' to such 'Forms Message' broadcasts by
        /// implementing this virtual Method. This Method will be called each time a
        /// 'Forms Message' broadcast occurs.
        /// </remarks>
        /// <param name="AFormsMessage">An instance of a 'Forms Message'. This can be
        /// inspected for parameters in the Method Body and the Form can use those to choose
        /// to react on the Message, or not.</param>
        /// <returns>Returns True if the Form reacted on the specific Forms Message,
        /// otherwise false.</returns>
        public bool ProcessFormsMessage(TFormsMessage AFormsMessage)
        {
            bool MessageProcessed = false;

            if ((AFormsMessage.MessageClass == TFormsMessageClassEnum.mcPersonnelCommitmentChanged) &&
                (((IFormsMessagePartnerInterface)AFormsMessage.MessageObject).PartnerKey == FPartnerKey))
            {
                TSearchCriteria[] Search = new TSearchCriteria[1];
                Search[0] = new TSearchCriteria(PPartnerGiftDestinationTable.GetPartnerKeyDBName(), FPartnerKey);

                FMainDS = new TLocalMainTDS();
                Ict.Common.Data.TTypedDataTable TypedTable;
                TRemote.MCommon.DataReader.WebConnectors.GetData(PPartnerGiftDestinationTable.GetTableDBName(), Search, out TypedTable);
                FMainDS.PPartnerGiftDestination.Merge(TypedTable);

                SetupGrid();
                UpdateRecordNumberDisplay();
                SelectRowInGrid(1);

                MessageProcessed = true;
            }

            return(MessageProcessed);
        }