private void viewChequeExpenseDetailsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ic.account_AL_statementC _obj = iGrid1.SelectedRows[0].Tag as ic.account_AL_statementC;
     if (_obj != null)
     {
         if (_obj.statement_type == em.account_statement_typeS.bank_withdraw)
         {
             if (_obj.record_id > 0)
             {
                 ic.bankWithDrawC _withDraw = datam.GetWithDrawnCheque(_obj.record_id);
                 using (var _fm = new ViewChequeExpenses())
                 {
                     _fm.Tag   = _withDraw;
                     _fm.Owner = this;
                     _fm.ShowDialog();
                 }
             }
         }
     }
 }
示例#2
0
        private void transferChequeBalanceToUnBankedCashToolStripMenuItem_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            ic.bankWithDrawC _obj = fGrid.SelectedRows[0].Tag as ic.bankWithDrawC;
            string           _str = string.Format("Are You Sure You Want To Transfer The Cheque Balance Of {0} To UNBANKED Account ??", _obj.cheque_balance.ToNumberDisplayFormat());

            if (!dbm.WarningMessage(_str, "Transfer Warrning"))
            {
                return;
            }
            _str = string.Format("update acc_bank_withdraw_tb set cheque_balance=(cheque_balance-{0}),{1},fs_time_stamp={2} where wdr_id={3} and cheque_balance={4} and transfer_id=0", _obj.cheque_balance,
                                 dbm.ETS, SQLH.UnixStamp, _obj.wdr_id, _obj.cheque_balance);
            using (var xd = new xing())
            {
                xd.UpdateFsTimeStamp("acc_bank_withdraw_tb");
                if (!xd.SingleUpdateCommand(_str))
                {
                    MessageBox.Show("You Need To ReEnter This Entry To Prevent Double Expense Entry", "Multi User Double Entry Error");
                    xd.RollBackTransaction();
                    return;
                }
                else
                {
                    string[] _cols = new string[]
                    {
                        "source_type_id",
                        "source_id",
                        "transaction_id",
                        "destination_type_id",
                        "destination_id",
                        "amount",
                        "fs_date",
                        "fs_id",
                        "fs_time_stamp",
                        "lch_id"
                    };
                    var _ts_id  = accn.AccountsTransaction(xd, string.Format("Being Transfer Of Cheque Balance for {0} To UnBanked Cash", _obj.cheque_no), sdata.CURR_DATE);
                    var _ret_id = xd.SingleInsertCommandTSPInt("acc_cash_transfer_tb", _cols, new object[]
                    {
                        em.CashTransferSourceType.expense_cheque.ToInt16(),
                        _obj.wdr_id,
                        _ts_id,
                        em.CashTransferDestinationType.un_banked_cash_account,
                        accn.GetAccountByAlias("UNBANKED_CASH").account_id,
                        _obj.cheque_balance,
                        sdata.CURR_DATE,
                        sdata.CURR_FS.fs_id,
                        0,
                        datam.LCH_ID
                    });
                    xd.SingleUpdateCommandALL("acc_bank_withdraw_tb", new string[]
                    {
                        "transfer_id",
                        "wdr_id"
                    }, new object[]
                    {
                        _ret_id,
                        _obj.wdr_id
                    }, 1);
                    //
                    accn.JournalBook(xd, sdata.CURR_DATE, em.j_sectionS.cash, _ts_id, accn.GetAccountByAlias("CASH_ACCOUNT").account_id, 0, _obj.cheque_balance);
                    accn.JournalBook(xd, sdata.CURR_DATE, em.j_sectionS.cash, _ts_id, accn.GetAccountByAlias("UNBANKED_CASH").account_id, _obj.cheque_balance, 0);
                }
                xd.CommitTransaction();
            }
            //

            Application.DoEvents();
            CheckForUpdates();
            timer1.Enabled = true;
        }