private void deleteMemberPlegdeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (var _fm = new SdaHelperManager.ConfirmWPwd())
            {
                _fm.ShowDialog();
                if (_fm.DialogResult != DialogResult.OK)
                {
                    return;
                }
            }
            var _obj = fGrid.SelectedRows[0].Tag as ic.pledgeC;

            _obj.pledge_status = em.pledge_statusS.deleted;
            string _str = "Are You Sure You Want To Delete This Member Pledge ??";

            using (var xd = new xing())
            {
                var _d_obj = xd.ExecuteScalarObject("select pl_status from pledge_master_tb where pl_id=" + _obj.pl_id);
                if (_d_obj != null)
                {
                    if (_d_obj.ToInt16() == em.pledge_statusS.deleted.ToInt16())
                    {
                        MessageBox.Show("You Have Already Deleted This Member Pledge", "Already Deleted");
                        return;
                    }
                }
                if (!dbm.WarningMessage(_str, "Delete Warning"))
                {
                    return;
                }
                //
                xd.SingleUpdateCommandALL("pledge_master_tb", new string[] { "pl_status", "pl_id" }, new object[]
                {
                    em.pledge_statusS.deleted.ToInt16(),
                    _obj.pl_id
                }, 1);
                //
                xd.SingleUpdateCommandALL("pledge_payment_mvt_tb", new string[] { "status", "pl_id" }, new object[]
                {
                    0,
                    _obj.pl_id
                }, 1);
                //
                xd.SingleUpdateCommandALL("pledge_addition_tb", new string[] { "pl_status", "pl_id" }, new object[]
                {
                    em.pledge_statusS.deleted.ToInt16(),
                    _obj.pl_id
                }, 1);

                //
                accn.PledgeSummary(xd, (_obj.amount_pledged * -1), (_obj.amount_paid * -1), _obj.pls_id);
                //
                xd.CommitTransaction();
            }
            fGrid.Rows.RemoveAt(fGrid.Rows[_obj.pl_id.ToString()].Index);
            if (this.Tag != null)
            {
                this.Tag = null;
            }
        }
Exemplo n.º 2
0
        private void ts_delete_Click(object sender, EventArgs e)
        {
            using (var _fm = new SdaHelperManager.ConfirmWPwd())
            {
                _fm.ShowDialog();
                if (_fm.DialogResult != DialogResult.OK)
                {
                    return;
                }
            }
            string _str = "Are You Sure You Want To Delete The Expense Account ??";
            iGRow  _row = fGrid.SelectedRows[0];
            var    _obj = fGrid.SelectedRows[0].Tag as ic.expense_accountC;

            if (_obj == null)
            {
                return;
            }
            if (dbm.ExecuteScalarInt(string.Format("select TOP 1 exp_acc_id from acc_expense_trans_tb where exp_acc_id={0}", _obj.exp_acc_id)) > 0)
            {
                MessageBox.Show("Cannot Delete This Expense Account Since Has Important Attachements To Other Records Already", "Delete Failure");
                return;
            }
            if (!dbm.WarningMessage(_str, "Delete Warning"))
            {
                return;
            }
            using (var xd = new xing())
            {
                xd.SingleDeleteCommandExp("acc_expense_accounts_tb", new string[]
                {
                    "exp_acc_id", "lch_id"
                }, new int[] { _obj.exp_acc_id, datam.LCH_ID });

                _row.Tag = null;
                fGrid.Rows.RemoveAt(_row.Index);
                datam.DATA_EXPENSE_ACCOUNTS.Remove(_obj.exp_acc_id);
                //
                xd.SingleDeleteCommandExp("accounts_tb", new string[]
                {
                    "account_id",
                }, new int[] { _obj.sys_account_id });
                //
                datam.DATA_ACCOUNTS.Remove(_obj.sys_account_id);
                xd.CommitTransaction();
                sdata.ClearFormCache(em.fm.chart_of_accounts.ToInt16());
            }
        }
Exemplo n.º 3
0
        private void reEnableAccountToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string _str = "Are You Sure You Want To Re-Enable This Income Account ??";
            iGRow  _row = fGrid.SelectedRows[0];
            var    _obj = fGrid.SelectedRows[0].Tag as ic.accountC;

            if (_obj == null)
            {
                return;
            }
            using (var _fm = new SdaHelperManager.ConfirmWPwd())
            {
                _fm.ShowDialog();
                if (_fm.DialogResult != DialogResult.OK)
                {
                    return;
                }
            }
            if (!dbm.WarningMessage(_str, "Re-Enable Warning"))
            {
                return;
            }
            using (var xd = new xing())
            {
                xd.SingleUpdateCommandALL("accounts_tb", new string[]
                {
                    "account_status_id",
                    "account_id"
                }, new object[]
                {
                    em.account_statusS.Enabled.ToByte(),
                    _obj.account_id
                }, 1);

                _obj.account_status = em.account_statusS.Enabled;
                xd.CommitTransaction();
                sdata.ClearFormCache(em.fm.chart_of_accounts.ToInt16());
                sdata.ClearFormCache(em.fm.accounts_balances_manager.ToInt16());
                sdata.ClearFormCache(em.fm.analyze_offering_weekly.ToInt16());
                sdata.ClearFormCache(em.fm.offering_range_1.ToInt16());
                sdata.ClearFormCache(em.fm.sabbath_cash_statement.ToInt16());
                sdata.ClearFormCache(em.fm.quarter_cash.ToInt16());
            }
            (this.Owner as IncomeAccountsManager).EditRow(_obj);
            fGrid.Rows.RemoveAt(fGrid.Rows[_obj.account_id.ToString()].Index);
        }
        private void deletePledgeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (var _fm = new SdaHelperManager.ConfirmWPwd())
            {
                _fm.ShowDialog();
                if (_fm.DialogResult != DialogResult.OK)
                {
                    return;
                }
            }
            var _obj = iGrid1.SelectedRows[0].Tag as ic.pledgeSettingC;

            _obj.status = em.pledge_setting_statusS.deleted;
            string _str = "Are You Sure You Want To Delete This Pledge Account ??";

            if (!dbm.WarningMessage(_str, "Cancel Warning"))
            {
                return;
            }
            using (var xd = new xing())
            {
                xd.SingleUpdateCommandALL("pledge_settings_tb", new string[] { "status", "pls_id" }, new object[]
                {
                    em.pledge_setting_statusS.deleted.ToInt16(),
                    _obj.pls_id
                }, 1);
                //
                xd.SingleUpdateCommandALL("pledge_master_tb", new string[] { "pl_status", "pls_id" }, new object[]
                {
                    em.pledge_statusS.deleted.ToInt16(),
                    _obj.pls_id
                }, 1);
                //
                xd.SingleUpdateCommandALL("pledge_payment_mvt_tb", new string[] { "status", "pls_id" }, new object[]
                {
                    0,
                    _obj.pls_id
                }, 1);
                xd.CommitTransaction();
            }
            iGrid1.Rows.RemoveAt(iGrid1.Rows[_obj.pls_id.ToString()].Index);
        }