public void loadDiscountCurveData(DateTime refDate, string currency) { clsSET_DISCOUNTCURVE_TB tb = new clsSET_DISCOUNTCURVE_TB(); tb.CURR = currency; DataTable dt = tb.Select(); foreach (DataRow dr in dt.Select()) { tb = clsSET_DISCOUNTCURVE_TB.Create(dr); } string curveID = tb.CURVE_ID; this.loadCurveData(refDate, curveID,clsHDAT_CURVEDATA_TB.RATE_TYP_Type.SPOT); }
public void buildTestData() { clsSET_DISCOUNTCURVE_TB clsTB = new clsSET_DISCOUNTCURVE_TB(); string[] currStr = { "KRW" ,"USD"}; string[] curveIDStr = { "IRSKRW" , "IRSUSD" }; int currListLength = currStr.Length; int curveIDListLength = curveIDStr.Length; for (int i = 0; i < currListLength; i++) { clsTB.CURR = currStr[i]; clsTB.CURVE_ID = curveIDStr[i]; clsTB.START_DT = "20150101"; clsTB.END_DT = "20301231"; clsTB.SETTING_ID = "MYSETTING"; clsTB.Insert(); } }
public clsSET_DISCOUNTCURVE_TB Clone() { try { clsSET_DISCOUNTCURVE_TB cloneTB = new clsSET_DISCOUNTCURVE_TB(); cloneTB._SETTING_ID = this._SETTING_ID; cloneTB._CURR = this._CURR; cloneTB._CURVE_ID = this._CURVE_ID; cloneTB._START_DT = this._START_DT; cloneTB._END_DT = this._END_DT; return cloneTB; } catch(Exception ex) { throw new Exception(ex.Message); } }
public static clsSET_DISCOUNTCURVE_TB Create(DataRow dr) { try { clsSET_DISCOUNTCURVE_TB tb = new clsSET_DISCOUNTCURVE_TB(); tb._SETTING_ID = Convert.ToString(dr[0]); tb._CURR = Convert.ToString(dr[1]); tb._CURVE_ID = Convert.ToString(dr[2]); tb._START_DT = Convert.ToString(dr[3]); tb._END_DT = Convert.ToString(dr[4]); return tb; } catch(Exception ex) { throw new Exception(ex.Message); } }
//private void evalCurveMap() //{ // // eval --------------------------------------------------------- // this.EvalCurveMap_.Clear(); // clsSET_EVALUATIONCURVE_TB clstb = new clsSET_EVALUATIONCURVE_TB(); // clstb.SETTING_ID = "MYSETTING"; // DataTable tb = clstb.Select(); // foreach (DataRow dr in tb.Select()) // { // CurveManager cm = new CurveManager(); // clsSET_EVALUATIONCURVE_TB clstb_roop = clsSET_EVALUATIONCURVE_TB.Create(dr); // cm.loadCurveData(this.CalcDate_, clstb_roop.CURVE_ID, clsHDAT_CURVEDATA_TB.RATE_TYP_Type.YTM); // this.EvalCurveMap_.Add(clstb_roop.INDEX_CD, cm.yieldCurve(this.CurveShift_)); // this.EvalCurveManagerMap_.Add(clstb_roop.INDEX_CD, cm); // //this.EvalCurveMap_.Add(clstb_roop.INDEX_CD, cm); // } //} private void discountCurveMap() { // discount --------------------------------------------------------- //this.DiscountCurveMap_.Clear(); this.DiscountCurveManagerMap_.Clear(); clsSET_DISCOUNTCURVE_TB clstb = new clsSET_DISCOUNTCURVE_TB(); clstb.SETTING_ID = "MYSETTING"; DataTable tb = clstb.Select(); foreach (DataRow dr in tb.Select()) { YieldCurve cm = new YieldCurve(); clsSET_DISCOUNTCURVE_TB clstb_roop = clsSET_DISCOUNTCURVE_TB.Create(dr); cm.loadCurveData(this.CalcDate_, clstb_roop.CURVE_ID,clsHDAT_CURVEDATA_TB.RATE_TYP_Type.SPOT); //this.DiscountCurveMap_.Add(clstb_roop.CURR, cm.yieldCurve()); this.DiscountCurveManagerMap_.Add(clstb_roop.CURR, cm); //this.DiscountCurveMap_.Add(clstb_roop.CURR, cm); } }