public KospiFutureSpreadInfo GetKospiFutureSpreadInfo() { KospiFutureSpreadInfo kfsi = new KospiFutureSpreadInfo(); kfsi.FutureCode1 = KospiFutureUtil.Ins().KFI.Code; kfsi.FutureCode2 = KospiFutureUtil.Ins().KFI2.Code; kfsi.Code = String.Format("401{0}{1}S", kfsi.FutureCode1.Substring(3, 2), kfsi.FutureCode2.Substring(3, 2)); return kfsi; }
public void SetFutureSpreadInfo(KospiFutureSpreadInfo kfsi) { this.KFSI = kfsi; }
void InsertFutureSpreadInfo(KospiFutureSpreadInfo data) { DBManager dbManager = new DBManager(); MySqlConnection con = null; try { String ip = IP; con = dbManager.CreateConnection(ip, CommonConst.DATABASE_MADVIPER); con.Open(); String query_template = String.Format("insert into kospi_future_spread_info ({0}) values ({1})", "code, future_1, future_2", "'{0}', '{1}', '{2}'"); String query = String.Format( query_template, data.Code, data.FutureCode1, data.FutureCode2); logger.Debug(query); MySqlCommand cmd = new MySqlCommand(query, con); int ret = cmd.ExecuteNonQuery(); if (ret <= 0) { logger.Warn(String.Format("Query: ({0})", query)); } } catch (System.Exception ex) { logger.Warn(ex.ToString()); } finally { dbManager.Close(con); } }