/// <summary>
        ///
        /// </summary>
        public void SpecialInitUserControl()
        {
            // Set up screen logic
            PartnerEditUIConnector = FPartnerEditUIConnector;
            LoadDataOnDemand();

            OnHookupDataChange(new THookupPartnerEditDataChangeEventArgs(TPartnerEditTabPageEnum.petpSubscriptions));

            // Hook up DataSavingStarted Event to be able to run code before SaveChanges is doing anything
            FPetraUtilsObject.DataSavingStarted += new TDataSavingStartHandler(this.DataSavingStarted);

            // Manually add button for the modified/created information that was present in Petra 2.x's Subscription Tab,
            // but were missing from OpenPetra's Subscription Tab (Bug #4378) because the WinForms Generator doesn't have
            // a built-in support for the creation of those buttons yet (Bug #1782).
            TbtnCreatedHelper.AddModifiedCreatedButtonToContainerControl(ref btnCreatedModified, pnlDetails, ACustomYLocation: 7);
            FPetraUtilsObject.SetStatusBarText(btnCreatedModified, ApplWideResourcestrings.StrBtnCreatedUpdatedStatusBarText);

            if (grdDetails.Rows.Count > 1)
            {
                grdDetails.SelectRowInGrid(1);
                ShowDetails(1); // do this as for some reason details are not automatically show here at the moment
            }
            else
            {
                btnCancelAllSubscriptions.Enabled = false;
            }

            grdDetails.AutoResizeGrid();

            // use dictionary of details control as validation is called for dictionary of this class
            FValidationControlsDict = ucoDetails.ValidationControlsDict;
        }
Exemple #2
0
        private void ShowDataManual(PUnitRow UnitRow)
        {
            lblParentName.Left = 250;
            btnOrganise.Left   = 430;

            if ((FMainDS.UmUnitStructure != null) &&
                (FMainDS.UmUnitStructure.Rows.Count > 0))
            {
                txtParentKey.Text = FMainDS.UmUnitStructure[0].ParentUnitKey.ToString("D10");
                SetParentLabel(FMainDS.UmUnitStructure[0].ParentUnitKey);
                btnOrganise.Enabled = true;
            }
            else
            {
                btnOrganise.Enabled = false;
            }

            // If this unit has a corresponding conference in the database then the user should not be able to change the currency code from
            // the partner edit screen. They can change it in the Conference Master Settings screen.
            if (TRemote.MPartner.Partner.WebConnectors.IsPUnitAConference(UnitRow.PartnerKey))
            {
                cmbOutreachCostCurrencyCode.Enabled = false;
                FPetraUtilsObject.SetStatusBarText(txtOutreachCost, Catalog.GetString("Enter the cost of this outreach" +
                                                                                      Catalog.GetString(" (The currency can be modified in 'Conference Master Settings' in the the Conference module)")));
            }
        }
