private void PostBatch(System.Object sender, EventArgs e) { //get index position of row to post int newCurrentRowPos = GetSelectedRowIndex(); if (FPostLogicObject.PostBatch(FPreviouslySelectedDetailRow, dtpDetailDateEffective.Date.Value, FStartDateCurrentPeriod, FEndDateLastForwardingPeriod)) { // AlanP - commenting out most of this because it should be unnecessary - or should move to ShowDetailsManual() ////Select unposted batch row in same index position as batch just posted //grdDetails.DataSource = null; //grdDetails.DataSource = new DevAge.ComponentModel.BoundDataView(FMainDS.ABatch.DefaultView); if (grdDetails.Rows.Count > 1) { //Needed because posting process forces grid events which sets FDetailGridRowsCountPrevious = FDetailGridRowsCountCurrent // such that a removal of a row is not detected SelectRowInGrid(newCurrentRowPos); } else { EnableButtonControl(false); ClearDetailControls(); btnNew.Focus(); pnlDetails.Enabled = false; } UpdateRecordNumberDisplay(); FFilterAndFindObject.SetRecordNumberDisplayProperties(); } }
private void PostBatch(System.Object sender, EventArgs e) { // Although the screen can be used with FINANCE-1, Posting requires FINANCE-2 TSecurityChecks.CheckUserModulePermissions("FINANCE-2", "PostBatch [raised by Client Proxy for ModuleAccessManager]"); if ((GetSelectedRowIndex() < 0) || (FPreviouslySelectedDetailRow == null)) { MessageBox.Show(Catalog.GetString("Please select a GL Batch before posting!")); return; } //get index position of row to post int NewCurrentRowPos = GetSelectedRowIndex(); TFrmGLBatch MainForm = (TFrmGLBatch)this.ParentForm; try { MainForm.FCurrentGLBatchAction = TGLBatchEnums.GLBatchAction.POSTING; if (FPostLogicObject.PostBatch(FPreviouslySelectedDetailRow, dtpDetailDateEffective.Date.Value, FStartDateCurrentPeriod, FEndDateLastForwardingPeriod)) { // AlanP - commenting out most of this because it should be unnecessary - or should move to ShowDetailsManual() ////Select unposted batch row in same index position as batch just posted //grdDetails.DataSource = null; //grdDetails.DataSource = new DevAge.ComponentModel.BoundDataView(FMainDS.ABatch.DefaultView); if (grdDetails.Rows.Count > 1) { //Needed because posting process forces grid events which sets FDetailGridRowsCountPrevious = FDetailGridRowsCountCurrent // such that a removal of a row is not detected SelectRowInGrid(NewCurrentRowPos); } else { EnableButtonControl(false); ClearDetailControls(); btnNew.Focus(); pnlDetails.Enabled = false; } UpdateRecordNumberDisplay(); FFilterAndFindObject.SetRecordNumberDisplayProperties(); } } finally { MainForm.FCurrentGLBatchAction = TGLBatchEnums.GLBatchAction.NONE; } }