近日.NET C#编码感悟

 
    金融软件系统的安全性是很重要的.近应客户及公司领导方的设计思路.对TCBS所有相关与交易的UI界面进行了改造,以期实现全方位监管用户登陆及操作金融信息系统的功能.便于后期金融银行相关工作的开展.

摘举编写修改的TCBS部分代码如下述

 系统日切界面,下个工作日命令按钮处理事件

private void btnNextBussDay_Click(object sender, EventArgs e)
        {
            Cursor currCursor = Cursor.Current;
            try
            {
                try
                {
                    Cursor.Current = Cursors.WaitCursor;
                    this.calPostDt.SelectedDate = new DateTime?(this._nextPostDate);
                    this.txtChCaryDt.Value = this._nextCarryOverDate.ToString(FI.DateFormat);
                    this.CheckStateChange("NextBusReadOnly", EventArgs.Empty);
                    BankOptionValueObj bankOptionValueObj = this.cmbSysSts.SelectedItem as BankOptionValueObj;

                    //////20111229 zxy 星期四 添加 (jx设计的特殊交易及非金融性交易相关处理逻辑) IF用于处理系统处理BATCH批处理状态
                    if (bankOptionValueObj.BankOptionValue != "ONLINE")
                    {
                        this.cmbSysSts.DataSource = null;

                        
                         ///20111229 zxy 星期四 添加 (jx设计的特殊交易及非金融性交易相关处理逻辑)
                        BankOptionValueObjCollection.SetParameters("XGGR", "日切下个工作日", long.MinValue, null, null, null, "INQ", null);
                        BankOptionValueObjCollection bankOptionValueObjCol = BankOptionValueObjCollection.GetBankOptionValueObjCollection("SS", new object[] { BankOptionValueObjFetch.Basic });
                       



                        this.cmbSysSts.DataBinding(bankOptionValueObjCol, "BankOptionValueDesc", "BANKOPTIONVALUE");
                        int index = 0;
                        foreach (BankOptionValueObj bankOps in this.cmbSysSts.Items)
                        {
                            if (bankOps.BankOptionValue == "ONLINE")
                            {
                                break;
                            }
                            index++;
                        }
                        this.cmbSysSts.SelectedIndex = index;
                    }
                }
                catch (Exception excp)
                {
                    base.ShowDetailException(excp);
                }
            }
            finally
            {
                Cursor.Current = currCursor;
            }
        }

上述界面调用之BO相关代码
protected override void Director_Fetch(object criteria)
        {
            try
            {
                using (DataAccessManager dam = new DataAccessManager())
                {
                    this.SvrFetch(dam, criteria);
                    
                    ///20111230 zxy 星期五 添加 (jx设计的特殊交易及非金融性交易相关处理逻辑)
                    if (_txnTypCd != null)
                    {
                        NmonTxn.SvrGetNmonTxn(dam, _txnTypCd, _txnNote, _relPersNbr, long.MinValue, _relMediumId, _mediaAcctSeqNo, _relAcctNbr, long.MinValue, _dataBaseActvCd, _apprHistColl, new object[] { });
                    }
                 }
            }
            catch (DataAccessException excp)
            {
                throw new CoreBusinessException(99999L, excp, "Exception occurred while attempting a {0} fetch. Key: {1}", new string[] { "BankOptionValueObjCollection", ((Criteria) criteria).Key });
            }
        }

        ///20111230 zxy 星期五 添加 (jx设计的特殊交易及非金融性交易相关处理逻辑)
        public static void SetParameters(string txnTypCd, string txnNote, long relPersNbr, string relMediumId, string mediaAcctSeqNo, string relAcctNbr, string dataBaseActvCd, ApprHistCollection apprHistColl)
        {
            _txnTypCd = txnTypCd;
            _txnNote = txnNote;
            _mediaAcctSeqNo = mediaAcctSeqNo;
            _relPersNbr = relPersNbr;
            _relMediumId = relMediumId;
            _relAcctNbr = relAcctNbr;
            _dataBaseActvCd = dataBaseActvCd;
            _apprHistColl = apprHistColl;
        }



小结

 某些BO由众多UI界面调用,在修改前一定要想法弄清哪些界面调用它,
方可实施对其BO的修改

TCBS bo的代码处理逻辑要梳理清晰

请使用浏览器的分享功能分享到微信等