Exemple #3
0
        private void OnFileCodeChange(Object sender, EventArgs e)
        {
            switch (cmbDetailFileCode.GetSelectedString())
            {
            case "AFO":
            case "BRANCH":
            case "STEWARDSHIP":
            case "FUND BALANCE":
            case "FUND BALS-AFO":
                txtDetailConditionalValue.Enabled = false;
                txtDetailConditionalValue.Text    = "";
                break;

            case "HOSA":
            case "ICH":
                txtDetailConditionalValue.Enabled = true;
                FPetraUtilsObject.SetStatusBarText(txtDetailConditionalValue, "Enter a Fund Number");
                break;

            case "GIFT STATEMENT":
                txtDetailConditionalValue.Enabled = true;
                FPetraUtilsObject.SetStatusBarText(txtDetailConditionalValue, "Enter a Motivation Group and Detail, separated by a | character");
                break;

            default:
                txtDetailConditionalValue.Enabled = true;
                FPetraUtilsObject.SetStatusBarText(txtDetailConditionalValue, "Enter the condition value");
                break;
            }
        }
        private void InitializeManualCode()
        {
            // Set up the appearance of the combo boxes
            cmbDetailAddressLayoutCode.AppearanceSetup(new int[] { -1, 150 }, -1);
            cmbAddressBlockElement.AppearanceSetup(new int[] { 190, 390 }, -1);
            cmbAddressBlockElement.AttachedLabel.Left += 100;

            // set up the appearance of the text box
            txtDetailAddressBlockText.HideSelection = false;

            // set up the properties of the additional button
            btnInsert.Name     = "btnInsert";
            btnInsert.Text     = "&Insert";
            btnInsert.Size     = new System.Drawing.Size(80, 23);
            btnInsert.Left     = 10;
            btnInsert.Top      = txtDetailAddressBlockText.Bottom - btnInsert.Height;
            btnInsert.TabIndex = txtDetailAddressBlockText.TabIndex + 3;
            btnInsert.Click   += new System.EventHandler(InsertElement);
            pnlDetails.Controls.Add(btnInsert);

            FPetraUtilsObject.SetStatusBarText(btnInsert,
                                               Catalog.GetString("Click to enter the selected placeholder at the cursor position in the Address Layout"));

            FAddressBlockElements = (PAddressBlockElementTable)TDataCache.GetCacheableDataTableFromCache("AddressBlockElementList");

            if (FPetraUtilsObject.SecurityReadOnly)
            {
                btnCopy.Enabled       = false;
                btnInsert.Enabled     = false;
                btnInsertLine.Enabled = false;
            }
        }
        private void InitializeManualCode()
        {
            var SecurityPermissionRequired = new List <string>();

            SecurityPermissionRequired.Add(TSecurityChecks.SECURITYPERMISSION_FINANCEREPORTING);
            FPetraUtilsObject.ApplySecurity(SecurityPermissionRequired);

            // remove from the combobox all ledger numbers which the user does not have permission to access
            DataView cmbLedgerDataView = (DataView)cmbLedger.cmbCombobox.DataSource;

            for (int i = 0; i < cmbLedgerDataView.Count; i++)
            {
                string LedgerNumberStr;

                // postgresql
                if (cmbLedgerDataView[i].Row[0].GetType().Equals(typeof(int)))
                {
                    LedgerNumberStr = ((int)cmbLedgerDataView[i].Row[0]).ToString("0000");
                }
                else // sqlite
                {
                    LedgerNumberStr = ((Int64)cmbLedgerDataView[i].Row[0]).ToString("0000");
                }

                if (!UserInfo.GUserInfo.IsInModule("LEDGER" + LedgerNumberStr))
                {
                    cmbLedgerDataView.Delete(i);
                    i--;
                }
            }

            FPetraUtilsObject.SetStatusBarText(grdDetails, Catalog.GetString("Use the mouse or navigation keys to select a data row to view"));

            // set the currency code to be blank initially
            txtGiftTotal.CurrencyCode       = String.Empty;
            txtGiftTotal.NumberValueDecimal = 0.0m;

            lblRecordCounter.Text = "";
            pnlPostedOnlyNote.Top = 0;

            // correct the tab indexes
            int TabOrder = dtpDateFrom.TabIndex;

            dtpDateFrom.TabIndex  = txtRecipient.TabIndex;
            txtRecipient.TabIndex = TabOrder;

            cmbMotivationGroup.RemoveDescriptionLabel();
            cmbMotivationDetail.RemoveDescriptionLabel();

            // catch enter on all controls, to trigger search
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CatchEnterKey);

            // catch enter on grid to view the selected transaction
            this.grdDetails.EnterKeyPressed += new Ict.Common.Controls.TKeyPressedEventHandler(this.ViewTransaction);

            // focus on txtDonor
            this.ActiveControl = txtDonor;
        }
Exemple #6
0
        private void InitializeManualCode()
        {
            ucoPetraLogoAndVersionInfo.PetraVersion     = TClientInfo.ClientAssemblyVersion;
            ucoPetraLogoAndVersionInfo.InstallationKind = string.Empty;

#if DEBUG
            if (TApplicationVCSInfo.AppVCSData.IsInitialised)
            {
                FPetraUtilsObject.SetStatusBarText(btnOK, "Click on Version Number for VCS Info!");
            }
#endif
        }
