예제 #1
0
        private void BtnView_Click(object sender, EventArgs e)
        {
            // get the currently selected row
            DataRow CurrentlySelectedRow = GetCurrentDataRow();

            if (CurrentlySelectedRow != null)
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;

                    TFrmGiftBatch gb = new TFrmGiftBatch(this);

                    // load dataset with data for whole transaction (all details)
                    gb.ViewModeTDS = TRemote.MFinance.Gift.WebConnectors.LoadAGiftSingle(FLedgerNumber,
                                                                                         (int)CurrentlySelectedRow["a_batch_number_i"],
                                                                                         (int)CurrentlySelectedRow["a_gift_transaction_number_i"]);

                    if (gb.ViewModeTDS.AGiftBatch[0].BatchStatus == MFinanceConstants.BATCH_POSTED)
                    {
                        // read only if gift belongs to a posted batch
                        gb.ViewMode = true;
                        gb.ShowDetailsOfOneBatch(FLedgerNumber, (int)CurrentlySelectedRow["a_batch_number_i"],
                                                 gb.ViewModeTDS.AGiftBatch[0].BatchYear, gb.ViewModeTDS.AGiftBatch[0].BatchPeriod);
                    }
                    else
                    {
                        gb.ShowDetailsOfOneBatch(FLedgerNumber, (int)CurrentlySelectedRow["a_batch_number_i"],
                                                 gb.ViewModeTDS.AGiftBatch[0].BatchYear, gb.ViewModeTDS.AGiftBatch[0].BatchPeriod);
                        gb.DisableBatches();
                    }

                    gb.SelectTab(TFrmGiftBatch.eGiftTabs.Transactions);
                    gb.FindGiftDetail((AGiftDetailRow)gb.ViewModeTDS.AGiftDetail.Rows.Find(
                                          new object[] { FLedgerNumber,
                                                         CurrentlySelectedRow["a_batch_number_i"],
                                                         CurrentlySelectedRow["a_gift_transaction_number_i"],
                                                         CurrentlySelectedRow["a_detail_number_i"] }));
                }
                finally
                {
                    this.Cursor = Cursors.Default;
                }
            }
        }
        private void ViewTransaction(object sender, EventArgs e)
        {
            // get the currently selected row
            FPreviouslySelectedDetailRow = GetSelectedDetailRow();

            if ((FPreviouslySelectedDetailRow != null) && (FMainDS != null))
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;

                    TFrmGiftBatch gb = new TFrmGiftBatch(this);

                    // load dataset with data for whole transaction (all details)
                    gb.ViewModeTDS = TRemote.MFinance.Gift.WebConnectors.LoadAGiftSingle(FLedgerNumber,
                        (int)FPreviouslySelectedDetailRow["BatchNumber"],
                        (int)FPreviouslySelectedDetailRow["GiftTransactionNumber"]);

                    if (gb.ViewModeTDS.AGiftBatch[0].BatchStatus == MFinanceConstants.BATCH_POSTED)
                    {
                        // read only if gift belongs to a posted batch
                        gb.ViewMode = true;
                        gb.ShowDetailsOfOneBatch(FLedgerNumber, (int)FPreviouslySelectedDetailRow["BatchNumber"],
                            gb.ViewModeTDS.AGiftBatch[0].BatchYear, gb.ViewModeTDS.AGiftBatch[0].BatchPeriod);
                    }
                    else
                    {
                        gb.ShowDetailsOfOneBatch(FLedgerNumber, (int)FPreviouslySelectedDetailRow["BatchNumber"],
                            gb.ViewModeTDS.AGiftBatch[0].BatchYear, gb.ViewModeTDS.AGiftBatch[0].BatchPeriod);
                        gb.DisableBatches();
                    }

                    gb.SelectTab(TFrmGiftBatch.eGiftTabs.Transactions);
                    gb.FindGiftDetail((AGiftDetailRow)gb.ViewModeTDS.AGiftDetail.Rows.Find(
                            new object[] { FLedgerNumber,
                                           FPreviouslySelectedDetailRow["BatchNumber"],
                                           FPreviouslySelectedDetailRow["GiftTransactionNumber"],
                                           FPreviouslySelectedDetailRow["DetailNumber"] }));
                }
                finally
                {
                    this.Cursor = Cursors.Default;
                }
            }
        }