Ejemplo n.º 1
0
        private void RunOnceOnActivationManual()
        {
            FPetraUtilsObject.DataSaved += new TDataSavedHandler(FPetraUtilsObject_DataSaved);

            // Load the data from the Fees Payable cached table
            Type      DataTableType;
            DataTable CacheDT = TDataCache.GetCacheableDataTableFromPetraServer("FeesPayableList", String.Empty, FFilter, out DataTableType);

            FExtraDS.AFeesPayable.Merge(CacheDT);
            FExtraDS.AFeesPayable.DefaultView.Sort = String.Format("{0}, {1} ASC",
                                                                   AFeesPayableTable.GetLedgerNumberDBName(), AFeesPayableTable.GetFeeCodeDBName());

            SelectRowInGrid(1);
            UpdateRecordNumberDisplay();
        }
        private void RunOnceOnActivationManual()
        {
            FPetraUtilsObject.DataSaved += new TDataSavedHandler(FPetraUtilsObject_DataSaved);

            // Load the data from the Fees Payable cached table
            Type      DataTableType;
            DataTable CacheDT = TDataCache.GetCacheableDataTableFromPetraServer("FeesPayableList", String.Empty, FFilter, out DataTableType);

            FExtraDS.AFeesPayable.Merge(CacheDT);
            FExtraDS.AFeesPayable.DefaultView.Sort = String.Format("{0}, {1} ASC",
                                                                   AFeesPayableTable.GetLedgerNumberDBName(), AFeesPayableTable.GetFeeCodeDBName());

            ALedgerRow LedgerRow =
                ((ALedgerTable)TDataCache.TMFinance.GetCacheableFinanceTable(TCacheableFinanceTablesEnum.LedgerDetails, FLedgerNumber))[0];

            txtDetailChargeAmount.CurrencyCode = LedgerRow.BaseCurrency;

            SelectRowInGrid(1);
            UpdateRecordNumberDisplay();
        }
Ejemplo n.º 3
0
        partial void ValidateFeesReceivableListManual(ref TVerificationResultCollection AVerificationResult, TTypedDataTable ASubmitTable)
        {
            Type DataTableType;
            AFeesPayableTable otherTable = (AFeesPayableTable)TCacheableTablesManager.GCacheableTablesManager.GetCachedDataTable("FeesPayableList",
                                                                                                                                 out DataTableType);

            otherTable.DefaultView.Sort = String.Format("{0}, {1} ASC", AFeesPayableTable.GetLedgerNumberDBName(), AFeesPayableTable.GetFeeCodeDBName());

            for (int i = 0; i < ASubmitTable.Rows.Count; i++)
            {
                DataRow row = ASubmitTable.Rows[i];

                if ((row.RowState == DataRowState.Added) || (row.RowState == DataRowState.Modified))
                {
                    string feeCode      = row[AFeesReceivableTable.ColumnFeeCodeId].ToString();
                    int    ledgerNumber = Convert.ToInt32(row[AFeesReceivableTable.ColumnLedgerNumberId]);

                    int otherRowNum = otherTable.DefaultView.Find(new object[] { ledgerNumber, feeCode });

                    if (otherRowNum >= 0)
                    {
                        AFeesPayableRow otherRow  = (AFeesPayableRow)(otherTable.DefaultView[otherRowNum].Row);
                        string          otherUser = otherRow.CreatedBy;

                        if (!String.IsNullOrEmpty(otherRow.ModifiedBy))
                        {
                            otherUser = otherRow.ModifiedBy;
                        }

                        // The message text doesn't get back to the user - but maybe one day it will
                        throw new EDBConcurrencyException(String.Format(Catalog.GetString(
                                                                            "While you were editing this screen another user created a fee code '{0}' for the Grants Payable screen.  You will have to close and re-open the Grants Receivable screen and make your changes again."),
                                                                        feeCode),
                                                          "write",
                                                          otherTable.TableName,
                                                          otherUser,
                                                          otherRow.ModificationId);
                    }
                }
            }
        }