Exemple #7
0
        private void ApplyFilterManual(ref string AFilter)
        {
            if (FPagedDataTable != null)
            {
                FPagedDataTable.DefaultView.RowFilter = AFilter;
            }

            bool gotRows    = (grdDetails.Rows.Count > 1);
            bool canApprove = ((RadioButton)FFilterAndFindObject.FilterPanelControls.FindControlByName("rbtForApproval")).Checked && gotRows;
            bool canPost    = ((RadioButton)FFilterAndFindObject.FilterPanelControls.FindControlByName("rbtForPosting")).Checked && gotRows;
            bool canPay     = ((RadioButton)FFilterAndFindObject.FilterPanelControls.FindControlByName("rbtForPaying")).Checked && gotRows;

            bool canTag = canApprove || canPost || canPay;

            ActionEnabledEvent(null, new ActionEventArgs("actOpenTagged", canTag));
            ActionEnabledEvent(null, new ActionEventArgs("actApproveTagged", canApprove));
            ActionEnabledEvent(null, new ActionEventArgs("actPostTagged", canPost));
            ActionEnabledEvent(null, new ActionEventArgs("actAddTaggedToPayment", canPay));
            ActionEnabledEvent(null, new ActionEventArgs("actRunTagAction", canTag));
            ActionEnabledEvent(null, new ActionEventArgs("actTagAll", canTag));
            ActionEnabledEvent(null, new ActionEventArgs("actUntagAll", canTag));

            grdDetails.Columns[0].Visible = canTag;

            if (canTag)
            {
                grdDetails.ShowCell(new SourceGrid.Position(grdDetails.Selection.ActivePosition.Row, 0), true);
            }

            if (canApprove)
            {
                btnRunTagAction.Text = "Appro&ve Tagged";
                FPetraUtilsObject.SetStatusBarText(btnRunTagAction, Catalog.GetString("Click to approve the tagged items"));
            }
            else if (canPost)
            {
                btnRunTagAction.Text = "&Post Tagged";
                FPetraUtilsObject.SetStatusBarText(btnRunTagAction, Catalog.GetString("Click to post the tagged items"));
            }
            else if (canPay)
            {
                btnRunTagAction.Text = "Pa&y Tagged";
                FPetraUtilsObject.SetStatusBarText(btnRunTagAction, Catalog.GetString("Click to pay the tagged items"));
            }
            else
            {
                btnRunTagAction.Text = "Pa&y Tagged";
            }

            UpdateDisplayedBalance();
        }
