Beispiel #1
0
        private void build_cashMaster()
        { 
            #region Build Base Cash Master
            
            // cash를 만듬 -----------------------------------------------------------
            clsMAST_BOOKINFO_TB clstb_bookinfo = new clsMAST_BOOKINFO_TB();
            // krw 없는 booklist를 에다가 krw를 넣음

            DataTable noKRWCash_dt = clstb_bookinfo.SelectBookNoKRWCash();

            foreach (DataRow dr in noKRWCash_dt.Select() )
            {
                CurrencyCash cash_fi = 
                    CurrencyCash.CurrencyCashBooking("KRW",clsMAST_BOOKINFO_TB.Create(dr).BOOK_CD,this.ReferenceDate_);

                //cash_fi.build_cashPosition(this.ReferenceDate_);
            }

            DataTable totalBook_dt = clstb_bookinfo.Select();

            // 각각의 북마다 krw를 제외한 Currency 를 뜸
            clsHITM_CASH_INSTOCK_TB clstb_cash = new clsHITM_CASH_INSTOCK_TB();
            clsMAST_FP_INSTRUMENT_TB clstb_master = new clsMAST_FP_INSTRUMENT_TB();

            foreach (DataRow dr in totalBook_dt.Select())
            {
                string book_cd = clsMAST_BOOKINFO_TB.Create(dr).BOOK_CD;

                // book별 cash list
                foreach ( DataRow dr2 in clstb_cash.SelectCashesInEachBook(book_cd).Select() )
                {
                    string currency = clsHITM_CASH_INSTOCK_TB.Create(dr2).CURR;

                    if (clstb_master.SelectHasCurrency(currency, book_cd).Rows.Count == 0)
                    {
                        if (currency != "KRW")
                        { 
                            CurrencyCash cash_fi = 
                                CurrencyCash.CurrencyCashBooking(currency, clsMAST_BOOKINFO_TB.Create(dr).BOOK_CD, this.ReferenceDate_);
                        } 

                        //cash_fi.build_cashPosition(this.ReferenceDate_);

                    }

                }
                
            }

            #endregion

            // if 오늘 부킹댄거면 position , emptyGreekResult 만듬.
            clstb_master.FP_MASTER_TYP = (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Money_Cash;
            clstb_master.BOOKED_DT = this.ReferenceDate_.ToString("yyyyMMdd");

            DataTable cash_dt = clstb_master.Select();

            foreach (DataRow dr in cash_dt.Select())
            {
                clsMAST_FP_INSTRUMENT_TB tb = clsMAST_FP_INSTRUMENT_TB.Create(dr);
                CurrencyCash cash_fi = (CurrencyCash)Financial_instrument.CreateInstrument(tb);
                cash_fi.build_cashPosition(this.ReferenceDate_);
                //cash_fi.build_emptyResult(this.ReferenceDate_);
            }

        }