private void TabChange(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; if (tabSearchResult.SelectedTab == tpgOutstandingInvoices) { // Invoice tab has been selected... mniInvoice.Visible = true; mniSupplier.Visible = false; if (FInvoiceFindObject == null) { FInvoiceFindObject = TRemote.MFinance.AP.UIConnectors.Find(); } ucoOutstandingInvoices.LoadInvoices(); } else { // Suppliers tab has been selected... mniSupplier.Visible = true; mniInvoice.Visible = false; if (FSupplierFindObject == null) { FSupplierFindObject = TRemote.MFinance.AP.UIConnectors.Find(); } ucoSuppliers.LoadSuppliers(); } this.Cursor = Cursors.Default; }
/// <summary> /// /// </summary> /// <param name="ANeededPage"></param> /// <param name="APageSize"></param> /// <param name="ATotalRecords"></param> /// <param name="ATotalPages"></param> /// <returns></returns> private DataTable GetDataPagedResult(Int16 ANeededPage, Int16 APageSize, out Int32 ATotalRecords, out Int16 ATotalPages) { ATotalRecords = 0; ATotalPages = 0; IAPUIConnectorsFind findObject = FMainForm.InvoiceFindObject; if (findObject != null) { DataTable NewPage = findObject.GetDataPagedResult(ANeededPage, APageSize, out ATotalRecords, out ATotalPages); // change CreditNote amounts to negatives foreach (DataRow Row in NewPage.Rows) { if (Row["CreditNoteFlag"].Equals(true)) { Row["TotalAmount"] = -(Decimal)Row["TotalAmount"]; Row["OutstandingAmount"] = -(Decimal)Row["OutstandingAmount"]; } } if (FInvoiceTable == null) { FInvoiceTable = NewPage; } return(NewPage); } return(null); }
private void TabChange(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; if (tabSearchResult.SelectedTab == tpgOutstandingInvoices) { // Invoice tab has been selected... if (FInvoiceFindObject == null) { FInvoiceFindObject = TRemote.MFinance.AP.UIConnectors.Find(); } ucoOutstandingInvoices.LoadInvoices(); } else if (tabSearchResult.SelectedTab == tpgSupplierTransactionHistory) { // Supplier transaction history tab has been selected... ucoSupplierTransactionHistory.LoadSupplier(FLedgerNumber, ucoSuppliers.GetCurrentlySelectedSupplier()); } else { // Suppliers tab has been selected... if (FSupplierFindObject == null) { FSupplierFindObject = TRemote.MFinance.AP.UIConnectors.Find(); } ucoSuppliers.LoadSuppliers(); } SetEnabledStates(tabSearchResult.SelectedTab); this.Cursor = Cursors.Default; }
/// <summary> /// Load the supplier and all the transactions (invoices and payments) that relate to it. /// </summary> /// <param name="ALedgerNumber"></param> /// <param name="APartnerKey"></param> public void LoadSupplier(Int32 ALedgerNumber, Int64 APartnerKey) { this.Cursor = Cursors.WaitCursor; FLedgerNumber = ALedgerNumber; FPartnerKey = APartnerKey; FMainDS = TRemote.MFinance.AP.WebConnectors.LoadAApSupplier(ALedgerNumber, APartnerKey); FSupplierRow = FMainDS.AApSupplier[0]; txtFilteredBalance.CurrencyCode = FSupplierRow.CurrencyCode; txtSupplierBalance.CurrencyCode = FSupplierRow.CurrencyCode; txtTaggedBalance.CurrencyCode = FSupplierRow.CurrencyCode; lblExcludedItems.Text = string.Format(lblExcludedItems.Text, FSupplierRow.CurrencyCode); // Get our AP ledger settings and enable/disable the corresponding search option on the filter panel TFrmLedgerSettingsDialog settings = new TFrmLedgerSettingsDialog(this, ALedgerNumber); FRequireApprovalBeforePosting = settings.APRequiresApprovalBeforePosting; Control rbtForApproval = FFilterAndFindObject.FilterPanelControls.FindControlByName("rbtForApproval"); rbtForApproval.Enabled = FRequireApprovalBeforePosting; // // Transactions older than DateTime AgedOlderThan = DateTime.Now; if (!FSupplierRow.IsPreferredScreenDisplayNull()) { AgedOlderThan = AgedOlderThan.AddMonths(0 - FSupplierRow.PreferredScreenDisplay); } FAgedOlderThan = AgedOlderThan.ToString("u"); txtSupplierName.Text = FMainDS.PPartner[0].PartnerShortName; txtSupplierCurrency.Text = FSupplierRow.CurrencyCode; FFindObject = TRemote.MFinance.AP.UIConnectors.Find(); FFindObject.FindSupplierTransactions(FLedgerNumber, FPartnerKey); // Start thread that checks for the end of the search operation on the PetraServer FKeepUpSearchFinishedCheck = true; Thread FinishedCheckThread = new Thread(new ThreadStart(SearchFinishedCheckThread)); FinishedCheckThread.Start(); this.Text = Catalog.GetString("Supplier Transactions") + " - " + TFinanceControls.GetLedgerNumberAndName(FLedgerNumber); }
private void Form_Closed(object sender, EventArgs e) { if (FSupplierFindObject != null) { // UnRegister Object from the TEnsureKeepAlive Class so that the Object can get GC'd on the PetraServer TEnsureKeepAlive.UnRegister(FSupplierFindObject); FSupplierFindObject = null; } if (FInvoiceFindObject != null) { // UnRegister Object from the TEnsureKeepAlive Class so that the Object can get GC'd on the PetraServer TEnsureKeepAlive.UnRegister(FInvoiceFindObject); FInvoiceFindObject = null; } }
/// <summary> /// /// </summary> /// <param name="ANeededPage"></param> /// <param name="APageSize"></param> /// <param name="ATotalRecords"></param> /// <param name="ATotalPages"></param> /// <returns></returns> private DataTable GetDataPagedResult(Int16 ANeededPage, Int16 APageSize, out Int32 ATotalRecords, out Int16 ATotalPages) { ATotalRecords = 0; ATotalPages = 0; IAPUIConnectorsFind findObject = FMainForm.SupplierFindObject; if (findObject != null) { DataTable NewPage = findObject.GetDataPagedResult(ANeededPage, APageSize, out ATotalRecords, out ATotalPages); if (FSupplierTable == null) { FSupplierTable = NewPage; } return(NewPage); } return(null); }
private void TabChange(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; if (tabSearchResult.SelectedTab == tpgOutstandingInvoices) { // Invoice tab has been selected... mniInvoice.Visible = true; mniSupplier.Visible = false; if (FInvoiceFindObject == null) { FInvoiceFindObject = TRemote.MFinance.AP.UIConnectors.Find(); // Register Object with the TEnsureKeepAlive Class so that it doesn't get GC'd TEnsureKeepAlive.Register(FInvoiceFindObject); } ucoOutstandingInvoices.LoadInvoices(); } else { // Suppliers tab has been selected... mniSupplier.Visible = true; mniInvoice.Visible = false; if (FSupplierFindObject == null) { FSupplierFindObject = TRemote.MFinance.AP.UIConnectors.Find(); // Register Object with the TEnsureKeepAlive Class so that it doesn't get GC'd TEnsureKeepAlive.Register(FSupplierFindObject); } ucoSuppliers.LoadSuppliers(); } this.Cursor = Cursors.Default; }
/// <summary> /// Load the supplier and all the transactions (invoices and payments) that relate to it. /// </summary> /// <param name="ALedgerNumber"></param> /// <param name="APartnerKey"></param> public void LoadSupplier(Int32 ALedgerNumber, Int64 APartnerKey) { this.Cursor = Cursors.WaitCursor; FLedgerNumber = ALedgerNumber; FPartnerKey = APartnerKey; FMainDS = TRemote.MFinance.AP.WebConnectors.LoadAApSupplier(ALedgerNumber, APartnerKey); FSupplierRow = FMainDS.AApSupplier[0]; // Get our AP ledger settings and enable/disable the corresponding search option on the filter panel TFrmLedgerSettingsDialog settings = new TFrmLedgerSettingsDialog(this, ALedgerNumber); FRequireApprovalBeforePosting = settings.APRequiresApprovalBeforePosting; Control rbtForApproval = FFilterAndFindObject.FilterPanelControls.FindControlByName("rbtForApproval"); rbtForApproval.Enabled = FRequireApprovalBeforePosting; // // Transactions older than DateTime AgedOlderThan = DateTime.Now; if (!FSupplierRow.IsPreferredScreenDisplayNull()) { AgedOlderThan = AgedOlderThan.AddMonths(0 - FSupplierRow.PreferredScreenDisplay); } FAgedOlderThan = AgedOlderThan.ToString("u"); txtSupplierName.Text = FMainDS.PPartner[0].PartnerShortName; txtSupplierCurrency.Text = FSupplierRow.CurrencyCode; FFindObject = TRemote.MFinance.AP.UIConnectors.Find(); FFindObject.FindSupplierTransactions(FLedgerNumber, FPartnerKey); // Start thread that checks for the end of the search operation on the PetraServer FKeepUpSearchFinishedCheck = true; Thread FinishedCheckThread = new Thread(new ThreadStart(SearchFinishedCheckThread)); FinishedCheckThread.Start(); this.Text = Catalog.GetString("Supplier Transactions") + " - " + TFinanceControls.GetLedgerNumberAndName(FLedgerNumber); }
private void Form_Closed(object sender, EventArgs e) { FSupplierFindObject = null; FInvoiceFindObject = null; }