Exemple #8
0
        private void InitializeManualCode()
        {
            grdDetails = grdResult;

            grdResult.MouseClick                 += new MouseEventHandler(grdResult_Click);
            grdResult.DataPageLoaded             += new TDataPageLoadedEventHandler(grdResult_DataPageLoaded);
            grdResult.Selection.SelectionChanged += new SourceGrid.RangeRegionChangedEventHandler(grdResult_SelectionChanged);

            FPetraUtilsObject.SetStatusBarText(grdDetails,
                                               Catalog.GetString("Use the navigation keys to select a transaction.  Double-click to view the details"));
            FPetraUtilsObject.SetStatusBarText(btnReloadList, Catalog.GetString("Click to re-load the transactions list"));
            FPetraUtilsObject.SetStatusBarText(btnTagAll, Catalog.GetString("Click to tag all the displayed items"));
            FPetraUtilsObject.SetStatusBarText(btnUntagAll, Catalog.GetString("Click to un-tag all the displayed items"));
            FPetraUtilsObject.SetStatusBarText(chkToggleFilter, Catalog.GetString("Click to show/hide the Filter/Find panel"));
        }
        private void InitializeManualCode()
        {
            // set status bar text for controls
            FPetraUtilsObject.SetStatusBarText(txtBranchName, Catalog.GetString("Enter a Bank name"));
            FPetraUtilsObject.SetStatusBarText(txtBranchCode, Catalog.GetString("Enter a Bank/Branch Code"));
            FPetraUtilsObject.SetStatusBarText(txtBicCode, Catalog.GetString("Enter a Bank's BIC/SWIFT Code"));
            FPetraUtilsObject.SetStatusBarText(txtCity, Catalog.GetString("Enter a Bank's City"));
            FPetraUtilsObject.SetStatusBarText(txtCountry, Catalog.GetString("Enter a Bank's Country"));
            FPetraUtilsObject.SetStatusBarText(btnClear, Catalog.GetString("Clear the filter text"));
            FPetraUtilsObject.SetStatusBarText(btnEdit, Catalog.GetString("Open the Partner Edit screen for the selected Partner"));
            FPetraUtilsObject.SetStatusBarText(btnAccept, Catalog.GetString("Accept selected Bank"));
            FPetraUtilsObject.SetStatusBarText(btnCancel, Catalog.GetString("Cancel selection"));

            // add additional event to chkbox
            chkShowInactive.CheckedChanged += new System.EventHandler(this.SelectRowInGrid);

            // set initial focus
            this.ActiveControl = txtBranchName;

            // catch enter on all controls, to move focus to the grid
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CatchEnterKey);
        }
        private void ApplyFilterManual(ref string AFilter)
        {
            if (FInvoiceTable != null)
            {
                FInvoiceTable.DefaultView.RowFilter = AFilter;

                bool gotRows    = (grdDetails.Rows.Count > 1);
                bool canApprove = ((RadioButton)FFilterAndFindObject.FilterPanelControls.FindControlByName("rbtForApproval")).Checked && gotRows;
                bool canPost    = ((RadioButton)FFilterAndFindObject.FilterPanelControls.FindControlByName("rbtForPosting")).Checked && gotRows;
                bool canPay     = ((RadioButton)FFilterAndFindObject.FilterPanelControls.FindControlByName("rbtForPaying")).Checked && gotRows;

                bool canTag = canApprove || canPost || canPay;

                ActionEnabledEvent(null, new ActionEventArgs("actTagAll", canTag));
                ActionEnabledEvent(null, new ActionEventArgs("actUntagAll", canTag));
                ActionEnabledEvent(null, new ActionEventArgs("actOpenSelectedInvoice", gotRows));
                ActionEnabledEvent(null, new ActionEventArgs("actRunTagAction", canTag));
                ActionEnabledEvent(null, new ActionEventArgs("actCancelTagged", canPost || canApprove));
                ActionEnabledEvent(null, new ActionEventArgs("actReverseTagged", canPay));

                FMainForm.ActionEnabledEvent(null, new ActionEventArgs("actInvoiceOpenSelected", gotRows));
                FMainForm.ActionEnabledEvent(null, new ActionEventArgs("actInvoiceOpenTagged", gotRows && canTag));
                FMainForm.ActionEnabledEvent(null, new ActionEventArgs("actInvoiceApproveTagged", canApprove));
                FMainForm.ActionEnabledEvent(null, new ActionEventArgs("actInvoicePostTagged", canPost));
                FMainForm.ActionEnabledEvent(null, new ActionEventArgs("actInvoiceCancelTagged", canPost || canApprove));
                FMainForm.ActionEnabledEvent(null, new ActionEventArgs("actInvoicePayTagged", canPay));
                FMainForm.ActionEnabledEvent(null, new ActionEventArgs("actInvoiceReverseTagged", canPay));

                grdInvoices.Columns[0].Visible = canTag;

                btnTagAll.Visible        = canTag;
                btnUntagAll.Visible      = canTag;
                btnRunTagAction.Visible  = canTag;
                btnCancelTagged.Visible  = canTag;
                btnReverseTagged.Visible = canTag;

                if (canTag)
                {
                    grdInvoices.ShowCell(new SourceGrid.Position(grdInvoices.Selection.ActivePosition.Row, 0), true);
                }

                UpdateDisplayedBalance();

                if (canApprove)
                {
                    btnRunTagAction.Text = "Appro&ve Tagged";
                    FPetraUtilsObject.SetStatusBarText(btnRunTagAction, Catalog.GetString("Click to approve all the tagged items"));
                }
                else if (canPost)
                {
                    btnRunTagAction.Text = "&Post Tagged";
                    FPetraUtilsObject.SetStatusBarText(btnRunTagAction, Catalog.GetString("Click to post all the tagged items"));
                }
                else if (canPay)
                {
                    btnRunTagAction.Text = "Pa&y Tagged";
                    FPetraUtilsObject.SetStatusBarText(btnRunTagAction, Catalog.GetString("Click to pay or part pay all the tagged items"));
                }
                else
                {
                    btnRunTagAction.Text = "Pa&y Tagged";
                }
            }
        }
        // This is the main area where we set up to use the additional information from the extra table
        private void InitializeManualCode()
        {
            // Get our screenClassName
            string ScreenName = this.GetType().Name;

            // Initialise the list box column headings in the working DataTable and the GUI
            string DBCol1  = DBUsedBy;
            string DBCol2  = String.Empty;
            string GUICol2 = String.Empty;
            string DBCol3  = "Label";

            if (String.Compare(ScreenName, "TFrmLocalPartnerDataFieldSetup", true) == 0)
            {
                CurrentContext = Context.Partner;
                DBCol2         = "PartnerClass";
                GUICol2        = Catalog.GetString("Partner Class");
            }
            else if (String.Compare(ScreenName, "TFrmLocalApplicationDataFieldSetup", true) == 0)
            {
                CurrentContext = Context.Application;
                DBCol2         = "Application";
                GUICol2        = Catalog.GetString("Application");
            }
            else if (String.Compare(ScreenName, "TFrmLocalPersonnelDataFieldSetup", true) == 0)
            {
                CurrentContext = Context.Personnel;
                DBCol2         = "Personnel";
                GUICol2        = Catalog.GetString("Personnel");
            }

            // Now we can initialise our little data table that backs the checkbox list view
            DTUsedBy.Columns.Add(DBCol1).DataType = typeof(Boolean);
            DTUsedBy.Columns.Add(DBCol2).DataType = typeof(String);
            DTUsedBy.Columns.Add(DBCol3).DataType = typeof(String);

            // Add a 'Context' column so we can filter the data
            ContextColumnOrdinal = FMainDS.PDataLabel.Columns.Add("Context", typeof(int)).Ordinal;

            // Add a 'Used By' column to our main dataset (Do it twice so we track changes)
            FMainDS.PDataLabel.Columns.Add("UsedByInit", typeof(String));
            UsedByColumnOrdinal = FMainDS.PDataLabel.Columns.Add(DBUsedBy, typeof(String)).Ordinal;

            // Add a 'Converted Data Type' column to the dataset because we want to 'translate' from geeky database entries to friendly user ones
            // This column data is derived from an expression
            string expression = String.Format("IIF(p_data_type_c='char','{0}',", Catalog.GetString("Text"));

            expression           += String.Format("IIF(p_data_type_c='float','{0}',", Catalog.GetString("Number"));
            expression           += String.Format("IIF(p_data_type_c='currency','{0}',", Catalog.GetString("Currency"));
            expression           += String.Format("IIF(p_data_type_c='boolean','{0}',", Catalog.GetString("Yes/No"));
            expression           += String.Format("IIF(p_data_type_c='date','{0}',", Catalog.GetString("Date"));
            expression           += String.Format("IIF(p_data_type_c='time','{0}',", Catalog.GetString("Time"));
            expression           += String.Format("IIF(p_data_type_c='lookup','{0}',", Catalog.GetString("Option List"));
            expression           += String.Format("IIF(p_data_type_c='partnerkey','{0}',", Catalog.GetString("Partner Key"));
            expression           += String.Format("'{0}'))))))))", Catalog.GetString("Unknown"));
            DataTypeColumnOrdinal = FMainDS.PDataLabel.Columns.Add("DataTypeEx", typeof(System.String), expression).Ordinal;

            // Load the Extra Data from DataLabelUse table
            Type DataTableType;

            FExtraDS.PDataLabelUse = new PDataLabelUseTable();
            DataTable CacheDT = TDataCache.GetCacheableDataTableFromCache("DataLabelUseList", String.Empty, null, out DataTableType);

            FExtraDS.PDataLabelUse.Merge(CacheDT);

            // Take each row of our main dataset and populate the new column with relevant data
            //   from the DataLabelUse table
            foreach (PDataLabelRow labelRow in FMainDS.PDataLabel.Rows)
            {
                string    usedBy = String.Empty;
                int       key    = labelRow.Key;
                DataRow[] rows   = FExtraDS.PDataLabelUse.Select("p_data_label_key_i=" + key.ToString());

                foreach (PDataLabelUseRow useRow in rows)
                {
                    if (usedBy != String.Empty)
                    {
                        usedBy += ",";
                    }

                    usedBy += useRow.Use;

                    // Update the value of our MaxIdx1Value variable
                    if (useRow.Idx1 > MaxIdx1Value)
                    {
                        MaxIdx1Value = useRow.Idx1;
                    }
                }

                // Initially our two new columns hold the same values, but if we make a change we modify the second one.
                labelRow[UsedByColumnOrdinal - 1] = usedBy;                     // since we added this column manually, it does not have a handy property
                labelRow[UsedByColumnOrdinal]     = usedBy;                     // since we added this column manually, it does not have a handy property

                if (usedBy.IndexOf("personnel", StringComparison.InvariantCultureIgnoreCase) >= 0)
                {
                    labelRow[ContextColumnOrdinal] = (int)Context.Personnel;
                }
                else if (usedBy.IndexOf("termapp", StringComparison.InvariantCultureIgnoreCase) >= 0)
                {
                    labelRow[ContextColumnOrdinal] = (int)Context.Application;
                }
                else
                {
                    labelRow[ContextColumnOrdinal] = (int)Context.Partner;
                }
            }

            // So now our main data set has everything we need
            // But the grid doesn't know about our new column yet
            // We do that in 'RunOnceOnActivationManual()'

            // Set the form title and list box content depending on our context
            if (CurrentContext == Context.Partner)
            {
                this.Text = "Maintain Local Partner Data Fields";
                AddRowToUsedByList("Person", Catalog.GetString("Person"));
                AddRowToUsedByList("Family", Catalog.GetString("Family"));
                AddRowToUsedByList("Church", Catalog.GetString("Church"));
                AddRowToUsedByList("Organisation", Catalog.GetString("Organisation"));
                AddRowToUsedByList("Bank", Catalog.GetString("Bank"));
                AddRowToUsedByList("Unit", Catalog.GetString("Unit"));
                AddRowToUsedByList("Venue", Catalog.GetString("Venue"));
            }
            else if (CurrentContext == Context.Application)
            {
                this.Text = "Maintain Local Application Data Fields";
                AddRowToUsedByList("LongTermApp", Catalog.GetString("Long Term"));
                AddRowToUsedByList("ShortTermApp", Catalog.GetString("Short Term"));
            }
            else if (CurrentContext == Context.Personnel)
            {
                this.Text = "Maintain Local Personnel Data Fields";
                AddRowToUsedByList("Personnel", Catalog.GetString("Personnel"));
                clbUsedBy.Visible = false;
            }

            //Set up our checked list box columns and bind to our DTUsedBy table
            clbUsedBy.AddCheckBoxColumn(GUIUsedBy, DTUsedBy.Columns[0], 17, false);
            clbUsedBy.AddTextColumn(GUICol2, DTUsedBy.Columns[2], 169);
            clbUsedBy.DataBindGrid(DTUsedBy, DBCol3, DBCol1, DBCol2, false, false, false);
            FPetraUtilsObject.SetStatusBarText(clbUsedBy, Catalog.GetString("Choose the screens when this label will be used"));

            // Now we have to deal with the form controls that depend on the selection of DataType
            // and we only want one visible at a time - so hide these three
            pnlCurrencyCode.Visible       = false;
            pnlLookupCategoryCode.Visible = false;
            pnlNumDecimalPlaces.Visible   = false;

            // We can prevent screen 'flicker' by setting the DefaultView RowFilter to some stupid setting that finds no rows
            // This stops the auto-genertaed code populating the list with incorrect data before we get it right in our code
            //  that runs later (RunOnceOnActivationManual)
            // Actually this line was added after completing the rest of the code.  Having added it I could probably
            //   remove a few lines elsewhere, but I am not going to because I don't want to break anything!
            FMainDS.PDataLabel.DefaultView.RowFilter = "Context=0";

            // We need to capture the 'DataSaved' event, so we can save our Extra DataSet
            FPetraUtilsObject.DataSaved         += new TDataSavedHandler(FPetraUtilsObject_DataSaved);
            FPetraUtilsObject.DataSavingStarted += new TDataSavingStartHandler(FPetraUtilsObject_DataSavingStarted);
        }
