private void RunOnceOnActivationManual() { FPetraUtilsObject.DataSaved += new TDataSavedHandler(FPetraUtilsObject_DataSaved); // Load the data from the Fees Receivable cached table Type DataTableType; DataTable CacheDT = TDataCache.GetSpecificallyFilteredCacheableDataTableFromCache("FeesReceivableList", "Ledger", FFilter, out DataTableType); FExtraDS.AFeesReceivable.Merge(CacheDT); FExtraDS.AFeesReceivable.DefaultView.Sort = String.Format("{0}, {1} ASC", AFeesReceivableTable.GetLedgerNumberDBName(), AFeesReceivableTable.GetFeeCodeDBName()); ALedgerRow LedgerRow = ((ALedgerTable)TDataCache.TMFinance.GetCacheableFinanceTable(TCacheableFinanceTablesEnum.LedgerDetails, FLedgerNumber))[0]; txtDetailChargeAmount.CurrencyCode = LedgerRow.BaseCurrency; SelectRowInGrid(1); UpdateRecordNumberDisplay(); }
partial void ValidateFeesPayableListManual(ref TVerificationResultCollection AVerificationResult, TTypedDataTable ASubmitTable) { Type DataTableType; AFeesReceivableTable otherTable = (AFeesReceivableTable)TCacheableTablesManager.GCacheableTablesManager.GetCachedDataTable( "FeesReceivableList", out DataTableType); otherTable.DefaultView.Sort = String.Format("{0}, {1} ASC", AFeesReceivableTable.GetLedgerNumberDBName(), AFeesReceivableTable.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[AFeesPayableTable.ColumnFeeCodeId].ToString(); int ledgerNumber = Convert.ToInt32(row[AFeesPayableTable.ColumnLedgerNumberId]); int otherRowNum = otherTable.DefaultView.Find(new object[] { ledgerNumber, feeCode }); if (otherRowNum >= 0) { AFeesReceivableRow otherRow = (AFeesReceivableRow)(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 Receivable screen. You will have to close and re-open the Grants Payable screen and make your changes again."), feeCode), "write", otherTable.TableName, otherUser, otherRow.ModificationId); } } } }
private void RunOnceOnActivationManual() { FPetraUtilsObject.DataSaved += new TDataSavedHandler(FPetraUtilsObject_DataSaved); // Load the data from the Fees Receivable cached table Type DataTableType; DataTable CacheDT = TDataCache.GetCacheableDataTableFromPetraServer("FeesReceivableList", String.Empty, FFilter, out DataTableType); FExtraDS.AFeesReceivable.Merge(CacheDT); FExtraDS.AFeesReceivable.DefaultView.Sort = String.Format("{0}, {1} ASC", AFeesReceivableTable.GetLedgerNumberDBName(), AFeesReceivableTable.GetFeeCodeDBName()); SelectRowInGrid(1); UpdateRecordNumberDisplay(); }