Example #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="APetraUtilsObject">Reference to the PetraUtilsObject for the form</param>
        /// <param name="ALedgerNumber">Ledger number</param>
        /// <param name="AMainDS">The main data set</param>
        /// <param name="AFilterFindPanelObject">The filter panel control object</param>
        public TUC_GiftBatches_LoadAndFilter(TFrmPetraEditUtils APetraUtilsObject,
                                             int ALedgerNumber,
                                             GiftBatchTDS AMainDS,
                                             TFilterAndFindPanel AFilterFindPanelObject)
        {
            FPetraUtilsObject      = APetraUtilsObject;
            FLedgerNumber          = ALedgerNumber;
            FMainDS                = AMainDS;
            FFilterFindPanelObject = AFilterFindPanelObject;

            FrbtEditing    = (RadioButton)AFilterFindPanelObject.FilterPanelControls.FindControlByName("rbtEditing");
            FrbtPosting    = (RadioButton)AFilterFindPanelObject.FilterPanelControls.FindControlByName("rbtPosting");
            FrbtAll        = (RadioButton)AFilterFindPanelObject.FilterPanelControls.FindControlByName("rbtAll");
            FcmbYearEnding = (TCmbAutoComplete)AFilterFindPanelObject.FilterPanelControls.FindControlByName("cmbYearEnding");
            FcmbPeriod     = (TCmbAutoComplete)AFilterFindPanelObject.FilterPanelControls.FindControlByName("cmbPeriod");

            FMainDS.AGiftBatch.DefaultView.Sort = String.Format("{0}, {1} DESC",
                                                                AGiftBatchTable.GetLedgerNumberDBName(),
                                                                AGiftBatchTable.GetBatchNumberDBName()
                                                                );

            // Populate the Year ComboBox with available years for the specified ledger
            TFinanceControls.InitialiseAvailableGiftYearsList(ref FcmbYearEnding, FLedgerNumber);
            //TLogging.Log("Gift Years completed");

            // Ensure that we start with the status set to 'editing'.
            FrbtEditing.Checked = true;
            //TLogging.Log("Editing checkbox selected");
        }