Exemple #12
0
 /// <summary>
 /// Sets the Text of the Gift Destination.
 /// </summary>
 /// <param name="AGiftDestination">Gift Destination.</param>
 public void SetGiftDestinationText(String AGiftDestination)
 {
     txtGiftDestination.Text = AGiftDestination;
     FPetraUtilsObject.SetStatusBarText(txtGiftDestination, AGiftDestination);
 }
        private void InitializeManualCode()
        {
            FGiftDetailFindObject = TRemote.MFinance.Finance.UIConnectors.GiftDetailFind();

            // remove from the combobox all ledger numbers which the user does not have permission to access
            DataView cmbLedgerDataView = (DataView)cmbLedger.cmbCombobox.DataSource;

            for (int i = 0; i < cmbLedgerDataView.Count; i++)
            {
                string LedgerNumberStr;

                // postgresql
                if (cmbLedgerDataView[i].Row[0].GetType().Equals(typeof(int)))
                {
                    LedgerNumberStr = ((int)cmbLedgerDataView[i].Row[0]).ToString("0000");
                }
                else // sqlite
                {
                    LedgerNumberStr = ((Int64)cmbLedgerDataView[i].Row[0]).ToString("0000");
                }

                if (!UserInfo.GUserInfo.IsInModule("LEDGER" + LedgerNumberStr))
                {
                    cmbLedgerDataView.Delete(i);
                    i--;
                }
            }

            // add event to combobox (this is the best moment to do this)
            cmbLedger.SelectedValueChanged += new System.EventHandler(this.OnCmbLedgerChange);

            // add divider line (can't currently do this in YAML)
            DevAge.Windows.Forms.Line linCriteriaDivider = new DevAge.Windows.Forms.Line();
            linCriteriaDivider.Anchor =
                ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) |
                                                      System.Windows.Forms.AnchorStyles.Right)));
            linCriteriaDivider.DashStyle   = System.Drawing.Drawing2D.DashStyle.Solid;
            linCriteriaDivider.FirstColor  = System.Drawing.SystemColors.ControlDark;
            linCriteriaDivider.LineStyle   = DevAge.Windows.Forms.LineStyle.Horizontal;
            linCriteriaDivider.Location    = new System.Drawing.Point(grpFindCriteria.Location.Y + 6, btnSearch.Location.Y - 2);
            linCriteriaDivider.Name        = "linCriteriaDivider";
            linCriteriaDivider.SecondColor = System.Drawing.SystemColors.ControlLightLight;
            linCriteriaDivider.Size        = new System.Drawing.Size(grpFindCriteria.Size.Width - 12, 2);
            grpFindCriteria.Controls.Add(linCriteriaDivider);

            // pnlBlankSearchResult
            pnlBlankSearchResult.BackColor = System.Drawing.SystemColors.ControlLightLight;
            pnlBlankSearchResult.Size      = grdResult.Size; lblSearchInfo.Anchor =
                ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
                                                       System.Windows.Forms.AnchorStyles.Left) |
                                                      System.Windows.Forms.AnchorStyles.Right)));

            // lblSearchInfo
            this.lblSearchInfo.Font =
                new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblSearchInfo.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
            lblSearchInfo.Size           = grdResult.Size;
            lblSearchInfo.TextAlign      = System.Drawing.ContentAlignment.MiddleCenter;

            // remove '0' from these textboxes
            txtGiftBatchNumber.NumberValueInt       = null;
            txtGiftTransactionNumber.NumberValueInt = null;
            txtReceiptNumber.NumberValueInt         = null;
            txtMinimumAmount.NumberValueInt         = null;
            txtMaximumAmount.NumberValueInt         = null;

            // set button to be on the very right of the screen (can't make this work in YAML)
            btnClear.Location = new System.Drawing.Point(linCriteriaDivider.Location.X + linCriteriaDivider.Width - btnClear.Width,
                                                         btnClear.Location.Y);

            // set to blank initially
            lblRecordCounter.Text = "";

            // event fired on screen close
            this.Closed += new System.EventHandler(this.TGiftDetailFindScreen_Closed);

            // catch enter on all controls, to trigger search or accept (could use this.AcceptButton, but we have several search buttons etc)
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CatchEnterKey);

            // catch enter on grid to view the selected transaction
            this.grdResult.EnterKeyPressed += new Ict.Common.Controls.TKeyPressedEventHandler(this.BtnView_Click);

            // fix tab order
            int Temp = txtDonor.TabIndex;

            txtDonor.TabIndex                 = cmbMotivationGroup.TabIndex;
            cmbMotivationGroup.TabIndex       = txtRecipient.TabIndex;
            txtRecipient.TabIndex             = dtpDateTo.TabIndex;
            dtpDateTo.TabIndex                = txtMinimumAmount.TabIndex;
            txtMinimumAmount.TabIndex         = txtComment1.TabIndex;
            txtComment1.TabIndex              = dtpDateFrom.TabIndex;
            dtpDateFrom.TabIndex              = cmbMotivationDetail.TabIndex;
            cmbMotivationDetail.TabIndex      = txtReceiptNumber.TabIndex;
            txtReceiptNumber.TabIndex         = txtGiftTransactionNumber.TabIndex;
            txtGiftTransactionNumber.TabIndex = Temp;

            this.ActiveControl = txtGiftBatchNumber;

            // set statusbar messages
            FPetraUtilsObject.SetStatusBarText(cmbLedger, Catalog.GetString("Select a ledger"));
            FPetraUtilsObject.SetStatusBarText(txtGiftBatchNumber, Catalog.GetString("Enter a Gift Batch Number"));
            FPetraUtilsObject.SetStatusBarText(txtGiftTransactionNumber, Catalog.GetString("Enter a Gift Transaction Number"));
            FPetraUtilsObject.SetStatusBarText(txtReceiptNumber, Catalog.GetString("Enter a Gift Receipt Number"));
            FPetraUtilsObject.SetStatusBarText(cmbMotivationGroup, Catalog.GetString("Select a Motivation Group"));
            FPetraUtilsObject.SetStatusBarText(cmbMotivationDetail, Catalog.GetString("Select a Motivation Detail"));
            FPetraUtilsObject.SetStatusBarText(txtComment1, Catalog.GetString("Enter a Comment"));
            FPetraUtilsObject.SetStatusBarText(txtDonor, Catalog.GetString("Enter a Donor's Partner Key"));
            FPetraUtilsObject.SetStatusBarText(txtRecipient, Catalog.GetString("Enter a Recipient's Partner Key"));
            FPetraUtilsObject.SetStatusBarText(dtpDateFrom, Catalog.GetString("Enter a date for which gifts must have been entered on or after"));
            FPetraUtilsObject.SetStatusBarText(dtpDateTo, Catalog.GetString("Enter a date for which gifts must have been entered on or before"));
            FPetraUtilsObject.SetStatusBarText(txtMinimumAmount,
                                               Catalog.GetString("Enter an amount for which gifts must have an amount equal or greater than"));
            FPetraUtilsObject.SetStatusBarText(txtMaximumAmount,
                                               Catalog.GetString("Enter an amount for which gifts must have an amount equal or less than"));
            FPetraUtilsObject.SetStatusBarText(btnSearch, Catalog.GetString("Searches the OpenPetra database with above criteria"));
            FPetraUtilsObject.SetStatusBarText(btnClear, Catalog.GetString("Clears the search criteria fields and the search result"));
            FPetraUtilsObject.SetStatusBarText(btnView, Catalog.GetString("Views the selected Gift"));

            FinishButtonPanelSetup();
        }