Exemplo n.º 1
0
        // 나중에 ETL 까지 같이 생각해야함... 지금은 RDW에서 가져옴.
        //public void loadNPV(DateTime referenceDate)
        //{
        //    // db 접속 후 로드함. 그리고 나머지 계산함..?

        //    this.referenceDate_ = referenceDate;

        //    this.npv_ = 999999;
        //    this.dailyProfitLoss_ = 999999;
        //    this.totalProfitLoss_ = 999999;

        //    DataTable tb = new DataTable();

        //    using (SqlCeConnection connection = new SqlCeConnection(connectionStr_))
        //    using (SqlCeCommand command = connection.CreateCommand())
        //    {
        //        string exportItemCodeWrap = QueryStr.wrapComma(this.exportItemCode_);

        //        command.CommandText = "SELECT DATE, TRADE_ID , NPV , TOTAL_PL , " +
        //                                    " DAILY_PL,EXPORT_ITEMCODE FROM POSITION_PL WHERE EXPORT_ITEMCODE =" + exportItemCodeWrap;

        //        connection.Open();
        //        SqlCeDataAdapter dataAdapter = new SqlCeDataAdapter(command.CommandText, connection);

        //        dataAdapter.Fill(tb);
        //    }

        //    DataRow[] resultRows = tb.Select();

        //    if (resultRows.Length == 0)
        //    {
        //        OutputLogViewModel.addResult("no result pl : " + tradeID_);
        //    }

        //    foreach (DataRow item in resultRows)
        //    {
        //        //this.tradeID_ = item["ITEM_CODE"].ToString();
        //        //this.Name_ = item["ITEM_NAME"].ToString();

        //        this.npv_ = Convert.ToDouble(item["TRADE_ID"].ToString());
        //        this.totalProfitLoss_ = Convert.ToDouble(item["TYPE"].ToString());
        //        this.dailyProfitLoss_ = Convert.ToDouble(item["TYPE"].ToString());

        //        //mivm.TradeDate_ = DateTime.Parse(item["TRADE_DATE"].ToString());
        //        //mivm.MaturityDate_ = DateTime.Parse(item["MATURITY_DATE"].ToString());
        //    }
        //}

        public Control view()
        {
            Control v = new Excel_profitLossView();

            v.DataContext = this;

            return(v);
        }
        // 나중에 ETL 까지 같이 생각해야함... 지금은 RDW에서 가져옴.
        //public void loadNPV(DateTime referenceDate)
        //{
        //    // db 접속 후 로드함. 그리고 나머지 계산함..?

        //    this.referenceDate_ = referenceDate;

        //    this.npv_ = 999999;
        //    this.dailyProfitLoss_ = 999999;
        //    this.totalProfitLoss_ = 999999;

        //    DataTable tb = new DataTable();

        //    using (SqlCeConnection connection = new SqlCeConnection(connectionStr_))
        //    using (SqlCeCommand command = connection.CreateCommand())
        //    {
        //        string exportItemCodeWrap = QueryStr.wrapComma(this.exportItemCode_);

        //        command.CommandText = "SELECT DATE, TRADE_ID , NPV , TOTAL_PL , " +
        //                                    " DAILY_PL,EXPORT_ITEMCODE FROM POSITION_PL WHERE EXPORT_ITEMCODE =" + exportItemCodeWrap;

        //        connection.Open();
        //        SqlCeDataAdapter dataAdapter = new SqlCeDataAdapter(command.CommandText, connection);

        //        dataAdapter.Fill(tb);
        //    }

        //    DataRow[] resultRows = tb.Select();

        //    if (resultRows.Length == 0)
        //    {
        //        OutputLogViewModel.addResult("no result pl : " + tradeID_);
        //    }

        //    foreach (DataRow item in resultRows)
        //    {
        //        //this.tradeID_ = item["ITEM_CODE"].ToString();
        //        //this.Name_ = item["ITEM_NAME"].ToString();

        //        this.npv_ = Convert.ToDouble(item["TRADE_ID"].ToString());
        //        this.totalProfitLoss_ = Convert.ToDouble(item["TYPE"].ToString());
        //        this.dailyProfitLoss_ = Convert.ToDouble(item["TYPE"].ToString());

        //        //mivm.TradeDate_ = DateTime.Parse(item["TRADE_DATE"].ToString());
        //        //mivm.MaturityDate_ = DateTime.Parse(item["MATURITY_DATE"].ToString());
        //    }
        //}

        public Control view()
        {
            Control v = new Excel_profitLossView();

            v.DataContext = this;

            return v;
        }